13 #include <vapor/MyBase.h>
14 #include <vapor/BlkMemMgr.h>
15 #include <vapor/common.h>
16 #include <vapor/RegularGrid.h>
17 #include <vapor/LayeredGrid.h>
18 #include <vapor/SphericalGrid.h>
19 #include <vapor/StretchedGrid.h>
51 VAR3D, VAR2D_XY, VAR2D_XZ, VAR2D_YZ
72 virtual void GetDim(
size_t dim[3],
int reflevel = 0)
const {
73 return(_GetDim(dim, reflevel));
82 virtual vector <size_t>
GetCRatios()
const {
return( _GetCRatios()); }
87 return(_GetCoordSystemType());
92 virtual string GetGridType()
const {
return(_GetGridType()); };
96 virtual vector<double> GetExtents(
size_t ts = 0);
106 return(_GetMapProjection());
109 virtual vector <string> GetVariableNames()
const;
113 virtual vector <string> GetVariables3D()
const;
117 virtual vector <string> GetVariables2DXY()
const;
121 virtual vector <string> GetVariables2DXZ()
const;
125 virtual vector <string> GetVariables2DYZ()
const;
130 return(_GetCoordinateVariables());
136 return(_GetPeriodicBoundary());
142 return(_GetGridPermutation());
148 return(_GetTSUserTime(ts));
154 return(_GetTSUserTimeStamp(ts, s));
265 size_t ts,
const char *varname,
float range[2],
266 int reflevel = 0,
int lod = 0
297 virtual int VariableExists(
305 size_t ts,
const char *varname,
int req_reflevel,
int req_lod,
306 int &reflevel,
int &lod
329 int NewPipeline(
PipeLine *pipeline);
338 void RemovePipeline(
string name);
348 bool IsVariableDerived(
string varname)
const;
359 bool IsVariableNative(
string varname)
const;
361 virtual VarType_T GetVarType(
const string &varname)
const;
363 bool GetMissingValue(
string varname,
float &value)
const;
371 void PurgeVariable(
string varname);
402 virtual void MapUserToVox(
404 const double vcoord0[3],
size_t vcoord1[3],
int reflevel = 0,
int lod = 0
431 virtual void MapVoxToUser(
433 const size_t vcoord0[3],
double vcoord1[3],
int ref_level = 0,
int lod=0
453 virtual void GetEnclosingRegion(
454 size_t ts,
const double minu[3],
const double maxu[3],
455 size_t min[3],
size_t max[3],
456 int reflevel = 0,
int lod = 0
469 virtual bool IsCoordinateVariable(
string varname)
const;
475 void PrintCache(std::ostream &o);
521 virtual void _GetDim(
size_t dim[3],
int reflevel = 0)
const = 0;
539 virtual void _GetBlockSize(
size_t bs[3],
int reflevel)
const = 0;
550 virtual int _GetNumTransforms()
const = 0;
564 vector <size_t> cr; cr.push_back(1);
return(cr);
600 virtual vector<double> _GetExtents(
size_t ts = 0)
const = 0;
618 vector <double> empty;
return(empty);
624 vector <double> empty;
return(empty);
630 vector <double> empty;
return(empty);
638 virtual long _GetNumTimeSteps()
const = 0;
655 virtual vector <string> _GetVariables3D()
const = 0;
663 virtual vector <string> _GetVariables2DXY()
const = 0;
671 virtual vector <string> _GetVariables2DXZ()
const = 0;
679 virtual vector <string> _GetVariables2DYZ()
const = 0;
696 v.push_back(
"NONE"); v.push_back(
"NONE"); v.push_back(
"ELEVATION");
707 virtual vector<long> _GetPeriodicBoundary()
const = 0;
716 vector <long> v; v.push_back(0); v.push_back(1); v.push_back(2);
return(v);
734 virtual double _GetTSUserTime(
size_t ts)
const = 0;
750 virtual void _GetTSUserTimeStamp(
size_t ts,
string &s)
const = 0;
768 virtual int _VariableExists(
813 virtual int _OpenVariableRead(
838 virtual void _GetValidRegion(
839 size_t min[3],
size_t max[3],
int reflevel
885 virtual int _BlockReadRegion(
886 const size_t bmin[3],
const size_t bmax[3],
894 virtual int _CloseVariable() = 0;
897 int _interpolationOrder;
913 list <region_t> _regionsList;
915 BlkMemMgr *_blk_mem_mgr;
917 vector <PipeLine *> _PipeLines;
930 size_t ts,
string varname,
int ref,
int lod,
float range[2]
933 size_t ts,
string varname,
int ref,
int lod,
const float range[2]
936 size_t ts,
string varname,
int ref,
int lod
943 size_t ts,
string varname,
int ref,
size_t min[3],
size_t max[3]
946 size_t ts,
string varname,
int ref,
const size_t min[3],
950 size_t ts,
string varname,
int ref
957 size_t ts,
string varname,
int ref,
int lod,
bool &exist
959 void SetExist(
size_t ts,
string varname,
int ref,
int lod,
bool exist);
960 void PurgeExist(
size_t ts,
string varname,
int ref,
int lod);
962 void PurgeVariable(
string varname);
963 void Clear() {_cache.clear(); }
971 map <size_t, bool> exist;
972 map <size_t, vector <size_t> > region;
973 map <size_t, vector <float> > range;
976 var_info *get_var_info(
size_t ts,
string varname)
const;
978 map <size_t, map <string, var_info> > _cache;
981 VarInfoCache _VarInfoCache;
982 std::map <size_t, vector <double> > _extentsCache;
984 float *get_region_from_cache(
994 float *get_region_from_fs(
1000 const size_t max[3],
1005 size_t ts,
string varname,
int reflevel,
int lod,
1006 const size_t min[3],
const size_t max[3],
bool lock,
bool *ondisk
1009 void unlock_blocks(
const float *blks);
1011 float *alloc_region(
1013 const char *varname,
1017 const size_t min[3],
1018 const size_t max[3],
1028 const size_t min[3],
1032 void free_var(
const string &,
int do_native);
1036 int _DataMgr(
size_t mem_size);
1039 size_t ts,
string varname,
int reflevel,
int lod,
1040 const size_t min[3],
const size_t max[3],
bool lock,
1041 float *xcblks,
float *ycblks,
float *zcblks
1047 const map <
string, vector <string> > &graph,
1049 const vector <string> &depends
1055 const PipeLine *a,
const PipeLine *b
1058 vector <string> get_native_variables()
const;
1059 vector <string> get_derived_variables()
const;
1061 PipeLine *get_pipeline_for_var(
string varname)
const;
1064 const vector <double> &xin, vector <double> &xout,
size_t ldelta
1067 void map_vox_to_user_regular(
1068 size_t timestep,
const size_t vcoord0[3],
double vcoord1[3],
int reflevel
1071 void map_vox_to_blk(
1072 const size_t vcoord[3],
size_t bcoord[3],
int reflevel = -1
1075 void get_dim_blk(
size_t bdim[3],
int reflevel)
const;
1078 size_t ts,
string varname,
int reflevel,
int lod,
1079 const size_t bmin[3],
const size_t bmax[3],
1080 float *blocks,
float *xcblocks,
float *ycblocks,
float *zcblocks
1107 vector <string> inputs,
1108 vector <pair <string, DataMgr::VarType_T> > outputs
1125 virtual int Calculate (
1126 vector <const RegularGrid *> input_grids,
1127 vector <RegularGrid *> output_grids,
1139 const vector <string> &
GetInputs()
const {
return (_inputs); };
1143 const vector <pair <string, DataMgr::VarType_T> > &
GetOutputs()
const {
1150 vector <string> _inputs;
1151 vector<pair<string, DataMgr::VarType_T> > _outputs;
1157 #endif // _DataMgr_h_
virtual string GetGridType() const
int GetNumTransforms() const
int GetInterpolationOrder() const
const vector< string > emptyVec
virtual void GetDim(size_t dim[3], int reflevel=0) const
const vector< pair< string, DataMgr::VarType_T > > & GetOutputs() const
Returns the PipeLine outputs.
virtual double GetTSUserTime(size_t ts) const
A cache based data reader.
virtual vector< double > _GetTSXCoords(size_t ts) const
const vector< string > & GetInputs() const
Returns the PipeLine inputs.
virtual string GetCoordSystemType() const
This class implements a 2D or 3D regular grid: a tessellation of Euculidean space by rectangles (2D) ...
virtual string GetMapProjection() const
int UnlockRegion(const float *)
virtual vector< long > GetGridPermutation() const
virtual string _GetMapProjection() const
virtual string _GetGridType() const
virtual string _GetCoordSystemType() const
virtual vector< long > GetPeriodicBoundary() const
virtual vector< size_t > _GetCRatios() const
virtual bool _GetMissingValue(string varname, float &value) const
PipeLine(string name, vector< string > inputs, vector< pair< string, DataMgr::VarType_T > > outputs)
const string & GetName() const
Returns the PipeLine stages name.
virtual vector< long > _GetGridPermutation() const
virtual vector< double > _GetTSZCoords(size_t ts) const
virtual const float * _GetDataRange() const
virtual vector< size_t > GetCRatios() const
virtual vector< string > _GetCoordinateVariables() const
virtual void GetTSUserTimeStamp(size_t ts, string &s) const
virtual vector< string > GetCoordinateVariables() const
void SetInterpolationOrder(int order)
virtual long GetNumTimeSteps() const
virtual vector< double > _GetTSYCoords(size_t ts) const