1#ifndef _CurvilinearGrid_
2#define _CurvilinearGrid_
72 std::shared_ptr<const QuadTreeRectangleP> qtr);
74 const std::vector<double> &zcoords, std::shared_ptr<const QuadTreeRectangleP> qtr);
113 std::shared_ptr<const QuadTreeRectangleP> qtr);
115 std::shared_ptr<const QuadTreeRectangleP> qtr);
150 std::shared_ptr<const QuadTreeRectangleP> qtr);
163 std::string
GetType()
const override {
return (GetClassType()); }
204 const std::vector<double> &
GetZCoords()
const {
return (_zcoords); };
215 virtual void next(
const long &offset);
217 virtual const void *
address()
const {
return this; };
219 virtual bool equal(
const void *rhs)
const
223 return (_index == itrptr->_index);
226 virtual std::unique_ptr<ConstCoordItrAbstract>
clone()
const {
return std::unique_ptr<ConstCoordItrAbstract>(
new ConstCoordItrCG(*
this)); };
235 bool _terrainFollowing;
251 std::vector<double> _zcoords;
253 CoordType _maxu = {{0.0, 0.0, 0.0}};
257 bool _terrainFollowing;
258 std::shared_ptr<const QuadTreeRectangleP> _qtr;
260 void _curvilinearGrid(
const RegularGrid &xrg,
const RegularGrid &yrg,
const RegularGrid &zrg,
const std::vector<double> &zcoords, std::shared_ptr<const QuadTreeRectangleP> qtr);
262 bool _insideFace(
const DimsType &face,
double pt[2],
double lambda[4], std::vector<DimsType> &nodes)
const;
264 bool _insideGrid(
double x,
double y,
double z,
size_t &i,
size_t &j,
size_t &k,
double lambda[4],
double zwgt[2])
const;
266 void _getIndicesHelper(
const std::vector<double> &coords, std::vector<size_t> &indices)
const;
268 bool _insideGridHelperStretched(
double z,
size_t &k,
double zwgt[2])
const;
270 bool _insideGridHelperTerrain(
double x,
double y,
double z,
const size_t &i,
const size_t &j,
size_t &k,
double zwgt[2])
const;
272 std::shared_ptr<QuadTreeRectangleP> _makeQuadTreeRectangle()
const;
virtual bool equal(const void *rhs) const
virtual ~ConstCoordItrCG()
ConstCoordItrCG(const ConstCoordItrCG &rhs)
ConstCoordItrCG(const CurvilinearGrid *cg, bool begin)
virtual ConstCoordType & deref() const
virtual std::unique_ptr< ConstCoordItrAbstract > clone() const
virtual const void * address() const
virtual void next(const long &offset)
This class implements a 2D or 3D curvilinear grid.
const RegularGrid & GetXRG() const
CurvilinearGrid(const DimsType &dims, const DimsType &bs, const std::vector< float * > &blks, const RegularGrid &xrg, const RegularGrid &yrg, const RegularGrid &zrg, std::shared_ptr< const QuadTreeRectangleP > qtr)
std::shared_ptr< const QuadTreeRectangleP > GetQuadTreeRectangle() const
virtual bool InsideGrid(const CoordType &coords) const override
const RegularGrid & GetYRG() const
virtual DimsType GetCoordDimensions(size_t dim) const override
CurvilinearGrid()=default
CurvilinearGrid(const std::vector< size_t > &dims, const std::vector< size_t > &bs, const std::vector< float * > &blks, const RegularGrid &xrg, const RegularGrid &yrg, const std::vector< double > &zcoords, std::shared_ptr< const QuadTreeRectangleP > qtr)
CurvilinearGrid(const std::vector< size_t > &dims, const std::vector< size_t > &bs, const std::vector< float * > &blks, const RegularGrid &xrg, const RegularGrid &yrg, const RegularGrid &zrg, std::shared_ptr< const QuadTreeRectangleP > qtr)
virtual ~CurvilinearGrid()
virtual size_t GetGeometryDim() const override
virtual float GetValueNearestNeighbor(const CoordType &coords) const override
std::string GetType() const override
virtual void GetUserCoordinates(const DimsType &indices, CoordType &coords) const override
const std::vector< double > & GetZCoords() const
virtual float GetValueLinear(const CoordType &coords) const override
virtual ConstCoordItr ConstCoordEnd() const override
virtual bool GetIndicesCell(const CoordType &coords, DimsType &indices) const override
CurvilinearGrid(const DimsType &dims, const DimsType &bs, const std::vector< float * > &blks, const RegularGrid &xrg, const RegularGrid &yrg, std::shared_ptr< const QuadTreeRectangleP > qtr)
virtual ConstCoordItr ConstCoordBegin() const override
Return constant grid coordinate iterator.
CurvilinearGrid(const DimsType &dims, const DimsType &bs, const std::vector< float * > &blks, const RegularGrid &xrg, const RegularGrid &yrg, const std::vector< double > &zcoords, std::shared_ptr< const QuadTreeRectangleP > qtr)
CurvilinearGrid(const std::vector< size_t > &dims, const std::vector< size_t > &bs, const std::vector< float * > &blks, const RegularGrid &xrg, const RegularGrid &yrg, std::shared_ptr< const QuadTreeRectangleP > qtr)
static std::string GetClassType()
virtual void GetUserExtentsHelper(CoordType &minu, CoordType &maxu) const override
virtual void GetBoundingBox(const DimsType &min, const DimsType &max, CoordType &minu, CoordType &maxu) const override
const CoordType ConstCoordType
This class implements a 2D or 3D regular grid.
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.