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 44 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 79 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 22 of file PrismRule6.cpp.

23{
24 if (i < n_faces)
25 {
26 unsigned nFaceNodes(PrismRule6::n_face_nodes[i]);
27 auto** nodes = new Node*[nFaceNodes];
28 for (unsigned j = 0; j < nFaceNodes; j++)
29 {
30 nodes[j] = const_cast<Node*>(e->getNode(face_nodes[i][j]));
31 }
32
33 if (i == 0 || i == 4)
34 {
35 return new Tri(nodes, e->getID());
36 }
37
38 return new Quad(nodes);
39 }
40 ERR("Error in MeshLib::Element::getFace() - Index {:d} does not exist.", i);
41 return nullptr;
42}
void ERR(fmt::format_string< Args... > fmt, Args &&... args)
Definition Logging.h:45
static const unsigned n_face_nodes[5]
Constant: Table for the number of nodes for each face.
Definition PrismRule6.h:76
static constexpr const unsigned face_nodes[5][4]
Constant: Local node index table for faces.
Definition PrismRule6.h:54
static const unsigned n_faces
Constant: The number of faces.
Definition PrismRule.h:29
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::PrismRule::n_faces.

◆ identifyFace()

static 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 85 of file PrismRule6.h.

87 {
88 return CellRule::identifyFace<PrismRule6>(element_nodes, nodes);
89 }
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::PrismRule6::cell_type = CellType::PRISM6
static

Constant: The FEM type of the element.

Definition at line 51 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 63 of file PrismRule6.h.

63 {
64 {0, 1}, // Edge 0
65 {1, 2}, // Edge 1
66 {0, 2}, // Edge 2
67 {0, 3}, // Edge 3
68 {1, 4}, // Edge 4
69 {2, 5}, // Edge 5
70 {3, 4}, // Edge 6
71 {4, 5}, // Edge 7
72 {3, 5} // Edge 8
73 };

◆ 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 54 of file PrismRule6.h.

54 {
55 {0, 2, 1, 99}, // Face 0
56 {0, 1, 4, 3}, // Face 1
57 {1, 2, 5, 4}, // Face 2
58 {2, 0, 3, 5}, // Face 3
59 {3, 4, 5, 99} // Face 4
60 };

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 48 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 76 of file PrismRule6.h.

Referenced by getFace().


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