Dune Core Modules (2.9.0)

topology.hh
1#ifndef DUNE_ALU3DGRIDTOPOLOGY_HH
2#define DUNE_ALU3DGRIDTOPOLOGY_HH
3
4#include <utility>
5
6#include <dune/alugrid/common/alugrid_assert.hh>
7
8namespace Dune {
9
10 // types of the elementes,
11 // i.e . tetra or hexa, mixed is not implemeneted
12 enum ALU3dGridElementType { tetra = 4, hexa = 7, mixed, error };
13
14 template <ALU3dGridElementType type>
15 struct EntityCount {};
16
17 template <>
18 struct EntityCount<tetra> {
19 enum {numFaces = 4};
20 enum {numVertices = 4};
21 enum {numEdges = 6};
22 enum {numVerticesPerFace = 3};
23 enum {numEdgesPerFace = 3};
24 };
25
26 template <>
27 struct EntityCount<hexa> {
28 enum {numFaces = 6};
29 enum {numVertices = 8};
30 enum {numEdges = 12};
31 enum {numVerticesPerFace = 4};
32 enum {numEdgesPerFace = 4};
33 };
34
35
38 template <ALU3dGridElementType type>
40 {
41 public:
42 enum { numFaces = EntityCount<type>::numFaces };
43 enum { numVertices = EntityCount<type>::numVertices };
44 enum { numEdges = EntityCount<type>::numEdges };
45 enum { numVerticesPerFace = EntityCount<type>::numVerticesPerFace };
46
48 static int dune2aluFace(int index);
50 static int alu2duneFace(int index);
51
53 static int dune2aluEdge(int index);
55 static int alu2duneEdge(int index);
56
58 static int dune2aluVertex(int index);
60 static int alu2duneVertex(int index);
61
62 static int generic2aluFace ( const int index );
63 static int alu2genericFace ( const int index );
64
65 static int generic2aluVertex ( const int index );
66 static int alu2genericVertex ( const int index );
67
72 static int faceOrientation(int index);
73
80 static int dune2aluFaceVertex(int face, int localVertex);
87 static int alu2duneFaceVertex(int face, int localVertex);
88
107 static int duneFaceTwist ( int face );
108
109 static std::pair< int, int > duneEdgeMap ( int edge );
110
118 static int faceVertex ( int face, int local );
119
120 private:
121 const static int dune2aluFace_[numFaces];
122 const static int alu2duneFace_[numFaces];
123
124 const static int dune2aluEdge_[numEdges];
125 const static int alu2duneEdge_[numEdges];
126
127 const static int dune2aluVertex_[numVertices];
128 const static int alu2duneVertex_[numVertices];
129
130 static const int generic2aluFace_[ numFaces ];
131 static const int alu2genericFace_[ numFaces ];
132
133 static const int generic2aluVertex_[ numVertices ];
134 static const int alu2genericVertex_[ numVertices ];
135
136 const static int faceOrientation_[numFaces];
137
138 const static int dune2aluFaceVertex_[numFaces][numVerticesPerFace];
139 const static int alu2duneFaceVertex_[numFaces][numVerticesPerFace];
140
141 static const int duneFaceTwist_[ numFaces ];
142
143 static const int duneEdgeMap_[ numEdges ][ 2 ];
144
145 static const int faceVertex_[ numFaces ][ numVerticesPerFace ];
146 };
147
150 template <ALU3dGridElementType type>
152 public:
154 static int dune2aluVertex(int index);
162 static int dune2aluVertex(int index, int twist);
164 static int alu2duneVertex(int index);
173 static int alu2duneVertex(int index, int twist);
175 static int dune2aluEdge(int index);
177 static int alu2duneEdge(int index);
178 // private:
179 static int twist(int index, int faceTwist);
180 static int invTwist(int index, int faceTwist);
181
182 static int twistedDuneIndex( const int idx, const int twist );
183
184 // for each aluTwist apply additional mapping
185 static int aluTwistMap(const int aluTwist);
186 private:
187 const static int dune2aluVertex_[EntityCount<type>::numVerticesPerFace];
188 const static int alu2duneVertex_[EntityCount<type>::numVerticesPerFace];
189
190 const static int dune2aluEdge_[EntityCount<type>::numEdgesPerFace];
191 const static int alu2duneEdge_[EntityCount<type>::numEdgesPerFace];
192
193 const static int alu2duneTwist_[ 2 * EntityCount<type>::numVerticesPerFace ];
194 const static int aluTwistMap_[ 2 * EntityCount<type>::numVerticesPerFace ];
195 };
196
197} // end namespace Dune
198#endif
Definition: topology.hh:40
static int duneFaceTwist(int face)
obtain twist of ALU reference face with respect to DUNE reference face
Definition: topology.cc:474
static int alu2duneVertex(int index)
Maps vertex index from ALU3dGrid onto Dune reference element.
Definition: topology.cc:418
static int dune2aluEdge(int index)
Maps edge index from Dune onto ALU3dGrid reference element.
Definition: topology.cc:399
static int alu2duneFace(int index)
Maps face index from ALU3dGrid onto Dune reference element.
Definition: topology.cc:393
static int alu2duneFaceVertex(int face, int localVertex)
Definition: topology.cc:467
static int faceOrientation(int index)
Definition: topology.cc:452
static int alu2duneEdge(int index)
Maps edge index from ALU3dGrid onto Dune reference element.
Definition: topology.cc:405
static int dune2aluFaceVertex(int face, int localVertex)
Definition: topology.cc:459
static int faceVertex(int face, int local)
Maps a local vertex on a face onto a global vertex.
Definition: topology.cc:488
static int dune2aluVertex(int index)
Maps vertex index from Dune onto ALU3dGrid reference element.
Definition: topology.cc:411
static int dune2aluFace(int index)
Maps face index from Dune onto ALU3dGrid reference element.
Definition: topology.cc:387
Definition: topology.hh:151
static int alu2duneEdge(int index)
Maps edge index from ALU3dGrid onto Dune reference face.
Definition: topology.cc:522
static int dune2aluEdge(int index)
Maps edge index from Dune onto ALU3dGrid reference face.
Definition: topology.cc:552
static int alu2duneVertex(int index)
Maps vertex index from ALU3dGrid onto Dune reference face.
Definition: topology.cc:509
static int dune2aluVertex(int index)
Maps vertex index from Dune onto ALU3dGrid reference face.
Definition: topology.cc:497
Dune namespace.
Definition: alignedallocator.hh:13
Creative Commons License   |  Legal Statements / Impressum  |  Hosted by TU Dresden  |  generated with Hugo v0.111.3 (Dec 21, 23:30, 2024)