OGS
MeshLib::PrismRule Class Reference

Detailed Description

Definition at line 19 of file PrismRule.h.

#include <PrismRule.h>

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

Static Public Member Functions

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_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 Function Documentation

◆ computeVolume()

double MeshLib::PrismRule::computeVolume ( Node const *const * element_nodes)
static

Calculates the volume of a prism with flat faces by partitioning it into three tetrahedra.

Definition at line 18 of file PrismRule.cpp.

19{
20 return MathLib::calcTetrahedronVolume(*element_nodes[0],
21 *element_nodes[1],
22 *element_nodes[2],
23 *element_nodes[3]) +
24 MathLib::calcTetrahedronVolume(*element_nodes[1],
25 *element_nodes[4],
26 *element_nodes[2],
27 *element_nodes[3]) +
28 MathLib::calcTetrahedronVolume(*element_nodes[2],
29 *element_nodes[4],
30 *element_nodes[5],
31 *element_nodes[3]);
32}
double calcTetrahedronVolume(MathLib::Point3d const &a, MathLib::Point3d const &b, MathLib::Point3d const &c, MathLib::Point3d const &d)

References MathLib::calcTetrahedronVolume().

◆ isPntInElement()

bool MeshLib::PrismRule::isPntInElement ( Node const *const * nodes,
MathLib::Point3d const & pnt,
double eps )
static

Checks if a point is inside the element.

Parameters
pnta 3D MathLib::Point3d object
epstolerance for numerical algorithm used or computing the property
Returns
true if the point is not outside the element, false otherwise
Parameters
nodesthe nodes of the element.

Definition at line 34 of file PrismRule.cpp.

37{
39 pnt, *nodes[0], *nodes[1], *nodes[2], *nodes[3], eps) ||
41 pnt, *nodes[1], *nodes[4], *nodes[2], *nodes[3], eps) ||
43 pnt, *nodes[2], *nodes[4], *nodes[5], *nodes[3], eps));
44}
bool isPointInTetrahedron(MathLib::Point3d const &p, MathLib::Point3d const &a, MathLib::Point3d const &b, MathLib::Point3d const &c, MathLib::Point3d const &d, double eps)

References MathLib::isPointInTetrahedron().

◆ validate()

ElementErrorCode MeshLib::PrismRule::validate ( const Element * e)
static

Tests if the element is geometrically valid.

Definition at line 46 of file PrismRule.cpp.

47{
48 ElementErrorCode error_code;
50
51 for (unsigned i = 1; i < 4; ++i)
52 {
53 const auto* quad(dynamic_cast<const MeshLib::Quad*>(e->getFace(i)));
54 if (quad)
55 {
56 error_code |= quad->validate();
57 }
58 else
59 {
61 }
62 delete quad;
63 }
64 error_code[ElementErrorFlag::NodeOrder] = !e->testElementNodeOrder();
65 return error_code;
66}
Collects error flags for mesh elements.
void set(ElementErrorFlag e)
Set a specific flag.
bool hasZeroVolume(MeshLib::Element const &element)
Returns true if the element has zero length/area/volume.
Definition Element.cpp:119

References MeshLib::Element::getFace(), MeshLib::hasZeroVolume(), NodeOrder, ElementErrorCode::set(), MeshLib::Element::testElementNodeOrder(), and ZeroVolume.

Member Data Documentation

◆ mesh_elem_type

const MeshElemType MeshLib::PrismRule::mesh_elem_type = MeshElemType::PRISM
static

Constant: The geometric type of the element.

Definition at line 26 of file PrismRule.h.

◆ n_base_nodes

const unsigned MeshLib::PrismRule::n_base_nodes = 6u
static

Constant: The number of base nodes for this element.

Definition at line 23 of file PrismRule.h.

◆ n_edges

const unsigned MeshLib::PrismRule::n_edges = 9
static

Constant: The number of edges.

Definition at line 32 of file PrismRule.h.

◆ n_faces

const unsigned MeshLib::PrismRule::n_faces = 5
static

Constant: The number of faces.

Definition at line 29 of file PrismRule.h.

Referenced by MeshLib::PrismRule15::getFace(), and MeshLib::PrismRule6::getFace().

◆ n_neighbors

const unsigned MeshLib::PrismRule::n_neighbors = 5
static

Constant: The number of neighbors.

Definition at line 35 of file PrismRule.h.


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