Skip to content
Snippets Groups Projects
Commit 209686f4 authored by Adrian Burri's avatar Adrian Burri
Browse files

Added missing Dune<->ALU mappings, introduced a reference edge numbering for...

Added missing Dune<->ALU mappings, introduced a reference edge numbering for the ALU reference element, which needs to be implemented there

[[Imported from SVN: r3083]]
parent 52ddcfbc
No related branches found
No related tags found
No related merge requests found
......@@ -13,6 +13,24 @@ namespace Dune {
const int ElementTopologyMapping<hexa>::
dune2aluFace_[EntityCount<hexa>::numFaces] = {4, 2, 5, 3, 0, 1};
template <>
const int ElementTopologyMapping<tetra>::
dune2aluEdge_[EntityCount<tetra>::numEdges] = {3, 2, 4, 5, 0, 1};
template <>
const int ElementTopologyMapping<hexa>::
dune2aluEdge_[EntityCount<hexa>::numEdges] = {10, 9, 7, 8, 1, 3,
6, 4, 0, 2, 7, 5};
template <>
const int ElementTopologyMapping<tetra>::
alu2duneEdge_[EntityCount<tetra>::numEdges] = {4, 5, 1, 0, 2, 3};
template <>
const int ElementTopologyMapping<hexa>::
alu2duneEdge_[EntityCount<hexa>::numEdges] = {8, 4, 9, 5, 7, 11,
6, 10, 3, 1, 0, 2};
template <>
const int ElementTopologyMapping<tetra>::
alu2duneFace_[EntityCount<tetra>::numFaces] = {0, 1, 2, 3};
......
......@@ -14,6 +14,7 @@ namespace Dune {
struct EntityCount<tetra> {
enum {numFaces = 4};
enum {numVertices = 4};
enum {numEdges = 6};
enum {numVerticesPerFace = 3};
enum {numEdgesPerFace = 3};
};
......@@ -22,6 +23,7 @@ namespace Dune {
struct EntityCount<hexa> {
enum {numFaces = 6};
enum {numVertices = 8};
enum {numEdges = 12};
enum {numVerticesPerFace = 4};
enum {numEdgesPerFace = 4};
};
......@@ -34,6 +36,7 @@ namespace Dune {
{
enum { numFaces = EntityCount<type>::numFaces };
enum { numVertices = EntityCount<type>::numVertices };
enum { numEdges = EntityCount<type>::numEdges };
enum { numVerticesPerFace = EntityCount<type>::numVerticesPerFace };
public:
......@@ -42,6 +45,11 @@ namespace Dune {
//! Maps face index from ALU3dGrid onto Dune reference element
static int alu2duneFace(int index);
//! Maps edge index from Dune onto ALU3dGrid reference element
static int dune2aluEdge(int index);
//! Maps edge index from ALU3dGrid onto Dune reference element
static int alu2duneEdge(int index);
//! Maps vertex index from Dune onto ALU3dGrid reference element
static int dune2aluVertex(int index);
//! Maps vertex index from ALU3dGrid onto Dune reference element
......@@ -66,6 +74,9 @@ namespace Dune {
const static int dune2aluFace_[numFaces];
const static int alu2duneFace_[numFaces];
const static int dune2aluEdge_[numEdges];
const static int alu2duneEdge_[numEdges];
const static int dune2aluVertex_[numVertices];
const static int alu2duneVertex_[numVertices];
......@@ -99,7 +110,10 @@ namespace Dune {
//! \param twist twist of the face in consideration
//! \return local Dune vertex index on reference element face
static int alu2duneVertex(int index, int twist);
//! Maps edge index from Dune onto ALU3dGrid reference face
static int dune2aluEdge(int index);
//! Maps edge index from ALU3dGrid onto Dune reference face
static int alu2duneEdge(int index);
// private:
static int twist(int index, int faceTwist);
static int invTwist(int index, int faceTwist);
......@@ -137,6 +151,18 @@ namespace Dune {
return alu2duneFace_[index];
}
template <ALU3dGridElementType type>
int ElementTopologyMapping<type>::dune2aluEdge(int index) {
assert(index >= 0 && index < numEdges);
return dune2aluEdge_[index];
}
template <ALU3dGridElementType type>
int ElementTopologyMapping<type>::alu2duneEdge(int index) {
assert(index >= 0 && index < numEdges);
return alu2duneEdge_[index];
}
template <ALU3dGridElementType type>
int ElementTopologyMapping<type>::dune2aluVertex(int index) {
assert(index >= 0 && index < numVertices);
......@@ -190,5 +216,17 @@ namespace Dune {
return alu2duneVertex_[invTwist(index, twist)];
}
template <ALU3dGridElementType type>
int FaceTopologyMapping<type>::alu2duneEdge(int index) {
assert(index >= 0 && index < EntityCount<type>::numEdgesPerFace);
return alu2duneEdge_[index];
}
template <ALU3dGridElementType type>
int FaceTopologyMapping<type>::dune2aluEdge(int index) {
assert(index >= 0 && index < EntityCount<type>::numEdgesPerFace);
return dune2aluEdge_[index];
}
} // end namespace Dune
#endif
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment