OGS
PointRule1.cpp
Go to the documentation of this file.
1
11#include "PointRule1.h"
12
13#include "MathLib/Point3d.h"
14#include "MeshLib/Node.h"
15
16namespace MeshLib
17{
18const unsigned PointRule1::edge_nodes[1][1] = {{0}};
19
20double PointRule1::computeVolume(Node const* const* /*element_nodes*/)
21{
22 return 0;
23}
24
25bool PointRule1::isPntInElement(Node const* const* nodes,
26 MathLib::Point3d const& pnt, double eps)
27{
28 double const dist = MathLib::sqrDist(*nodes[0], pnt);
29 return (dist < eps);
30}
31
32unsigned PointRule1::identifyFace(Node const* const* element_nodes,
33 Node const* nodes[1])
34{
35 if (nodes[0] == element_nodes[0])
36 {
37 return 0;
38 }
39 return std::numeric_limits<unsigned>::max();
40}
41
43{
44 ElementErrorCode error_code;
46 return error_code;
47}
48
49} // end namespace MeshLib
Definition of the Node class.
Definition of the Point3d class.
Collects error flags for mesh elements.
static bool isPntInElement(Node const *const *nodes, MathLib::Point3d const &pnt, double eps)
static ElementErrorCode validate(const Element *e)
Tests if the element is geometrically valid.
static const unsigned edge_nodes[1][1]
Constant: Local node index table for edge.
Definition PointRule1.h:41
static unsigned identifyFace(Node const *const *, Node const *nodes[1])
Returns the ID of a face given an array of nodes.
static double computeVolume(Node const *const *element_nodes)
Calculates the length of a line.
double sqrDist(MathLib::Point3d const &p0, MathLib::Point3d const &p1)
Definition Point3d.cpp:26
bool hasZeroVolume(MeshLib::Element const &element)
Returns true if the element has zero length/area/volume.
Definition Element.cpp:119