55 StretchedGrid(
const DimsType &dims,
const DimsType &bs,
const std::vector<float *> &blks,
const std::vector<double> &xcoords,
const std::vector<double> &ycoords,
56 const std::vector<double> &zcoords);
57 StretchedGrid(
const std::vector<size_t> &dims,
const std::vector<size_t> &bs,
const std::vector<float *> &blks,
const std::vector<double> &xcoords,
const std::vector<double> &ycoords,
58 const std::vector<double> &zcoords);
68 std::string
GetType()
const override {
return (GetClassType()); }
89 return (GetIndicesCell(coords, indices, dummy));
101 const std::vector<double> &
GetXCoords()
const {
return (_xcoords); };
108 const std::vector<double> &
GetYCoords()
const {
return (_ycoords); };
115 const std::vector<double> &
GetZCoords()
const {
return (_zcoords); };
126 virtual void next(
const long &offset);
128 virtual const void *
address()
const {
return this; };
130 virtual bool equal(
const void *rhs)
const
134 return (_index == itrptr->_index);
137 virtual std::unique_ptr<ConstCoordItrAbstract>
clone()
const {
return std::unique_ptr<ConstCoordItrAbstract>(
new ConstCoordItrSG(*
this)); };
156 std::vector<double> _xcoords;
157 std::vector<double> _ycoords;
158 std::vector<double> _zcoords;
160 CoordType _maxu = {{0.0, 0.0, 0.0}};
162 void _stretchedGrid(
const std::vector<double> &xcoords,
const std::vector<double> &ycoords,
const std::vector<double> &zcoords);
164 bool _insideGrid(
double x,
double y,
double z,
size_t &i,
size_t &j,
size_t &k,
double &xwgt,
double &ywgt,
double &zwgt)
const;
const CoordType ConstCoordType
virtual const void * address() const
ConstCoordItrSG(const ConstCoordItrSG &rhs)
virtual std::unique_ptr< ConstCoordItrAbstract > clone() const
virtual bool equal(const void *rhs) const
ConstCoordItrSG(const StretchedGrid *cg, bool begin)
virtual ~ConstCoordItrSG()
virtual void next(const long &offset)
virtual ConstCoordType & deref() const
This class implements a 2D or 3D stretched grid.
virtual ConstCoordItr ConstCoordEnd() const override
StretchedGrid(const std::vector< size_t > &dims, const std::vector< size_t > &bs, const std::vector< float * > &blks, const std::vector< double > &xcoords, const std::vector< double > &ycoords, const std::vector< double > &zcoords)
void GetUserExtentsHelper(CoordType &minu, CoordType &maxu) const override
virtual bool GetIndicesCell(const CoordType &coords, DimsType &indices) const override
virtual float GetValueLinear(const CoordType &coords) const override
virtual DimsType GetCoordDimensions(size_t dim) const override
virtual void GetBoundingBox(const DimsType &min, const DimsType &max, CoordType &minu, CoordType &maxu) const override
const std::vector< double > & GetZCoords() const
static std::string GetClassType()
virtual bool GetIndicesCell(const CoordType &coords, DimsType &indices, double wgts[3]) const
virtual ~StretchedGrid()=default
virtual size_t GetGeometryDim() const override
std::string GetType() const override
const std::vector< double > & GetYCoords() const
const std::vector< double > & GetXCoords() const
virtual void GetUserCoordinates(const DimsType &indices, CoordType &coords) const override
virtual ConstCoordItr ConstCoordBegin() const override
Return constant grid coordinate iterator.
virtual bool InsideGrid(const CoordType &coords) const override
virtual float GetValueNearestNeighbor(const CoordType &coords) const override
StretchedGrid(const DimsType &dims, const DimsType &bs, const std::vector< float * > &blks, const std::vector< double > &xcoords, const std::vector< double > &ycoords, const std::vector< double > &zcoords)
Abstract base class for a 2D or 3D structured grid.
std::array< double, 3 > CoordType
Type for specifying floating point coordinates.
std::array< size_t, 3 > DimsType
Type for specifying integer indices.