OGS
TetRule.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 "TetRule.h"
5
7#include "MeshLib/Node.h"
8
9namespace MeshLib
10{
11double TetRule::computeVolume(Node const* const* element_nodes)
12{
13 return MathLib::calcTetrahedronVolume(*element_nodes[0], *element_nodes[1],
14 *element_nodes[2], *element_nodes[3]);
15}
16
17bool TetRule::isPntInElement(Node const* const* nodes,
18 MathLib::Point3d const& pnt, double eps)
19{
20 return MathLib::isPointInTetrahedron(pnt, *nodes[0], *nodes[1], *nodes[2],
21 *nodes[3], eps);
22}
23
25{
26 ElementErrorCode error_code;
29 return error_code;
30}
31
32} // end namespace MeshLib
Collects error flags for mesh elements.
virtual bool testElementNodeOrder() const =0
static bool isPntInElement(Node const *const *nodes, MathLib::Point3d const &pnt, double eps)
Definition TetRule.cpp:17
static double computeVolume(Node const *const *element_nodes)
Calculates the volume of a tetrahedron.
Definition TetRule.cpp:11
static ElementErrorCode validate(const Element *e)
Definition TetRule.cpp:24
double calcTetrahedronVolume(MathLib::Point3d const &a, MathLib::Point3d const &b, MathLib::Point3d const &c, MathLib::Point3d const &d)
bool isPointInTetrahedron(MathLib::Point3d const &p, MathLib::Point3d const &a, MathLib::Point3d const &b, MathLib::Point3d const &c, MathLib::Point3d const &d, double eps)
bool hasZeroVolume(MeshLib::Element const &element)
Returns true if the element has zero length/area/volume.
Definition Element.cpp:126