4#include <boost/concept/assert.hpp>
17 : _vertices({&vertexOne, &vertexTwo, &vertexThree, &vertexFour})
19 PRECICE_ASSERT(vertexOne.getDimensions() == vertexTwo.getDimensions(),
20 vertexOne.getDimensions(), vertexTwo.getDimensions());
21 PRECICE_ASSERT(vertexOne.getDimensions() == vertexThree.getDimensions(),
22 vertexOne.getDimensions(), vertexThree.getDimensions());
23 PRECICE_ASSERT(vertexOne.getDimensions() == vertexFour.getDimensions(),
24 vertexOne.getDimensions(), vertexFour.getDimensions());
28 (&vertexOne != &vertexTwo) &&
29 (&vertexOne != &vertexThree) &&
30 (&vertexOne != &vertexFour) &&
31 (&vertexTwo != &vertexThree) &&
32 (&vertexTwo != &vertexFour) &&
33 (&vertexThree != &vertexFour),
34 "Tetrahedron vertices are not unique!");
36 std::sort(_vertices.begin(), _vertices.end(),
37 [](
const Vertex *lhs,
const Vertex *rhs) { return *lhs < *rhs; });
67 [](
const Vertex *v1,
const Vertex *v2) { return *v1 == *v2; });
72 return !(*
this == other);
79 const auto &v0 = t.
vertex(0);
80 const auto &v1 = t.
vertex(1);
81 const auto &v2 = t.
vertex(2);
82 const auto &v3 = t.
vertex(3);
84 return os <<
"MULTILINESTRING ("
85 <<
"(" << v0.
getCoords().transpose().format(wkt()) <<
", " << v1.getCoords().transpose().format(wkt()) <<
"), "
86 <<
"(" << v0.getCoords().transpose().format(wkt()) <<
", " << v2.getCoords().transpose().format(wkt()) <<
"), "
87 <<
"(" << v0.getCoords().transpose().format(wkt()) <<
", " << v3.getCoords().transpose().format(wkt()) <<
"), "
88 <<
"(" << v1.getCoords().transpose().format(wkt()) <<
", " << v2.getCoords().transpose().format(wkt()) <<
"), "
89 <<
"(" << v1.getCoords().transpose().format(wkt()) <<
", " << v3.getCoords().transpose().format(wkt()) <<
"), "
90 <<
"(" << v2.getCoords().transpose().format(wkt()) <<
", " << v3.getCoords().transpose().format(wkt()) <<
")"
#define PRECICE_ASSERT(...)
Tetrahedron of a mesh, defined by 4 vertices.
Vertex & vertex(int i)
Returns tetrahedron vertex with index 0, 1, 2 or 3.
std::array< Vertex *, 4 > _vertices
Vertices defining the Tetrahedron.
const Eigen::VectorXd getCenter() const
Returns the barycenter of the tetrahedron.
double getEnclosingRadius() const
Returns the radius of the sphere enclosing the tetrahedron.
double getVolume() const
Returns the unsigned volume of the tetrahedron.
bool operator!=(const Tetrahedron &other) const
Not equal, implemented in terms of equal.
bool operator==(const Tetrahedron &other) const
Compares two Tetrahedrons for equality.
int getDimensions() const
Returns dimensionalty of space the Tetrahedron is embedded in.
Tetrahedron(Vertex &vertexOne, Vertex &vertexTwo, Vertex &vertexThree, Vertex &vertexFour)
Eigen::VectorXd getCoords() const
Returns the coordinates of the vertex.
T is_permutation(T... args)
double tetraVolume(const Eigen::Vector3d &a, const Eigen::Vector3d &b, const Eigen::Vector3d &c, const Eigen::Vector3d &d)
Computes the (unsigned) area of a triangle in 3D.
provides Mesh, Data and primitives.
std::ostream & operator<<(std::ostream &os, const BoundingBox &bb)