VAPoR  0.1
DataMgrRAMSES.h
Go to the documentation of this file.
1 #ifndef RAMSESDataMg_h
2 #define RAMSESDataMg_h
3 
4 #include <list>
5 #include <string>
6 #include <vector>
7 
8 #include <vapor/DataMgr.h>
9 
10 using namespace std;
11 
12 namespace VAPoR {
13 
14 class VDF_API DataMgrRAMSES : public DataMgr {
15 
16 public:
17 
18  DataMgrRAMSES( const std::vector <string> &files, size_t mem_size );
19  virtual ~DataMgrRAMSES();
20 
21 protected:
22 
23  virtual int Initialize(std::vector <string> files);
24 
25  virtual string _GetGridType() const { return("regular"); }
26 
27  virtual int _GetNumTransforms() const { return(_numTransforms); };
28 
29  virtual long _GetNumTimeSteps() const { return(_userTime.size()); };
30 
31  virtual string _GetMapProjection() const {string empty; return (empty); };
32 
33  virtual void _GetBlockSize(size_t bs[3], int reflevel) const {
34  bs[0] = bs[1] = bs[2] = _bs;
35  }
36 
37  virtual std::vector <string> _GetVariables3D() const {
38  return(_variableNames);
39  }
40 
41  virtual std::vector <string> _GetVariables2DXY() const {
42  std::vector <string> empty; return (empty);
43  }
44 
45  virtual std::vector <string> _GetVariables2DXZ() const {
46  std::vector <string> empty; return (empty);
47  }
48 
49  virtual std::vector <string> _GetVariables2DYZ() const {
50  std::vector <string> empty; return (empty);
51  }
52 
53  virtual int _OpenVariableRead(
54  size_t timestep, const char *varname, int level, int
55  );
56 
57  virtual bool _GetMissingValue(string varname, float &value) const {
58  value=0.0;
59  return(false);
60  }
61 
62  virtual int _CloseVariable();
63 
64  virtual std::vector<double> _GetExtents(size_t ts) const {
65  return(_extents);
66  }
67 
68  virtual std::vector<long> _GetPeriodicBoundary() const {return(_bool_false);};
69 
70  virtual std::vector<long> _GetGridPermutation() const {
71  vector <long> p; p.push_back(0); p.push_back(1); p.push_back(2);
72  return(p);
73  }
74 
75  virtual const float *_GetDataRange() const {return(NULL);};
76 
77  virtual void _GetDim(size_t dim[3], int level) const ;
78 
79  virtual void _GetValidRegion( size_t min[3], size_t max[3], int) const;
80 
81  virtual int _BlockReadRegion( const size_t *, const size_t *, float *region);
82 
83  virtual double _GetTSUserTime(size_t ts) const {
84  if (ts>=_userTime.size()) ts = _userTime.size()-1;
85  return(_userTime[ts]);
86  };
87 
88  virtual void _GetTSUserTimeStamp(size_t ts, string &s) const;
89 
90  virtual int _VariableExists(
91  size_t ts, const char *varname, int reflevel = 0, int lod = 0
92  ) const;
93 
94 
95 private:
96  vector <string> _dataset;
97  size_t _base_level;
98  int _numTransforms;
99  std::vector <string> _variableNames;
100  std::vector <double> _userTime;
101  double _boxlen;
102  size_t _bs;
103  std::vector <double> _extents;
104  std::vector<long> _bool_false;
105  int _open_varid;
106  size_t _open_timestep;
107  int _open_level;
108  string _open_path;
109 
110  int _varLookup(string varname);
111 
112 
113 };
114 
115 };
116 #endif
virtual string _GetGridType() const
Definition: DataMgrRAMSES.h:25
virtual std::vector< string > _GetVariables2DYZ() const
Definition: DataMgrRAMSES.h:49
#define VDF_API
Definition: common.h:61
A cache based data reader.
Definition: DataMgr.h:39
virtual std::vector< string > _GetVariables2DXZ() const
Definition: DataMgrRAMSES.h:45
virtual bool _GetMissingValue(string varname, float &value) const
Definition: DataMgrRAMSES.h:57
virtual string _GetMapProjection() const
Definition: DataMgrRAMSES.h:31
virtual std::vector< long > _GetGridPermutation() const
Definition: DataMgrRAMSES.h:70
virtual double _GetTSUserTime(size_t ts) const
Definition: DataMgrRAMSES.h:83
virtual long _GetNumTimeSteps() const
Definition: DataMgrRAMSES.h:29
virtual std::vector< long > _GetPeriodicBoundary() const
Definition: DataMgrRAMSES.h:68
virtual const float * _GetDataRange() const
Definition: DataMgrRAMSES.h:75
virtual std::vector< string > _GetVariables3D() const
Definition: DataMgrRAMSES.h:37
virtual std::vector< string > _GetVariables2DXY() const
Definition: DataMgrRAMSES.h:41
virtual std::vector< double > _GetExtents(size_t ts) const
Definition: DataMgrRAMSES.h:64
virtual int _GetNumTransforms() const
Definition: DataMgrRAMSES.h:27
virtual void _GetBlockSize(size_t bs[3], int reflevel) const
Definition: DataMgrRAMSES.h:33