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 const unsigned face_nodes [4][3]
 Constant: Local node index table for faces.
 
static 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 57 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 37 of file TetRule4.cpp.

38{
39 if (i < n_faces)
40 {
41 std::array<Node*, 3> nodes{};
42 for (unsigned j = 0; j < 3; j++)
43 {
44 nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
45 }
46 return new Tri(nodes, e->getID());
47 }
48 ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i);
49 return nullptr;
50}
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:45
static 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 63 of file TetRule4.h.

65 {
66 return CellRule::identifyFace<TetRule4>(element_nodes, nodes);
67 }
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
static
Initial value:
= {
{0, 1},
{1, 2},
{0, 2},
{0, 3},
{1, 3},
{2, 3}
}

Constant: Local node index table for edge.

Definition at line 54 of file TetRule4.h.

◆ face_nodes

const unsigned MeshLib::TetRule4::face_nodes
static
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.

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: