OGS
MeshLib::TetRule4 Class Reference

Detailed Description

This class represents a 3d tetrahedron element with 4 nodes. The following sketch shows the node and edge numbering.

3
/|\
/ | \
3/ | \5
/ |4 \
/ | \
0.....|.....2
\ | 2 /
\ | /
0\ | /1
\ | /
\|/
1

Definition at line 41 of file TetRule4.h.

#include <TetRule4.h>

Inheritance diagram for MeshLib::TetRule4:
[legend]
Collaboration diagram for MeshLib::TetRule4:
[legend]

Public Types

using EdgeReturn = MeshLib::LinearEdgeReturn
 Returns the i-th edge of the element.
 

Static Public Member Functions

static const ElementgetFace (const Element *e, unsigned i)
 Returns the i-th face of the element.
 
static unsigned identifyFace (Node const *const *element_nodes, Node const *nodes[3])
 Returns the ID of a face given an array of nodes.
 
- Static Public Member Functions inherited from MeshLib::TetRule
static bool isPntInElement (Node const *const *nodes, MathLib::Point3d const &pnt, double eps)
 
static ElementErrorCode validate (const Element *e)
 
static double computeVolume (Node const *const *element_nodes)
 Calculates the volume of a tetrahedron.
 
- Static Public Member Functions inherited from MeshLib::CellRule
static bool testElementNodeOrder (Element const &e)
 

Static Public Attributes

static const unsigned n_all_nodes = 4u
 Constant: The number of all nodes for this element.
 
static const CellType cell_type = CellType::TET4
 Constant: The FEM type of the element.
 
static constexpr const unsigned face_nodes [4][3]
 Constant: Local node index table for faces.
 
static constexpr const unsigned edge_nodes [6][2]
 Constant: Local node index table for edge.
 
- Static Public Attributes inherited from MeshLib::TetRule
static const unsigned n_base_nodes = 4u
 Constant: The number of base nodes for this element.
 
static const MeshElemType mesh_elem_type = MeshElemType::TETRAHEDRON
 Constant: The geometric type of the element.
 
static const unsigned n_faces = 4
 Constant: The number of faces.
 
static const unsigned n_edges = 6
 Constant: The number of edges.
 
static const unsigned n_neighbors = 4
 Constant: The number of neighbors.
 
- Static Public Attributes inherited from MeshLib::CellRule
static const unsigned dimension = 3u
 Constant: Dimension of this mesh element.
 

Additional Inherited Members

- Static Protected Member Functions inherited from MeshLib::CellRule
template<typename ElementRule >
static unsigned identifyFace (Node const *const *element_nodes, Node const *nodes[ElementRule::dimension])
 Returns the ID of a face given an array of nodes.
 

Member Typedef Documentation

◆ EdgeReturn

Returns the i-th edge of the element.

Definition at line 69 of file TetRule4.h.

Member Function Documentation

◆ getFace()

const Element * MeshLib::TetRule4::getFace ( const Element * e,
unsigned i )
static

Returns the i-th face of the element.

Definition at line 21 of file TetRule4.cpp.

22{
23 if (i < n_faces)
24 {
25 std::array<Node*, 3> nodes{};
26 for (unsigned j = 0; j < 3; j++)
27 {
28 nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
29 }
30 return new Tri(nodes, e->getID());
31 }
32 ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i);
33 return nullptr;
34}
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:45
static constexpr const unsigned face_nodes[4][3]
Constant: Local node index table for faces.
Definition TetRule4.h:51
static const unsigned n_faces
Constant: The number of faces.
Definition TetRule.h:30
TemplateElement< MeshLib::TriRule3 > Tri
Definition Tri.h:26

References ERR(), face_nodes, MeshLib::Element::getID(), MeshLib::Element::getNode(), and MeshLib::TetRule::n_faces.

◆ identifyFace()

static unsigned MeshLib::TetRule4::identifyFace ( Node const *const * element_nodes,
Node const * nodes[3] )
inlinestatic

Returns the ID of a face given an array of nodes.

Definition at line 75 of file TetRule4.h.

77 {
78 return CellRule::identifyFace<TetRule4>(element_nodes, nodes);
79 }
static unsigned identifyFace(Node const *const *element_nodes, Node const *nodes[ElementRule::dimension])
Returns the ID of a face given an array of nodes.
Definition CellRule.h:39

References MeshLib::CellRule::identifyFace().

Member Data Documentation

◆ cell_type

const CellType MeshLib::TetRule4::cell_type = CellType::TET4
static

Constant: The FEM type of the element.

Definition at line 48 of file TetRule4.h.

◆ edge_nodes

const unsigned MeshLib::TetRule4::edge_nodes[6][2]
staticconstexpr
Initial value:
= {
{0, 1},
{1, 2},
{0, 2},
{0, 3},
{1, 3},
{2, 3}
}

Constant: Local node index table for edge.

Definition at line 59 of file TetRule4.h.

59 {
60 {0, 1}, // Edge 0
61 {1, 2}, // Edge 1
62 {0, 2}, // Edge 2
63 {0, 3}, // Edge 3
64 {1, 3}, // Edge 4
65 {2, 3} // Edge 5
66 };

◆ face_nodes

const unsigned MeshLib::TetRule4::face_nodes[4][3]
staticconstexpr
Initial value:
= {
{0, 2, 1},
{0, 1, 3},
{1, 2, 3},
{2, 0, 3}
}

Constant: Local node index table for faces.

Definition at line 51 of file TetRule4.h.

51 {
52 {0, 2, 1}, // Face 0
53 {0, 1, 3}, // Face 1
54 {1, 2, 3}, // Face 2
55 {2, 0, 3} // Face 3
56 };

Referenced by getFace().

◆ n_all_nodes

const unsigned MeshLib::TetRule4::n_all_nodes = 4u
static

Constant: The number of all nodes for this element.

Definition at line 45 of file TetRule4.h.


The documentation for this class was generated from the following files: