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

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

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

revision 2205 by caltinay, Tue Dec 23 04:13:15 2008 UTC revision 2206 by caltinay, Fri Jan 9 03:50:29 2009 UTC
# Line 17  Line 17 
17  #ifndef __MPDATASET_H__  #ifndef __MPDATASET_H__
18  #define __MPDATASET_H__  #define __MPDATASET_H__
19    
20  #include <string>  #include <escriptreader/common.h>
 #include <vector>  
21    
22  class DBfile;  class DBfile;
23    
# Line 27  namespace EscriptReader { Line 26  namespace EscriptReader {
26  class DataVar;  class DataVar;
27  class MeshWithElements;  class MeshWithElements;
28    
 typedef std::vector<std::string> StringVec;  
29  typedef std::vector<MeshWithElements*> MeshBlocks;  typedef std::vector<MeshWithElements*> MeshBlocks;
30    
31  struct VarInfo {  struct VarInfo {
# Line 39  struct VarInfo { Line 37  struct VarInfo {
37  typedef std::vector<VarInfo> VarVector;  typedef std::vector<VarInfo> VarVector;
38    
39    
40  //  /// \brief Represents an escript/finley dataset including mesh and variables for
41  // Represents an escript/finley dataset including mesh and variables for one  /// one timestep. The domain may consist of multiple blocks.
 // timestep. The domain may consist of multiple blocks.  
 //  
42  class MPDataSet  class MPDataSet
43  {  {
44  public:  public:
45      //      /// \brief Constructor.
     // Constructor  
     //  
46      MPDataSet();      MPDataSet();
47    
48      //      /// \brief Destructor.
     // Destructor  
     //  
49      ~MPDataSet();      ~MPDataSet();
50    
51      //      /// \brief Loads mesh and variables.
     // Loads mesh and variables  
     //  
52      bool load(const std::string meshFile, const StringVec& varFiles,      bool load(const std::string meshFile, const StringVec& varFiles,
53                const StringVec& varNames, int nBlocks);                const StringVec& varNames, int nBlocks);
54    
55      //      /// \brief Loads only variables using given external mesh.
     // Loads only variables using given external mesh  
     //  
56      bool load(const MeshBlocks& m, const std::string siloFile,      bool load(const MeshBlocks& m, const std::string siloFile,
57                const StringVec& varFiles, const StringVec& varNames);                const StringVec& varFiles, const StringVec& varNames);
58    
59      //      /// \brief Saves the dataset to a Silo file.
     // Saves the dataset to a Silo file  
     //  
60      bool saveAsSilo(const std::string siloFile, bool useMultiMesh=true);      bool saveAsSilo(const std::string siloFile, bool useMultiMesh=true);
61    
62      //      /// \brief Returns the dataset's mesh.
63      // Returns the dataset's mesh. Caller is responsible for freeing the      ///
64      // memory.      /// \note The caller is responsible for freeing the memory of the returned
65      //      /// mesh.
66      MeshBlocks extractMesh() { keepMesh = true; return meshBlocks; }      MeshBlocks extractMesh() { keepMesh = true; return meshBlocks; }
67    
68        /// \brief Returns the dataset's mesh.
69      const MeshBlocks& getMesh() const { return meshBlocks; }      const MeshBlocks& getMesh() const { return meshBlocks; }
70    
71        /// \brief Returns a vector with the dataset's variables.
72      const VarVector& getVariables() const { return variables; }      const VarVector& getVariables() const { return variables; }
73    
74        /// \brief Returns a vector with the mesh variables.
75      const VarVector& getMeshVariables() const { return meshVariables; }      const VarVector& getMeshVariables() const { return meshVariables; }
76    
77  private:  private:

Legend:
Removed from v.2205  
changed lines
  Added in v.2206

  ViewVC Help
Powered by ViewVC 1.1.26