TTK
Loading...
Searching...
No Matches
RegularGridTriangulation.h
Go to the documentation of this file.
1
13
14#pragma once
15
16#include <array>
17
18// base code includes
20
21#ifdef TTK_ENABLE_MPI
22#include <memory>
23#endif // TTK_ENABLE_MPI
24
25namespace ttk {
26
27 class ImplicitTriangulation;
28 class PeriodicImplicitTriangulation;
29
33
34 public:
36 ~RegularGridTriangulation() override = default;
37
41 = default;
43
44 virtual int setInputGrid(const float &xOrigin,
45 const float &yOrigin,
46 const float &zOrigin,
47 const float &xSpacing,
48 const float &ySpacing,
49 const float &zSpacing,
50 const SimplexId &xDim,
51 const SimplexId &yDim,
52 const SimplexId &zDim)
53 = 0;
54
55#ifdef TTK_ENABLE_MPI
56
57 int preconditionDistributedVertices() override;
58 // offset coordinates of the local grid inside the metaGrid_
59 std::array<SimplexId, 3> localGridOffset_{};
60 std::shared_ptr<RegularGridTriangulation> metaGrid_;
61
62 int preconditionExchangeGhostCells() override;
63 int preconditionExchangeGhostVertices() override;
64
65 virtual void createMetaGrid(const double *const bounds) = 0;
66
67 SimplexId getVertexGlobalIdInternal(const SimplexId lvid) const override;
68 SimplexId getVertexLocalIdInternal(const SimplexId gvid) const override;
69
70 SimplexId getCellGlobalIdInternal(const SimplexId lcid) const override;
71 SimplexId getCellLocalIdInternal(const SimplexId gcid) const override;
72
73 SimplexId getEdgeGlobalIdInternal(const SimplexId leid) const override;
74 SimplexId getEdgeLocalIdInternal(const SimplexId geid) const override;
75
76 SimplexId getTriangleGlobalIdInternal(const SimplexId ltid) const override;
77 SimplexId getTriangleLocalIdInternal(const SimplexId gtid) const override;
78
79 int getVertexRankInternal(const SimplexId lvid) const override;
80#endif
81 protected:
82 std::array<SimplexId, 3> dimensions_; // dimensions
84 float origin_[3]; //
85 float spacing_[3]; //
86
87 virtual void vertexToPosition2d(const SimplexId vertex,
88 SimplexId p[2]) const = 0;
89 virtual void vertexToPosition(const SimplexId vertex,
90 SimplexId p[3]) const = 0;
91 virtual void triangleToPosition2d(const SimplexId triangle,
92 SimplexId p[2]) const = 0;
93 virtual void triangleToPosition(const SimplexId triangle,
94 const int k,
95 SimplexId p[3]) const = 0;
96 virtual void tetrahedronToPosition(const SimplexId tetrahedron,
97 SimplexId p[3]) const = 0;
98
100 const SimplexId v1) const;
101 SimplexId findTriangleFromVertices(std::array<SimplexId, 3> &verts) const;
102#ifdef TTK_ENABLE_MPI
103 virtual std::array<SimplexId, 3>
104 getVertGlobalCoords(const SimplexId lvid) const = 0;
105 virtual std::array<SimplexId, 3>
106 getVertLocalCoords(const SimplexId gvid) const = 0;
107#endif
108 };
109} // namespace ttk
AbstractTriangulation is an interface class that defines an interface for efficient traversal methods...
ImplicitTriangulation is a class that provides time and memory efficient traversal methods on triangu...
TTK triangulation class for grids with periodic boundary conditions implemented in all directions.
RegularGridTriangulation is an abstract subclass of ttk::AbstractTriangulation that exposes a common ...
SimplexId findEdgeFromVertices(const SimplexId v0, const SimplexId v1) const
virtual void tetrahedronToPosition(const SimplexId tetrahedron, SimplexId p[3]) const =0
virtual void vertexToPosition(const SimplexId vertex, SimplexId p[3]) const =0
SimplexId findTriangleFromVertices(std::array< SimplexId, 3 > &verts) const
~RegularGridTriangulation() override=default
virtual void triangleToPosition2d(const SimplexId triangle, SimplexId p[2]) const =0
std::array< SimplexId, 3 > dimensions_
RegularGridTriangulation(const RegularGridTriangulation &)=default
virtual void vertexToPosition2d(const SimplexId vertex, SimplexId p[2]) const =0
RegularGridTriangulation & operator=(const RegularGridTriangulation &)=default
virtual int setInputGrid(const float &xOrigin, const float &yOrigin, const float &zOrigin, const float &xSpacing, const float &ySpacing, const float &zSpacing, const SimplexId &xDim, const SimplexId &yDim, const SimplexId &zDim)=0
RegularGridTriangulation & operator=(RegularGridTriangulation &&)=default
RegularGridTriangulation(RegularGridTriangulation &&)=default
virtual void triangleToPosition(const SimplexId triangle, const int k, SimplexId p[3]) const =0
The Topology ToolKit.
int SimplexId
Identifier type for simplices of any dimension.
Definition DataTypes.h:22