OGS
PointRule1.cpp
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Copyright (c) OpenGeoSys Community (opengeosys.org)
2// SPDX-License-Identifier: BSD-3-Clause
3
4#include "PointRule1.h"
5
6#include "MathLib/Point3d.h"
7#include "MeshLib/Node.h"
8
9namespace MeshLib
10{
11const unsigned PointRule1::edge_nodes[1][1] = {{0}};
12
13double PointRule1::computeVolume(Node const* const* /*element_nodes*/)
14{
15 return 0;
16}
17
18bool PointRule1::isPntInElement(Node const* const* nodes,
19 MathLib::Point3d const& pnt, double eps)
20{
21 double const dist = MathLib::sqrDist(*nodes[0], pnt);
22 return (dist < eps);
23}
24
25unsigned PointRule1::identifyFace(Node const* const* element_nodes,
26 Node const* nodes[1])
27{
28 if (nodes[0] == element_nodes[0])
29 {
30 return 0;
31 }
32 return std::numeric_limits<unsigned>::max();
33}
34
36{
37 ElementErrorCode error_code;
39 return error_code;
40}
41
42} // end namespace MeshLib
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:34
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:19
bool hasZeroVolume(MeshLib::Element const &element)
Returns true if the element has zero length/area/volume.
Definition Element.cpp:126