OGS
MeshLib::PyramidRule5 Class Reference

Detailed Description

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

4
//|\
// | \
7// | \6
// |5 \
// | \
3/.... |.....2
./ | 2 /
./4 | /
3./ | /1
./ | /
./ |/
0------------1
0

Definition at line 43 of file PyramidRule5.h.

#include <PyramidRule5.h>

Inheritance diagram for MeshLib::PyramidRule5:
[legend]
Collaboration diagram for MeshLib::PyramidRule5:
[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::PyramidRule
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)
 
- Static Public Member Functions inherited from MeshLib::CellRule
static bool testElementNodeOrder (Element const &e)
 

Static Public Attributes

static const unsigned n_all_nodes = 5u
 Constant: The number of all nodes for this element.
 
static const CellType cell_type = CellType::PYRAMID5
 Constant: The FEM type of the element.
 
static const unsigned face_nodes [5][4]
 Constant: Local node index table for faces.
 
static const unsigned edge_nodes [8][2]
 Constant: Local node index table for edge.
 
static const unsigned n_face_nodes [5] = {3, 3, 3, 3, 4}
 Constant: Table for the number of nodes for each face.
 
- Static Public Attributes inherited from MeshLib::PyramidRule
static const unsigned n_base_nodes = 5u
 Constant: The number of base nodes for this element.
 
static const MeshElemType mesh_elem_type = MeshElemType::PYRAMID
 Constant: The geometric type of the element.
 
static const unsigned n_faces = 5
 Constant: The number of faces.
 
static const unsigned n_edges = 8
 Constant: The number of edges.
 
static const unsigned n_neighbors = 5
 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 62 of file PyramidRule5.h.

Member Function Documentation

◆ getFace()

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

Returns the i-th face of the element.

Definition at line 41 of file PyramidRule5.cpp.

42{
43 if (i < n_faces)
44 {
45 unsigned nFaceNodes(PyramidRule5::n_face_nodes[i]);
46 auto** nodes = new Node*[nFaceNodes];
47 for (unsigned j = 0; j < nFaceNodes; j++)
48 {
49 nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
50 }
51
52 if (i < 4)
53 {
54 return new Tri(nodes, e->getID());
55 }
56
57 return new Quad(nodes, e->getID());
58 }
59 ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i);
60 return nullptr;
61}
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:45
static const unsigned face_nodes[5][4]
Constant: Local node index table for faces.
static const unsigned n_face_nodes[5]
Constant: Table for the number of nodes for each face.
static const unsigned n_faces
Constant: The number of faces.
Definition PyramidRule.h:30
TemplateElement< MeshLib::QuadRule4 > Quad
Definition Quad.h:28
TemplateElement< MeshLib::TriRule3 > Tri
Definition Tri.h:26

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

◆ identifyFace()

static unsigned MeshLib::PyramidRule5::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 68 of file PyramidRule5.h.

70 {
71 return CellRule::identifyFace<PyramidRule5>(element_nodes, nodes);
72 }

Member Data Documentation

◆ cell_type

const CellType MeshLib::PyramidRule5::cell_type = CellType::PYRAMID5
static

Constant: The FEM type of the element.

Definition at line 50 of file PyramidRule5.h.

◆ edge_nodes

const unsigned MeshLib::PyramidRule5::edge_nodes
static
Initial value:
= {
{0, 1},
{1, 2},
{2, 3},
{0, 3},
{0, 4},
{1, 4},
{2, 4},
{3, 4}
}

Constant: Local node index table for edge.

Definition at line 56 of file PyramidRule5.h.

◆ face_nodes

const unsigned MeshLib::PyramidRule5::face_nodes
static
Initial value:
= {
{0, 1, 4, 99},
{1, 2, 4, 99},
{2, 3, 4, 99},
{3, 0, 4, 99},
{0, 3, 2, 1}
}

Constant: Local node index table for faces.

Definition at line 53 of file PyramidRule5.h.

Referenced by getFace().

◆ n_all_nodes

const unsigned MeshLib::PyramidRule5::n_all_nodes = 5u
static

Constant: The number of all nodes for this element.

Definition at line 47 of file PyramidRule5.h.

◆ n_face_nodes

const unsigned MeshLib::PyramidRule5::n_face_nodes = {3, 3, 3, 3, 4}
static

Constant: Table for the number of nodes for each face.

Definition at line 59 of file PyramidRule5.h.

Referenced by getFace().


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