1#ifndef _UnstructuredGrid2D_
2#define _UnstructuredGrid2D_
13 #pragma warning(disable : 4661 4251)
29 const int *faceOnVertex,
const int *faceOnFace,
34 UnstructuredGrid2D(
const std::vector<size_t> &vertexDims,
const std::vector<size_t> &faceDims,
const std::vector<size_t> &edgeDims,
const std::vector<size_t> &bs,
const std::vector<float *> &blks,
35 const int *vertexOnFace,
const int *faceOnVertex,
const int *faceOnFace,
43 if (_qtr) _qtr =
nullptr;
53 std::string
GetType()
const override {
return (GetClassType()); }
63 std::vector<double> lambda;
64 std::vector<std::vector<size_t>> nodes;
65 return (GetIndicesCell(coords, indices, nodes, lambda));
70 using Grid::GetIndicesCell;
101 virtual void next(
const long &offset);
103 virtual const void *
address()
const {
return this; };
105 virtual bool equal(
const void *rhs)
const
109 return (_xCoordItr == itrptr->_xCoordItr && _yCoordItr == itrptr->_yCoordItr && _zCoordItr == itrptr->_zCoordItr);
112 virtual std::unique_ptr<ConstCoordItrAbstract>
clone()
const {
return std::unique_ptr<ConstCoordItrAbstract>(
new ConstCoordItrU2D(*
this)); };
134 std::shared_ptr<const QuadTreeRectangleP> _qtr;
136 bool _insideGrid(
const CoordType &coords,
size_t &face, std::vector<size_t> &nodes,
double *lambda,
int &nlambda)
const;
138 bool _insideGridNodeCentered(
const CoordType &coords,
size_t &face, std::vector<size_t> &nodes,
double *lambda,
int &nlambda)
const;
140 bool _insideGridFaceCentered(
const CoordType &coords,
size_t &face, std::vector<size_t> &nodes,
double *lambda,
int &nlambda)
const;
142 bool _pointInsideBoundingRectangle(
const double pt[],
const double verts[],
int n)
const;
144 bool _insideFace(
size_t face,
double pt[2], std::vector<size_t> &node_indices,
double *lambda,
int &nlambda)
const;
146 std::shared_ptr<QuadTreeRectangleP> _makeQuadTreeRectangle()
const;
const CoordType ConstCoordType
virtual void next(const long &offset)
virtual ConstCoordType & deref() const
virtual std::unique_ptr< ConstCoordItrAbstract > clone() const
ConstCoordItrU2D(const UnstructuredGrid2D *ug, bool begin)
virtual ~ConstCoordItrU2D()
virtual const void * address() const
virtual bool equal(const void *rhs) const
ConstCoordItrU2D(const ConstCoordItrU2D &rhs)
class for a 2D unstructured grid.
std::shared_ptr< const QuadTreeRectangleP > GetQuadTreeRectangle() const
virtual void GetUserExtentsHelper(CoordType &minu, CoordType &maxu) const override
virtual void GetBoundingBox(const DimsType &min, const DimsType &max, CoordType &minu, CoordType &maxu) const override
virtual ConstCoordItr ConstCoordBegin() const override
Return constant grid coordinate iterator.
float GetValueNearestNeighbor(const CoordType &coords) const override
virtual void GetUserCoordinates(const DimsType &indices, CoordType &coords) const override
bool GetIndicesCell(const CoordType &coords, DimsType &indices, std::vector< std::vector< size_t > > &nodes, std::vector< double > &lambda) const
bool InsideGrid(const CoordType &coords) const override
bool GetEnclosingRegion(const CoordType &minu, const CoordType &maxu, DimsType &min, DimsType &max) const override
virtual ConstCoordItr ConstCoordEnd() const override
UnstructuredGrid2D()=default
bool GetIndicesCell(const CoordType &coords, DimsType &indices) const override
UnstructuredGrid2D(const std::vector< size_t > &vertexDims, const std::vector< size_t > &faceDims, const std::vector< size_t > &edgeDims, const std::vector< size_t > &bs, const std::vector< float * > &blks, const int *vertexOnFace, const int *faceOnVertex, const int *faceOnFace, Location location, size_t maxVertexPerFace, size_t maxFacePerVertex, long nodeOffset, long cellOffset, const UnstructuredGridCoordless &xug, const UnstructuredGridCoordless &yug, const UnstructuredGridCoordless &zug, std::shared_ptr< const QuadTreeRectangleP > qtr)
UnstructuredGrid2D(const DimsType &vertexDims, const DimsType &faceDims, const DimsType &edgeDims, const DimsType &bs, const std::vector< float * > &blks, const int *vertexOnFace, const int *faceOnVertex, const int *faceOnFace, Location location, size_t maxVertexPerFace, size_t maxFacePerVertex, long nodeOffset, long cellOffset, const UnstructuredGridCoordless &xug, const UnstructuredGridCoordless &yug, const UnstructuredGridCoordless &zug, std::shared_ptr< const QuadTreeRectangleP > qtr)
virtual size_t GetGeometryDim() const override
virtual ~UnstructuredGrid2D()
std::string GetType() const override
virtual DimsType GetCoordDimensions(size_t dim) const override
VDF_API friend std::ostream & operator<<(std::ostream &o, const UnstructuredGrid2D &sg)
float GetValueLinear(const CoordType &coords) const override
static std::string GetClassType()
class for a 2D unstructured grid.
Abstract base class for a 2D or 3D unstructured grid.
std::array< double, 3 > CoordType
Type for specifying floating point coordinates.
std::array< size_t, 3 > DimsType
Type for specifying integer indices.