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 
16 namespace MeshLib
17 {
18 const unsigned PointRule1::edge_nodes[1][1] = {{0}};
19 
20 double PointRule1::computeVolume(Node const* const* /*_nodes*/)
21 {
22  return 0;
23 }
24 
25 bool 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 
32 unsigned PointRule1::identifyFace(Node const* const* _nodes,
33  Node const* nodes[1])
34 {
35  if (nodes[0] == _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 double computeVolume(Node const *const *_nodes)
Calculates the length of a line.
Definition: PointRule1.cpp:20
static bool isPntInElement(Node const *const *nodes, MathLib::Point3d const &pnt, double eps)
Definition: PointRule1.cpp:25
static ElementErrorCode validate(const Element *e)
Tests if the element is geometrically valid.
Definition: PointRule1.cpp:42
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.
Definition: PointRule1.cpp:32
double sqrDist(MathLib::Point3d const &p0, MathLib::Point3d const &p1)
Definition: Point3d.h:48
bool hasZeroVolume(MeshLib::Element const &element)
Returns true if the element has zero length/area/volume.
Definition: Element.cpp:121