3#ifndef DUNE_ALU3DGRIDTOPOLOGY_HH
4#define DUNE_ALU3DGRIDTOPOLOGY_HH
13 enum ALU3dGridElementType { tetra = 4, hexa = 7, mixed, error };
15 template <ALU3dGr
idElementType type>
16 struct EntityCount {};
19 struct EntityCount<tetra> {
21 enum {numVertices = 4};
23 enum {numVerticesPerFace = 3};
24 enum {numEdgesPerFace = 3};
28 struct EntityCount<hexa> {
30 enum {numVertices = 8};
32 enum {numVerticesPerFace = 4};
33 enum {numEdgesPerFace = 4};
39 template <ALU3dGr
idElementType type>
43 enum { numFaces = EntityCount<type>::numFaces };
44 enum { numVertices = EntityCount<type>::numVertices };
45 enum { numEdges = EntityCount<type>::numEdges };
46 enum { numVerticesPerFace = EntityCount<type>::numVerticesPerFace };
63 static int generic2aluFace (
const int index );
64 static int alu2genericFace (
const int index );
66 static int generic2aluVertex (
const int index );
67 static int alu2genericVertex (
const int index );
100 const static int dune2aluFace_[numFaces];
101 const static int alu2duneFace_[numFaces];
103 const static int dune2aluEdge_[numEdges];
104 const static int alu2duneEdge_[numEdges];
106 const static int dune2aluVertex_[numVertices];
107 const static int alu2duneVertex_[numVertices];
109 static const int generic2aluFace_[ numFaces ];
110 static const int alu2genericFace_[ numFaces ];
112 static const int generic2aluVertex_[ numVertices ];
113 static const int alu2genericVertex_[ numVertices ];
115 const static int faceOrientation_[numFaces];
117 const static int dune2aluFaceVertex_[numFaces][numVerticesPerFace];
118 const static int alu2duneFaceVertex_[numFaces][numVerticesPerFace];
120 static const int faceVertex_[ numFaces ][ numVerticesPerFace ];
125 template <ALU3dGr
idElementType type>
154 static int twist(
int index,
int faceTwist);
155 static int invTwist(
int index,
int faceTwist);
157 static int twistedDuneIndex(
const int idx,
const int twist );
160 static int aluTwistMap(
const int aluTwist);
162 const static int dune2aluVertex_[EntityCount<type>::numVerticesPerFace];
163 const static int alu2duneVertex_[EntityCount<type>::numVerticesPerFace];
165 const static int dune2aluEdge_[EntityCount<type>::numEdgesPerFace];
166 const static int alu2duneEdge_[EntityCount<type>::numEdgesPerFace];
168 const static int alu2duneTwist_[ 2 * EntityCount<type>::numVerticesPerFace ];
169 const static int aluTwistMap_[ 2 * EntityCount<type>::numVerticesPerFace ];
174 template <ALU3dGr
idElementType type>
176 assert(index >= 0 && index < numFaces);
177 return dune2aluFace_[index];
180 template <ALU3dGr
idElementType type>
182 assert(index >= 0 && index < numFaces);
183 return alu2duneFace_[index];
186 template <ALU3dGr
idElementType type>
188 assert(index >= 0 && index < numEdges);
189 return dune2aluEdge_[index];
192 template <ALU3dGr
idElementType type>
194 assert(index >= 0 && index < numEdges);
195 return alu2duneEdge_[index];
198 template <ALU3dGr
idElementType type>
201 assert(index >= 0 && index < numVertices);
202 return dune2aluVertex_[index];
205 template <ALU3dGr
idElementType type>
207 assert(index >= 0 && index < numVertices);
208 return alu2duneVertex_[index];
211 template< ALU3dGr
idElementType type >
214 assert( (index >= 0) && (index < numFaces) );
215 return generic2aluFace_[ index ];
218 template< ALU3dGr
idElementType type >
219 inline int ElementTopologyMapping< type >::alu2genericFace (
const int index )
221 assert( (index >= 0) && (index < numFaces) );
222 return alu2genericFace_[ index ];
225 template< ALU3dGr
idElementType type >
226 inline int ElementTopologyMapping< type >::generic2aluVertex (
const int index )
228 assert( (index >= 0) && (index < numVertices) );
229 return generic2aluVertex_[ index ];
232 template< ALU3dGr
idElementType type >
233 inline int ElementTopologyMapping< type >::alu2genericVertex (
const int index )
235 assert( (index >= 0) && (index < numVertices) );
236 return alu2genericVertex_[ index ];
239 template <ALU3dGr
idElementType type>
241 assert(index >= 0 && index < numVertices);
242 return faceOrientation_[index];
245 template <ALU3dGr
idElementType type>
248 assert(face >= 0 && face < numFaces);
249 assert(localVertex >= 0 && localVertex < numVerticesPerFace);
250 return dune2aluFaceVertex_[face][localVertex];
253 template <ALU3dGr
idElementType type>
256 assert(face >= 0 && face < numFaces);
257 assert(localVertex >= 0 && localVertex < numVerticesPerFace);
258 return alu2duneFaceVertex_[face][localVertex];
261 template< ALU3dGr
idElementType type >
264 assert( (face >= 0) && (face < numFaces) );
265 assert( (local >= 0) && (local < numVerticesPerFace) );
266 return faceVertex_[ face ][ local ];
270 template <ALU3dGr
idElementType type>
272 assert(index >= 0 && index < EntityCount<type>::numVerticesPerFace);
273 return dune2aluVertex_[index];
276 template <ALU3dGr
idElementType type>
278 assert(index >= 0 && index < EntityCount<type>::numVerticesPerFace);
279 return invTwist(dune2aluVertex_[index], twist);
282 template <ALU3dGr
idElementType type>
284 assert(index >= 0 && index < EntityCount<type>::numVerticesPerFace);
285 return alu2duneVertex_[index];
288 template <ALU3dGr
idElementType type>
291 assert(index >= 0 && index < EntityCount<type>::numVerticesPerFace);
292 return alu2duneVertex_[invTwist(index, twist)];
295 template <ALU3dGr
idElementType type>
297 assert(index >= 0 && index < EntityCount<type>::numEdgesPerFace);
298 return alu2duneEdge_[index];
301 template <ALU3dGr
idElementType type>
308 return aluTwistMap_[ aluTwist + ((type == tetra) ? 3 : 4) ];
311 template <ALU3dGr
idElementType type>
312 inline int FaceTopologyMapping<type>::
313 twistedDuneIndex(
const int duneIdx,
const int aluTwist)
318 const int twist = alu2duneTwist_[ aluTwist + 3 ];
319 return alu2duneVertex( dune2aluVertex(duneIdx) , twist );
322 return alu2duneVertex( dune2aluVertex(duneIdx) , aluTwist );
325 template <ALU3dGr
idElementType type>
327 assert(index >= 0 && index < EntityCount<type>::numEdgesPerFace);
328 return dune2aluEdge_[index];
Definition: topology.hh:41
static int alu2duneVertex(int index)
Maps vertex index from ALU3dGrid onto Dune reference element.
Definition: topology.hh:206
static int dune2aluEdge(int index)
Maps edge index from Dune onto ALU3dGrid reference element.
Definition: topology.hh:187
static int alu2duneFace(int index)
Maps face index from ALU3dGrid onto Dune reference element.
Definition: topology.hh:181
static int alu2duneFaceVertex(int face, int localVertex)
Definition: topology.hh:255
static int faceOrientation(int index)
Definition: topology.hh:240
static int alu2duneEdge(int index)
Maps edge index from ALU3dGrid onto Dune reference element.
Definition: topology.hh:193
static int dune2aluFaceVertex(int face, int localVertex)
Definition: topology.hh:247
static int faceVertex(int face, int local)
Maps a local vertex on a face onto a global vertex.
Definition: topology.hh:262
static int dune2aluVertex(int index)
Maps vertex index from Dune onto ALU3dGrid reference element.
Definition: topology.hh:199
static int dune2aluFace(int index)
Maps face index from Dune onto ALU3dGrid reference element.
Definition: topology.hh:175
Definition: topology.hh:126
static int alu2duneEdge(int index)
Maps edge index from ALU3dGrid onto Dune reference face.
Definition: topology.hh:296
static int dune2aluEdge(int index)
Maps edge index from Dune onto ALU3dGrid reference face.
Definition: topology.hh:326
static int alu2duneVertex(int index)
Maps vertex index from ALU3dGrid onto Dune reference face.
Definition: topology.hh:283
static int dune2aluVertex(int index)
Maps vertex index from Dune onto ALU3dGrid reference face.
Definition: topology.hh:271
Dune namespace.
Definition: alignment.hh:10