OGS
TetRule10.cpp
Go to the documentation of this file.
1
11#include "TetRule10.h"
12
13#include <array>
14
15#include "BaseLib/Logging.h"
16#include "MeshLib/Node.h"
17#include "Tri.h"
18
19namespace MeshLib
20{
21const unsigned TetRule10::face_nodes[4][6] = {
22 {0, 2, 1, 6, 5, 4}, // Face 0
23 {0, 1, 3, 4, 8, 7}, // Face 1
24 {1, 2, 3, 5, 9, 8}, // Face 2
25 {2, 0, 3, 6, 7, 9} // Face 3
26};
27
28const unsigned TetRule10::edge_nodes[6][3] = {
29 {0, 1, 4}, // Edge 0
30 {1, 2, 5}, // Edge 1
31 {0, 2, 6}, // Edge 2
32 {0, 3, 7}, // Edge 3
33 {1, 3, 8}, // Edge 4
34 {2, 3, 9} // Edge 5
35};
36
37const Element* TetRule10::getFace(const Element* e, unsigned i)
38{
39 if (i < n_faces)
40 {
41 std::array<Node*, 6> nodes{};
42 for (unsigned j = 0; j < 6; j++)
43 {
44 nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
45 }
46 return new Tri6(nodes, e->getID());
47 }
48 ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i);
49 return nullptr;
50}
51
52} // end namespace MeshLib
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:45
Definition of the Node class.
Definition of the Tri class.
virtual const Node * getNode(unsigned idx) const =0
std::size_t getID() const
Returns the ID of the element.
Definition Element.h:89
static const Element * getFace(const Element *e, unsigned i)
Returns the i-th face of the element.
Definition TetRule10.cpp:37
static const unsigned edge_nodes[6][3]
Constant: Local node index table for edge.
Definition TetRule10.h:54
static const unsigned face_nodes[4][6]
Constant: Local node index table for faces.
Definition TetRule10.h:51
static const unsigned n_faces
Constant: The number of faces.
Definition TetRule.h:30
TemplateElement< MeshLib::TriRule6 > Tri6
Definition Tri.h:27