OGS
MeshLib::TriRule Class Reference

Detailed Description

This class represents a 2d triangle element in 3d space.

Definition at line 22 of file TriRule.h.

#include <TriRule.h>

Inheritance diagram for MeshLib::TriRule:
[legend]
Collaboration diagram for MeshLib::TriRule:
[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)
 Calculates the area of the triangle with straight edges.
 
- Static Public Member Functions inherited from MeshLib::FaceRule
static const ElementgetFace (const Element *e, unsigned i)
 Returns the face i of the element.
 
static bool testElementNodeOrder (Element const &e)
 
static Eigen::Vector3d getFirstSurfaceVector (Element const &e)
 
static Eigen::Vector3d getSecondSurfaceVector (Element const &e)
 
static Eigen::Vector3d getSurfaceNormal (Element const &e)
 Returns the surface normal of a 2D element.
 

Static Public Attributes

static const unsigned n_base_nodes = 3u
 Constant: The number of base nodes for this element.
 
static const MeshElemType mesh_elem_type = MeshElemType::TRIANGLE
 Constant: The geometric type of the element.
 
static const unsigned n_edges = 3
 Constant: The number of edges.
 
static const unsigned n_neighbors = 3
 Constant: The number of neighbors.
 
- Static Public Attributes inherited from MeshLib::FaceRule
static const unsigned dimension = 2u
 Constant: Dimension of this mesh element.
 
static const unsigned n_faces = 0
 Constant: The number of faces.
 

Additional Inherited Members

- Static Protected Member Functions inherited from MeshLib::FaceRule
template<typename ElementRule >
static unsigned identifyFace (Node const *const *element_nodes, Node const *nodes[ElementRule::dimension])
 Returns the ID of an edge given an array of nodes.
 

Member Function Documentation

◆ computeVolume()

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

Calculates the area of the triangle with straight edges.

Definition at line 17 of file TriRule.cpp.

18{
19 return MathLib::calcTriangleArea(*element_nodes[0], *element_nodes[1],
20 *element_nodes[2]);
21}
double calcTriangleArea(MathLib::Point3d const &a, MathLib::Point3d const &b, MathLib::Point3d const &c)

References MathLib::calcTriangleArea().

◆ isPntInElement()

bool MeshLib::TriRule::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 23 of file TriRule.cpp.

25{
26 return MathLib::isPointInTriangle(pnt, *nodes[0], *nodes[1], *nodes[2],
27 eps);
28}
bool isPointInTriangle(MathLib::Point3d const &p, MathLib::Point3d const &a, MathLib::Point3d const &b, MathLib::Point3d const &c, double eps_pnt_out_of_plane, double eps_pnt_out_of_tri, MathLib::TriangleTest algorithm)

References MathLib::isPointInTriangle().

◆ validate()

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

Tests if the element is geometrically valid.

Definition at line 30 of file TriRule.cpp.

31{
32 ElementErrorCode error_code;
34 error_code[ElementErrorFlag::NodeOrder] = !e->testElementNodeOrder();
35 return error_code;
36}
Collects error flags for mesh elements.
bool hasZeroVolume(MeshLib::Element const &element)
Returns true if the element has zero length/area/volume.
Definition Element.cpp:119

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

Member Data Documentation

◆ mesh_elem_type

const MeshElemType MeshLib::TriRule::mesh_elem_type = MeshElemType::TRIANGLE
static

Constant: The geometric type of the element.

Definition at line 29 of file TriRule.h.

◆ n_base_nodes

const unsigned MeshLib::TriRule::n_base_nodes = 3u
static

Constant: The number of base nodes for this element.

Definition at line 26 of file TriRule.h.

◆ n_edges

const unsigned MeshLib::TriRule::n_edges = 3
static

Constant: The number of edges.

Definition at line 32 of file TriRule.h.

◆ n_neighbors

const unsigned MeshLib::TriRule::n_neighbors = 3
static

Constant: The number of neighbors.

Definition at line 35 of file TriRule.h.


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