VAPOR3 3.9.4
StructuredGrid.h
Go to the documentation of this file.
1#ifndef _StructuredGrid_
2#define _StructuredGrid_
3
4#include <ostream>
5#include <vector>
6#include <memory>
7#include <vapor/common.h>
8#include <vapor/Grid.h>
9
10#ifdef WIN32
11 #pragma warning(disable : 4661 4251) // needed for template class
12#endif
13
14namespace VAPoR {
15
47//
48class VDF_API StructuredGrid : public Grid {
49public:
65 StructuredGrid(const std::vector<size_t> &dims, const std::vector<size_t> &bs, const std::vector<float *> &blks);
66 StructuredGrid(const DimsType &dims, const DimsType &bs, const std::vector<float *> &blks);
67
68
69 StructuredGrid() = default;
70 virtual ~StructuredGrid() = default;
71
72 static std::string GetClassType() { return ("Structured"); }
73 std::string GetType() const override { return (GetClassType()); }
74
75 const DimsType &GetNodeDimensions() const override;
76 const size_t GetNumNodeDimensions() const override;
77
78 const DimsType &GetCellDimensions() const override { return (_cellDims); };
79 const size_t GetNumCellDimensions() const override { return GetNumNodeDimensions(); }
80
83 virtual bool GetCellNodes(const DimsType &cindices, std::vector<DimsType> &nodes) const override;
84 // For grandparent inheritance of
85 // Grid::GetUserCoordinates(const size_t indices[], double coords[])
86 //
87 using Grid::GetCellNodes;
88
91 virtual bool GetCellNeighbors(const DimsType &cindices, std::vector<DimsType> &cells) const override;
92
95 virtual bool GetNodeCells(const DimsType &cindices, std::vector<DimsType> &cells) const override;
96
97 virtual bool GetEnclosingRegion(const CoordType &minu, const CoordType &maxu, DimsType &min, DimsType &max) const override;
98
99 size_t GetMaxVertexPerFace() const override { return (4); };
100
101 size_t GetMaxVertexPerCell() const override { return ((GetTopologyDim() == 3) ? 8 : 4); };
102
103 virtual void ClampCoord(const CoordType &coords, CoordType &cCoords) const override;
104
106 //
107 virtual void ClampCoord(const double coords[3], double cCoords[3]) const override { Grid::ClampCoord(coords, cCoords); }
108
111 virtual bool HasInvertedCoordinateSystemHandiness() const override;
112
113 VDF_API friend std::ostream &operator<<(std::ostream &o, const StructuredGrid &sg);
114
115protected:
116private:
117 DimsType _cellDims;
118 void _structuredGrid(const DimsType &dims, const DimsType &bs, const std::vector<float *> &blks);
119};
120}; // namespace VAPoR
121#endif
Abstract base class for a 2D or 3D structured or unstructured grid.
Definition: Grid.h:56
Abstract base class for a 2D or 3D structured grid.
virtual bool GetEnclosingRegion(const CoordType &minu, const CoordType &maxu, DimsType &min, DimsType &max) const override
virtual bool HasInvertedCoordinateSystemHandiness() const override
const DimsType & GetNodeDimensions() const override
virtual void ClampCoord(const double coords[3], double cCoords[3]) const override
const size_t GetNumCellDimensions() const override
virtual bool GetCellNeighbors(const DimsType &cindices, std::vector< DimsType > &cells) const override
static std::string GetClassType()
size_t GetMaxVertexPerCell() const override
virtual bool GetCellNodes(const DimsType &cindices, std::vector< DimsType > &nodes) const override
virtual bool GetNodeCells(const DimsType &cindices, std::vector< DimsType > &cells) const override
VDF_API friend std::ostream & operator<<(std::ostream &o, const StructuredGrid &sg)
StructuredGrid(const DimsType &dims, const DimsType &bs, const std::vector< float * > &blks)
const DimsType & GetCellDimensions() const override
virtual void ClampCoord(const CoordType &coords, CoordType &cCoords) const override
const size_t GetNumNodeDimensions() const override
size_t GetMaxVertexPerFace() const override
StructuredGrid(const std::vector< size_t > &dims, const std::vector< size_t > &bs, const std::vector< float * > &blks)
std::string GetType() const override
virtual ~StructuredGrid()=default
#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