47 LayeredGrid(
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 std::string
GetType()
const override {
return (GetClassType()); }
93 using Grid::GetUserCoordinates;
102 using Grid::GetIndicesCell;
113 virtual void SetPeriodic(
const std::vector<bool> &periodic)
override
116 std::vector<bool> myPeriodic = periodic;
117 myPeriodic[2] =
false;
118 Grid::SetPeriodic(myPeriodic);
135 virtual void next(
const long &offset);
137 virtual const void *
address()
const {
return this; };
139 virtual bool equal(
const void *rhs)
const
143 return (_zCoordItr == itrptr->_zCoordItr);
146 virtual std::unique_ptr<ConstCoordItrAbstract>
clone()
const {
return std::unique_ptr<ConstCoordItrAbstract>(
new ConstCoordItrLayered(*
this)); };
168 std::vector<double> _xcoords;
169 std::vector<double> _ycoords;
171 CoordType _maxu = {{0.0, 0.0, 0.0}};
172 int _interpolationOrder;
174 void _layeredGrid(
const DimsType &dims,
const DimsType &bs,
const std::vector<float *> &blks,
const std::vector<double> &xcoords,
const std::vector<double> &ycoords,
const RegularGrid &rg);
176 virtual float GetValueNearestNeighbor(
const CoordType &coords)
const override;
178 virtual float GetValueLinear(
const CoordType &coords)
const override;
193 void _getBilinearWeights(
const double coords[3],
double &iwgt,
double &jwgt)
const;
207 double _bilinearElevation(
size_t i0,
size_t i1,
size_t j0,
size_t j1,
size_t k0,
double iwgt,
double jwgt)
const;
226 double _bilinearInterpolation(
size_t i0,
size_t i1,
size_t j0,
size_t j1,
size_t k0,
double iwgt,
double jwgt)
const;
247 float _getValueQuadratic(
const double coords[3])
const;
260 double _verticalLinearInterpolation(
double x,
double y,
double z)
const;
262 double _interpolateVaryingCoord(
size_t i0,
size_t j0,
size_t k0,
double x,
double y)
const;
264 bool _insideGrid(
const CoordType &coords, DimsType &indices,
double wgts[3])
const;
const CoordType ConstCoordType
virtual void next(const long &offset)
virtual ConstCoordType & deref() const
ConstCoordItrLayered(const LayeredGrid *rg, bool begin)
virtual ~ConstCoordItrLayered()
virtual std::unique_ptr< ConstCoordItrAbstract > clone() const
ConstCoordItrLayered(const ConstCoordItrLayered &rhs)
virtual const void * address() const
virtual bool equal(const void *rhs) const
This class implements a 2D or 3D layered grid.
virtual void GetUserExtentsHelper(CoordType &minu, CoordType &maxu) const override
virtual void GetUserCoordinates(const DimsType &indices, CoordType &coords) const override
bool InsideGrid(const CoordType &coords) const override
float GetValue(const CoordType &coords) const override
LayeredGrid(const DimsType &dims, const DimsType &bs, const std::vector< float * > &blks, const std::vector< double > &xcoords, const std::vector< double > &ycoords, const RegularGrid &rg)
virtual size_t GetGeometryDim() const override
virtual ~LayeredGrid()=default
static std::string GetClassType()
virtual void GetBoundingBox(const DimsType &min, const DimsType &max, CoordType &minu, CoordType &maxu) const override
const RegularGrid & GetZRG() const
virtual ConstCoordItr ConstCoordBegin() const override
Return constant grid coordinate iterator.
virtual void SetPeriodic(const std::vector< bool > &periodic) override
virtual DimsType GetCoordDimensions(size_t dim) const override
virtual void SetInterpolationOrder(int order) override
std::string GetType() const override
LayeredGrid(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 RegularGrid &rg)
virtual ConstCoordItr ConstCoordEnd() const override
virtual bool GetIndicesCell(const CoordType &coords, DimsType &indices) const override
virtual int GetInterpolationOrder() const override
This class implements a 2D or 3D regular grid.
This class implements a 2D or 3D stretched 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.