VAPOR3 3.9.4
UnstructuredGridCoordless.h
Go to the documentation of this file.
1#ifndef _UnstructuredGridCoordless_
2#define _UnstructuredGridCoordless_
3
4#include <ostream>
5#include <vector>
6#include <memory>
7#include <vapor/common.h>
9
10#ifdef WIN32
11 #pragma warning(disable : 4661 4251) // needed for template class
12#endif
13
14namespace VAPoR {
15
20//
22public:
25 //
26 UnstructuredGridCoordless(const DimsType &vertexDims, const DimsType &faceDims, const DimsType &edgeDims, const DimsType &bs, const std::vector<float *> &blks, size_t topology_dimension,
27 const int *vertexOnFace, const int *faceOnVertex, const int *faceOnFace,
28 Location location, // node,face, edge
29 size_t maxVertexPerFace, size_t maxFacePerVertex, long nodeOffset, long cellOffset)
30 : UnstructuredGrid(vertexDims, faceDims, edgeDims, bs, blks, topology_dimension, vertexOnFace, faceOnVertex, faceOnFace, location, maxVertexPerFace, maxFacePerVertex, nodeOffset, cellOffset)
31 {
32 }
33 UnstructuredGridCoordless(const std::vector<size_t> &vertexDims, const std::vector<size_t> &faceDims, const std::vector<size_t> &edgeDims, const std::vector<size_t> &bs,
34 const std::vector<float *> &blks, size_t topology_dimension, const int *vertexOnFace, const int *faceOnVertex, const int *faceOnFace,
35 Location location, // node,face, edge
36 size_t maxVertexPerFace, size_t maxFacePerVertex, long nodeOffset, long cellOffset)
37 : UnstructuredGrid(vertexDims, faceDims, edgeDims, bs, blks, topology_dimension, vertexOnFace, faceOnVertex, faceOnFace, location, maxVertexPerFace, maxFacePerVertex, nodeOffset, cellOffset)
38 {
39 }
40
42 virtual ~UnstructuredGridCoordless() = default;
43
44 virtual DimsType GetCoordDimensions(size_t dim) const override { return (DimsType{1, 1, 1}); }
45
46 static std::string GetClassType() { return ("UnstructuredCoordless"); }
47 std::string GetType() const override { return (GetClassType()); }
48
49 virtual void GetBoundingBox(const DimsType &min, const DimsType &max, CoordType &minu, CoordType &maxu) const override
50 {
51 minu = {0.0, 0.0, 0.0};
52 maxu = {0.0, 0.0, 0.0};
53 }
54
55 bool GetEnclosingRegion(const CoordType &minu, const CoordType &maxu, DimsType &min, DimsType &max) const override { return (false); }
56
57 virtual void GetUserCoordinates(const DimsType &indices, CoordType &coords) const override {}
58
59 bool GetIndicesCell(const CoordType &, DimsType &) const override { return (false); }
60
61 bool InsideGrid(const CoordType &coords) const override { return (false); }
62
63 float GetValueNearestNeighbor(const CoordType &coords) const override { return (0.0); }
64
65 float GetValueLinear(const CoordType &coords) const override { return (0.0); }
66
67 virtual size_t GetGeometryDim() const override { return (0); }
68
70 //
71 // Iterators
72 //
74
76 public:
79
82
83 virtual void next() {}
84 virtual void next(const long &offset) {}
85 virtual ConstCoordType &deref() const { return (_coords); }
86 virtual const void * address() const { return this; };
87
88 virtual bool equal(const void *rhs) const { return (true); }
89
90 virtual std::unique_ptr<ConstCoordItrAbstract> clone() const { return std::unique_ptr<ConstCoordItrAbstract>(new ConstCoordItrUCoordless(*this)); };
91
92 private:
93 CoordType _coords;
94 };
95
96 virtual ConstCoordItr ConstCoordBegin() const override { return ConstCoordItr(std::unique_ptr<ConstCoordItrAbstract>(new ConstCoordItrUCoordless(this, true))); }
97 virtual ConstCoordItr ConstCoordEnd() const override { return ConstCoordItr(std::unique_ptr<ConstCoordItrAbstract>(new ConstCoordItrUCoordless(this, false))); }
98
99 VDF_API friend std::ostream &operator<<(std::ostream &o, const UnstructuredGridCoordless &sg);
100
101protected:
102 virtual void GetUserExtentsHelper(CoordType &minu, CoordType &maxu) const override
103 {
104 minu = {0.0, 0.0, 0.0};
105 maxu = {0.0, 0.0, 0.0};
106 }
107
108private:
109};
110}; // namespace VAPoR
111
112#endif
const CoordType ConstCoordType
Definition: Grid.h:936
ConstCoordItrUCoordless(const UnstructuredGridCoordless *ug, bool begin)
virtual std::unique_ptr< ConstCoordItrAbstract > clone() const
class for a 2D unstructured grid.
virtual DimsType GetCoordDimensions(size_t dim) const override
std::string GetType() const override
UnstructuredGridCoordless(const DimsType &vertexDims, const DimsType &faceDims, const DimsType &edgeDims, const DimsType &bs, const std::vector< float * > &blks, size_t topology_dimension, const int *vertexOnFace, const int *faceOnVertex, const int *faceOnFace, Location location, size_t maxVertexPerFace, size_t maxFacePerVertex, long nodeOffset, long cellOffset)
bool InsideGrid(const CoordType &coords) const override
virtual void GetUserCoordinates(const DimsType &indices, CoordType &coords) const override
float GetValueLinear(const CoordType &coords) const override
float GetValueNearestNeighbor(const CoordType &coords) const override
virtual void GetBoundingBox(const DimsType &min, const DimsType &max, CoordType &minu, CoordType &maxu) const override
virtual size_t GetGeometryDim() const override
virtual ~UnstructuredGridCoordless()=default
bool GetEnclosingRegion(const CoordType &minu, const CoordType &maxu, DimsType &min, DimsType &max) const override
virtual ConstCoordItr ConstCoordBegin() const override
Return constant grid coordinate iterator.
virtual ConstCoordItr ConstCoordEnd() const override
UnstructuredGridCoordless(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, size_t topology_dimension, const int *vertexOnFace, const int *faceOnVertex, const int *faceOnFace, Location location, size_t maxVertexPerFace, size_t maxFacePerVertex, long nodeOffset, long cellOffset)
bool GetIndicesCell(const CoordType &, DimsType &) const override
VDF_API friend std::ostream & operator<<(std::ostream &o, const UnstructuredGridCoordless &sg)
virtual void GetUserExtentsHelper(CoordType &minu, CoordType &maxu) const override
Abstract base class for a 2D or 3D unstructured grid.
#define VDF_API
Definition: common.h:73
std::array< double, 3 > CoordType
Type for specifying floating point coordinates.
Definition: Grid.h:23
std::array< size_t, 3 > DimsType
Type for specifying integer indices.
Definition: Grid.h:26