/[escript]/trunk/tools/libescriptreader/src/escriptreader/MPDataSet.cpp
ViewVC logotype

Diff of /trunk/tools/libescriptreader/src/escriptreader/MPDataSet.cpp

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

revision 2189 by caltinay, Tue Dec 23 04:13:15 2008 UTC revision 2190 by caltinay, Wed Dec 24 02:04:16 2008 UTC
# Line 27  using namespace std; Line 27  using namespace std;
27    
28  namespace EscriptReader {  namespace EscriptReader {
29    
30    const char* MESH_VARS = "mesh_vars/";
31    
32  //  //
33  // Constructor  // Constructor
34  //  //
# Line 249  bool MPDataSet::saveAsSilo(string siloFi Line 251  bool MPDataSet::saveAsSilo(string siloFi
251          cerr << "Could not create Silo file." << endl;          cerr << "Could not create Silo file." << endl;
252          return false;          return false;
253      }      }
254        DBMkdir(dbfile, MESH_VARS);
255    
256      MeshBlocks::iterator meshIt;      MeshBlocks::iterator meshIt;
257      VarVector::iterator viIt;      VarVector::iterator viIt;
258      int idx = 0;      int idx = 0;
259      for (meshIt = meshBlocks.begin(); meshIt != meshBlocks.end(); meshIt++, idx++) {      for (meshIt = meshBlocks.begin(); meshIt != meshBlocks.end(); meshIt++, idx++) {
260          string siloPath("");          char str[64];
261          //if (numParts > 1) {          snprintf(str, 64, "/block%04d", idx);
262              char str[64];          string siloPath(str);
263              snprintf(str, 64, "/block%04d", idx);          DBMkdir(dbfile, siloPath.c_str());
             siloPath = str;  
             DBMkdir(dbfile, siloPath.c_str());  
         //}  
264          // write block of the mesh if we don't use an external mesh          // write block of the mesh if we don't use an external mesh
265          if (!siloMeshFile.length()) {          if (!siloMeshFile.length()) {
266              if (! (*meshIt)->writeToSilo(dbfile, siloPath)) {              if (! (*meshIt)->writeToSilo(dbfile, siloPath)) {
# Line 368  void MPDataSet::putSiloMultiVar(DBfile* Line 368  void MPDataSet::putSiloMultiVar(DBfile*
368          tempstrings.push_back(siloPath + string("/") + varName);          tempstrings.push_back(siloPath + string("/") + varName);
369          varnames.push_back((char*)tempstrings.back().c_str());          varnames.push_back((char*)tempstrings.back().c_str());
370      }      }
371      DBPutMultivar(dbfile, varName.c_str(), meshBlocks.size(), &varnames[0],      if (useMeshFile) {
372              &vartypes[0], NULL);          string vpath = string(MESH_VARS)+varName;
373            DBPutMultivar(dbfile, vpath.c_str(), meshBlocks.size(), &varnames[0],
374                    &vartypes[0], NULL);
375        } else {
376            DBPutMultivar(dbfile, varName.c_str(), meshBlocks.size(), &varnames[0],
377                    &vartypes[0], NULL);
378        }
379  #endif  #endif
380  }  }
381    

Legend:
Removed from v.2189  
changed lines
  Added in v.2190

  ViewVC Help
Powered by ViewVC 1.1.26