OGS
TriRule.cpp
Go to the documentation of this file.
1
10#include "TriRule.h"
11
13#include "MeshLib/Node.h"
14
15namespace MeshLib
16{
17double TriRule::computeVolume(Node const* const* element_nodes)
18{
19 return MathLib::calcTriangleArea(*element_nodes[0], *element_nodes[1],
20 *element_nodes[2]);
21}
22
23bool TriRule::isPntInElement(Node const* const* nodes,
24 MathLib::Point3d const& pnt, double eps)
25{
26 return MathLib::isPointInTriangle(pnt, *nodes[0], *nodes[1], *nodes[2],
27 eps);
28}
29
31{
32 ElementErrorCode error_code;
35 return error_code;
36}
37
38} // end namespace MeshLib
Definition of the Node class.
Collects error flags for mesh elements.
virtual bool testElementNodeOrder() const =0
static ElementErrorCode validate(const Element *e)
Definition TriRule.cpp:30
static double computeVolume(Node const *const *element_nodes)
Calculates the area of the triangle with straight edges.
Definition TriRule.cpp:17
static bool isPntInElement(Node const *const *nodes, MathLib::Point3d const &pnt, double eps)
Definition TriRule.cpp:23
double calcTriangleArea(MathLib::Point3d const &a, MathLib::Point3d const &b, MathLib::Point3d const &c)
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)
bool hasZeroVolume(MeshLib::Element const &element)
Returns true if the element has zero length/area/volume.
Definition Element.cpp:119