preCICE v3.1.2
|
Triangle of a mesh, defined by three vertices. More...
#include <Triangle.hpp>
Public Types | |
using | const_iterator = IndexRangeIterator<const Triangle, const Vertex::RawCoords> |
Type of the read-only const random-access iterator over Vertex coords. | |
using | iterator = const_iterator |
Type of the read-only random access vertex iterator. | |
using | value_type = Vertex::RawCoords |
Fix for the Boost.Test versions 1.65.1 - 1.67. | |
Public Member Functions | |
Triangle (Edge &edgeOne, Edge &edgeTwo, Edge &edgeThree) | |
Constructor based on 3 edges. | |
Triangle (Vertex &VertexOne, Vertex &VertexTwo, Vertex &VertexThree) | |
int | getDimensions () const |
Returns dimensionalty of space the triangle is embedded in. | |
Vertex & | vertex (int i) |
Returns triangle vertex with index 0, 1 or 2. | |
const Vertex & | vertex (int i) const |
Returns const triangle vertex with index 0, 1 or 2. | |
Eigen::VectorXd | computeNormal () const |
Computes the normal of the triangle. | |
double | getArea () const |
Returns the surface area of the triangle. | |
const Eigen::VectorXd | getCenter () const |
Returns the barycenter of the triangle. | |
double | getEnclosingRadius () const |
Returns the radius of the circle enclosing the triangle. | |
bool | operator== (const Triangle &other) const |
Compares two Triangles for equality. | |
bool | operator!= (const Triangle &other) const |
Not equal, implemented in terms of equal. | |
bool | operator< (const Triangle &other) const |
Weak ordering based on vertex ids. | |
Iterators | |
iterator | begin () |
Returns a read-only random-access iterator to the begin (0) of the vertex range [0,1,2]. | |
iterator | end () |
Returns a read-only random-access iterator to the end (3) of the vertex range [0,1,2]. | |
const_iterator | begin () const |
Returns a read-only random-access iterator to the begin (0) of the vertex range [0,1,2]. | |
const_iterator | end () const |
Returns a read-only random access iterator to the end (3) of the vertex range [0,1,2]. | |
const_iterator | cbegin () const |
Returns a read-only random-access iterator to the begin (0) of the vertex range [0,1,2]. | |
const_iterator | cend () const |
Returns a read-only random access iterator to the end (3) of the vertex range [0,1,2]. | |
Static Public Attributes | |
static constexpr int | vertexCount {3} |
Amount of vertices. | |
Private Attributes | |
std::array< Vertex *, 3 > | _vertices |
Vertices defining the triangle, sorted by Vertex::getID() | |
Triangle of a mesh, defined by three vertices.
Definition at line 27 of file Triangle.hpp.
using precice::mesh::Triangle::const_iterator = IndexRangeIterator<const Triangle, const Vertex::RawCoords> |
Type of the read-only const random-access iterator over Vertex coords.
This index-based iterator iterates over the vertices of this Triangle. The returned value is the forwarded result of Vertex::getCoords. It is thus a read-only random-access iterator.
Definition at line 35 of file Triangle.hpp.
Type of the read-only random access vertex iterator.
Definition at line 38 of file Triangle.hpp.
Fix for the Boost.Test versions 1.65.1 - 1.67.
Definition at line 41 of file Triangle.hpp.
Constructor based on 3 edges.
Definition at line 23 of file Triangle.cpp.
Constructor based on 3 vertices
The vertices will be sorted by Vertex::getID(). This allows to weakly order triangles.
Definition at line 56 of file Triangle.cpp.
|
inline |
Returns a read-only random-access iterator to the begin (0) of the vertex range [0,1,2].
Definition at line 155 of file Triangle.hpp.
|
inline |
Returns a read-only random-access iterator to the begin (0) of the vertex range [0,1,2].
Definition at line 165 of file Triangle.hpp.
|
inline |
Returns a read-only random-access iterator to the begin (0) of the vertex range [0,1,2].
Definition at line 175 of file Triangle.hpp.
|
inline |
Returns a read-only random access iterator to the end (3) of the vertex range [0,1,2].
Definition at line 180 of file Triangle.hpp.
Eigen::VectorXd precice::mesh::Triangle::computeNormal | ( | ) | const |
Computes the normal of the triangle.
Definition at line 75 of file Triangle.cpp.
|
inline |
Returns a read-only random-access iterator to the end (3) of the vertex range [0,1,2].
Definition at line 160 of file Triangle.hpp.
|
inline |
Returns a read-only random access iterator to the end (3) of the vertex range [0,1,2].
Definition at line 170 of file Triangle.hpp.
double precice::mesh::Triangle::getArea | ( | ) | const |
Returns the surface area of the triangle.
Definition at line 70 of file Triangle.cpp.
const Eigen::VectorXd precice::mesh::Triangle::getCenter | ( | ) | const |
Returns the barycenter of the triangle.
Definition at line 89 of file Triangle.cpp.
int precice::mesh::Triangle::getDimensions | ( | ) | const |
Returns dimensionalty of space the triangle is embedded in.
Definition at line 84 of file Triangle.cpp.
double precice::mesh::Triangle::getEnclosingRadius | ( | ) | const |
Returns the radius of the circle enclosing the triangle.
Definition at line 94 of file Triangle.cpp.
bool precice::mesh::Triangle::operator!= | ( | const Triangle & | other | ) | const |
Not equal, implemented in terms of equal.
Definition at line 108 of file Triangle.cpp.
|
inline |
Weak ordering based on vertex ids.
Definition at line 130 of file Triangle.hpp.
bool precice::mesh::Triangle::operator== | ( | const Triangle & | other | ) | const |
Compares two Triangles for equality.
Two Triangles are equal if the three edges are equal, whereas the order of edges is NOT important.
Definition at line 102 of file Triangle.cpp.
|
inline |
Returns triangle vertex with index 0, 1 or 2.
Vertex 0 is the first vertex of edge 0. Vertex 1 the second vertex of edge 0. Vertex 2 is either the first or second vertex of edge 1, which is determined on construction of the triangle.
Definition at line 143 of file Triangle.hpp.
|
inline |
Returns const triangle vertex with index 0, 1 or 2.
Vertex 0 is the first vertex of edge 0. Vertex 1 the second vertex of edge 0. Vertex 2 is either the first or second vertex of edge 1, which is determined on construction of the triangle.
Definition at line 149 of file Triangle.hpp.
|
private |
Vertices defining the triangle, sorted by Vertex::getID()
Definition at line 138 of file Triangle.hpp.
|
staticconstexpr |
Amount of vertices.
Definition at line 44 of file Triangle.hpp.