/[escript]/trunk/escript/src/Data.cpp
ViewVC logotype

Diff of /trunk/escript/src/Data.cpp

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 751 by bcumming, Mon Jun 26 01:46:34 2006 UTC revision 757 by woo409, Mon Jun 26 13:12:56 2006 UTC
# Line 11  Line 11 
11   *                                                          *   *                                                          *
12   ************************************************************   ************************************************************
13  */  */
   
14  #include "Data.h"  #include "Data.h"
15    
16  #include "DataExpanded.h"  #include "DataExpanded.h"
# Line 29  Line 28 
28  #include <algorithm>  #include <algorithm>
29  #include <vector>  #include <vector>
30  #include <functional>  #include <functional>
 #include <math.h>  
31    
32  #include <boost/python/dict.hpp>  #include <boost/python/dict.hpp>
33  #include <boost/python/extract.hpp>  #include <boost/python/extract.hpp>
# Line 1956  Data::archiveData(const std::string file Line 1954  Data::archiveData(const std::string file
1954    int dataPointSize = getDataPointSize();    int dataPointSize = getDataPointSize();
1955    int dataLength = getLength();    int dataLength = getLength();
1956    DataArrayView::ShapeType dataPointShape = getDataPointShape();    DataArrayView::ShapeType dataPointShape = getDataPointShape();
1957    int referenceNumbers[noSamples];    vector<int> referenceNumbers(noSamples);
1958    for (int sampleNo=0; sampleNo<noSamples; sampleNo++) {    for (int sampleNo=0; sampleNo<noSamples; sampleNo++) {
1959      referenceNumbers[sampleNo] = getFunctionSpace().getReferenceNoFromSampleNo(sampleNo);      referenceNumbers[sampleNo] = getFunctionSpace().getReferenceNoFromSampleNo(sampleNo);
1960    }    }
1961    int tagNumbers[noSamples];    vector<int> tagNumbers(noSamples);
1962    if (isTagged()) {    if (isTagged()) {
1963      for (int sampleNo=0; sampleNo<noSamples; sampleNo++) {      for (int sampleNo=0; sampleNo<noSamples; sampleNo++) {
1964        tagNumbers[sampleNo] = getFunctionSpace().getTagFromSampleNo(sampleNo);        tagNumbers[sampleNo] = getFunctionSpace().getTagFromSampleNo(sampleNo);
# Line 2114  Data::extractData(const std::string file Line 2112  Data::extractData(const std::string file
2112        dataPointShape.push_back(flatShape[dim]);        dataPointShape.push_back(flatShape[dim]);
2113      }      }
2114    }    }
2115    int referenceNumbers[noSamples];    vector<int> referenceNumbers(noSamples);
2116    for (int sampleNo=0; sampleNo<noSamples; sampleNo++) {    for (int sampleNo=0; sampleNo<noSamples; sampleNo++) {
2117      archiveFile.read(reinterpret_cast<char *>(&referenceNumbers[sampleNo]),sizeof(int));      archiveFile.read(reinterpret_cast<char *>(&referenceNumbers[sampleNo]),sizeof(int));
2118    }    }
2119    int tagNumbers[noSamples];    vector<int> tagNumbers(noSamples);
2120    if (dataType==2) {    if (dataType==2) {
2121      for (int sampleNo=0; sampleNo<noSamples; sampleNo++) {      for (int sampleNo=0; sampleNo<noSamples; sampleNo++) {
2122        archiveFile.read(reinterpret_cast<char *>(&tagNumbers[sampleNo]),sizeof(int));        archiveFile.read(reinterpret_cast<char *>(&tagNumbers[sampleNo]),sizeof(int));

Legend:
Removed from v.751  
changed lines
  Added in v.757

  ViewVC Help
Powered by ViewVC 1.1.26