OGS
MeshLib::PrismRule6 Class Reference

Detailed Description

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

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

Definition at line 37 of file PrismRule6.h.

#include <PrismRule6.h>

Inheritance diagram for MeshLib::PrismRule6:
[legend]
Collaboration diagram for MeshLib::PrismRule6:
[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::PrismRule
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 = 6u
 Constant: The number of all nodes for this element.
static const CellType cell_type = CellType::PRISM6
 Constant: The FEM type of the element.
static constexpr const unsigned face_nodes [5][4]
 Constant: Local node index table for faces.
static constexpr const unsigned edge_nodes [9][2]
 Constant: Local node index table for edge.
static const unsigned n_face_nodes [5] = {3, 4, 4, 4, 3}
 Constant: Table for the number of nodes for each face.
Static Public Attributes inherited from MeshLib::PrismRule
static const unsigned n_base_nodes = 6u
 Constant: The number of base nodes for this element.
static const MeshElemType mesh_elem_type = MeshElemType::PRISM
 Constant: The geometric type of the element.
static const unsigned n_faces = 5
 Constant: The number of faces.
static const unsigned n_edges = 9
 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 72 of file PrismRule6.h.

Member Function Documentation

◆ getFace()

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

Returns the i-th face of the element.

Definition at line 15 of file PrismRule6.cpp.

16{
17 if (i < n_faces)
18 {
19 unsigned nFaceNodes(PrismRule6::n_face_nodes[i]);
20 auto** nodes = new Node*[nFaceNodes];
21 for (unsigned j = 0; j < nFaceNodes; j++)
22 {
23 nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
24 }
25
26 if (i == 0 || i == 4)
27 {
28 return new Tri(nodes, e->getID());
29 }
30
31 return new Quad(nodes);
32 }
33 ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i);
34 return nullptr;
35}
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:40
static const unsigned n_face_nodes[5]
Constant: Table for the number of nodes for each face.
Definition PrismRule6.h:69
static constexpr const unsigned face_nodes[5][4]
Constant: Local node index table for faces.
Definition PrismRule6.h:47
static const unsigned n_faces
Constant: The number of faces.
Definition PrismRule.h:22
TemplateElement< MeshLib::QuadRule4 > Quad
Definition Quad.h:17
TemplateElement< MeshLib::TriRule3 > Tri
Definition Tri.h:15

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

◆ identifyFace()

unsigned MeshLib::PrismRule6::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 78 of file PrismRule6.h.

80 {
81 return CellRule::identifyFace<PrismRule6>(element_nodes, nodes);
82 }
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:32

References MeshLib::CellRule::identifyFace().

Member Data Documentation

◆ cell_type

const CellType MeshLib::PrismRule6::cell_type = CellType::PRISM6
static

Constant: The FEM type of the element.

Definition at line 44 of file PrismRule6.h.

◆ edge_nodes

const unsigned MeshLib::PrismRule6::edge_nodes[9][2]
staticconstexpr
Initial value:
= {
{0, 1},
{1, 2},
{0, 2},
{0, 3},
{1, 4},
{2, 5},
{3, 4},
{4, 5},
{3, 5}
}

Constant: Local node index table for edge.

Definition at line 56 of file PrismRule6.h.

56 {
57 {0, 1}, // Edge 0
58 {1, 2}, // Edge 1
59 {0, 2}, // Edge 2
60 {0, 3}, // Edge 3
61 {1, 4}, // Edge 4
62 {2, 5}, // Edge 5
63 {3, 4}, // Edge 6
64 {4, 5}, // Edge 7
65 {3, 5} // Edge 8
66 };

◆ face_nodes

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

Constant: Local node index table for faces.

Definition at line 47 of file PrismRule6.h.

47 {
48 {0, 2, 1, 99}, // Face 0
49 {0, 1, 4, 3}, // Face 1
50 {1, 2, 5, 4}, // Face 2
51 {2, 0, 3, 5}, // Face 3
52 {3, 4, 5, 99} // Face 4
53 };

Referenced by getFace().

◆ n_all_nodes

const unsigned MeshLib::PrismRule6::n_all_nodes = 6u
static

Constant: The number of all nodes for this element.

Definition at line 41 of file PrismRule6.h.

◆ n_face_nodes

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

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

Definition at line 69 of file PrismRule6.h.

Referenced by getFace().


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