VAPoR  0.1
DataMgrAMR.h
Go to the documentation of this file.
1 //
2 // $Id$
3 //
4 
5 #ifndef _DataMgrAMR_h_
6 #define _DataMgrAMR_h_
7 
8 
9 #include <vector>
10 #include <string>
11 #include <vapor/DataMgr.h>
12 #include <vapor/AMRIO.h>
13 #include <vapor/common.h>
14 
15 namespace VAPoR {
16 
17 //
24 //
25 class VDF_API DataMgrAMR : public DataMgr, public AMRIO {
26 
27 public:
28 
29  DataMgrAMR(
30  const string &metafile,
31  size_t mem_size
32  );
33 
34  DataMgrAMR(
35  const MetadataVDC &metadata,
36  size_t mem_size
37  );
38 
39 
40  virtual ~DataMgrAMR() {};
41 
42 protected:
43 
44 
45  //
46  // Metadata methods
47  //
48  virtual void _GetDim(size_t dim[3], int reflevel) const {
49  return(AMRIO::GetDim(dim, reflevel));
50  };
51 
52  virtual void _GetBlockSize(size_t bs[3], int /*reflevel*/) const {
53  for (int i=0; i<3; i++) bs[i] = _bs[i];
54  }
55 
56  virtual int _GetNumTransforms() const {
57  return(AMRIO::GetNumTransforms());
58  };
59 
60  virtual vector<double> _GetExtents(size_t ts = 0) const {
61  return(AMRIO::GetExtents(ts));
62  };
63 
64  virtual long _GetNumTimeSteps() const {
65  return(AMRIO::GetNumTimeSteps());
66  };
67 
68  virtual vector <string> _GetVariables3D() const {
69  return(AMRIO::GetVariables3D());
70  };
71 
72  virtual vector <string> _GetVariables2DXY() const {
73  return(AMRIO::GetVariables2DXY());
74  };
75  virtual vector <string> _GetVariables2DXZ() const {
76  return(AMRIO::GetVariables2DXZ());
77  };
78  virtual vector <string> _GetVariables2DYZ() const {
79  return(AMRIO::GetVariables2DYZ());
80  };
81 
82  virtual vector<long> _GetPeriodicBoundary() const {
84  };
85 
86  virtual vector<long> _GetGridPermutation() const {
87  return(AMRIO::GetGridPermutation());
88  };
89 
90  virtual double _GetTSUserTime(size_t ts) const {
91  return(AMRIO::GetTSUserTime(ts));
92  };
93 
94  virtual void _GetTSUserTimeStamp(size_t ts, string &s) const {
96  };
97 
98 
99  virtual int _VariableExists(
100  size_t ts,
101  const char *varname,
102  int reflevel = 0,
103  int lod = 0
104  ) const {
105  return (AMRIO::VariableExists(ts,varname,reflevel));
106  };
107 
108  virtual int _OpenVariableRead(
109  size_t timestep,
110  const char *varname,
111  int reflevel = 0,
112  int lod = 0
113  );
114 
115  virtual void _GetValidRegion(
116  size_t min[3], size_t max[3], int reflevel
117  ) const {
118  return(AMRIO::GetValidRegion(
119  min, max, reflevel)
120  );
121  };
122 
123  virtual const float *_GetDataRange() const {
124  return(AMRIO::GetDataRange());
125  }
126 
127  virtual int _BlockReadRegion(
128  const size_t bmin[3], const size_t bmax[3],
129  float *region
130  );
131 
132  virtual int _CloseVariable() {
133  return (AMRIO::CloseVariable());
134  };
135 
136 
137 private:
138  AMRTree _amrtree;
139  size_t _ts;
140  int _reflevel;
141  size_t _bs[3];
142  size_t _bsshift[3];
143 
144  int _DataMgrAMR();
145  int _ReadBlocks(
146  const AMRTree *amrtree, int reflevel,
147  const size_t bmin[3], const size_t bmax[3],
148  float *blocks
149  );
150 
151 };
152 
153 };
154 
155 #endif // _DataMgrAMR_h_
virtual vector< long > _GetPeriodicBoundary() const
Definition: DataMgrAMR.h:82
vector< string > GetVariables2DYZ() const
Definition: MetadataVDC.h:553
void GetTSUserTimeStamp(size_t ts, string &s) const
Definition: MetadataVDC.h:730
virtual vector< double > _GetExtents(size_t ts=0) const
Definition: DataMgrAMR.h:60
vector< long > GetPeriodicBoundary() const
Definition: MetadataVDC.h:601
#define VDF_API
Definition: common.h:61
virtual int _CloseVariable()
Definition: DataMgrAMR.h:132
const float * GetDataRange() const
Definition: AMRIO.h:306
virtual void _GetBlockSize(size_t bs[3], int) const
Definition: DataMgrAMR.h:52
A cache based data reader.
Definition: DataMgr.h:40
A cache based data reader.
Definition: DataMgrAMR.h:25
virtual const float * _GetDataRange() const
Definition: DataMgrAMR.h:123
virtual double _GetTSUserTime(size_t ts) const
Definition: DataMgrAMR.h:90
virtual int _VariableExists(size_t ts, const char *varname, int reflevel=0, int lod=0) const
Definition: DataMgrAMR.h:99
virtual vector< string > _GetVariables2DYZ() const
Definition: DataMgrAMR.h:78
virtual vector< string > _GetVariables3D() const
Definition: DataMgrAMR.h:68
virtual vector< long > _GetGridPermutation() const
Definition: DataMgrAMR.h:86
virtual void GetDim(size_t dim[3], int reflevel=0) const
Performs data IO to VDF files.
Definition: AMRIO.h:45
A class for managing data set metadata.
Definition: MetadataVDC.h:92
virtual vector< string > _GetVariables2DXZ() const
Definition: DataMgrAMR.h:75
virtual long _GetNumTimeSteps() const
Definition: DataMgrAMR.h:64
virtual int GetNumTransforms() const
Definition: MetadataVDC.h:308
virtual void _GetTSUserTimeStamp(size_t ts, string &s) const
Definition: DataMgrAMR.h:94
virtual void _GetDim(size_t dim[3], int reflevel) const
Definition: DataMgrAMR.h:48
int VariableExists(size_t ts, const char *varname, int reflevel=0, int lod=0) const
double GetTSUserTime(size_t ts) const
Definition: MetadataVDC.h:720
virtual vector< string > _GetVariables2DXY() const
Definition: DataMgrAMR.h:72
virtual int CloseVariable()
long GetNumTimeSteps() const
vector< double > GetExtents(size_t ts=0) const
vector< string > GetVariables2DXY() const
Definition: MetadataVDC.h:543
This class manages an AMR tree data structure.
Definition: AMRTree.h:62
vector< string > GetVariables3D() const
Definition: MetadataVDC.h:498
virtual int _GetNumTransforms() const
Definition: DataMgrAMR.h:56
void GetValidRegion(size_t min[3], size_t max[3], int reflevel) const
vector< string > GetVariables2DXZ() const
Definition: MetadataVDC.h:548
virtual void _GetValidRegion(size_t min[3], size_t max[3], int reflevel) const
Definition: DataMgrAMR.h:115
virtual ~DataMgrAMR()
Definition: DataMgrAMR.h:40
vector< long > GetGridPermutation() const
Definition: MetadataVDC.h:662