Class TetTri¶
Defined in File triangulation.hpp
Class Documentation¶
-
class
brille::TetTri¶ Public Types
Public Functions
-
size_t
number_of_vertices(void) const¶
-
size_t
number_of_tetrahedra(void) const¶
-
TetTri(void)¶
-
TetTri(const tetgenio &tgio, const double fraction)¶
-
std::string
to_string(void) const¶
-
size_t
old_locate(const bArray<double> &x, Locate_Type &type, size_t &v0, size_t &v1) const¶ Locate which tetrahedron contains a specified point.
By comparing distances between all tetrehedron vertices and a test point find the vertex closest to the point. Then check all tetrahedra containing the closest vertex to see whether the test point is within or on the surface of the tetrahedron. The second check is performed by constructing four new tetrahedra by replacing each of the source tetrahedron’s vertices by the test point in turn and then comparing their volumes. If all four tetrahedra have positive volumes the test point is inside the source tetrahedron. If any one has negative volume the test point is outside of the source tetrahedron. If one has zero volume the test point lies on one of the faces of the source tetrahedron. If two have zero volume the test point lies on one of the source tetrahedron edges. And if three have zero volume the test point is one of the source tetrahedron’s vertices. This function indicates which type of relationship the test point has to the returned tetrahedron (index) by use of an enumeration. Depending on which relationship is present further information is conveyed by up to two unsigned integers.
- Return
The index of the found tetrahedron
- Parameters
x: A single three-element Array that is the test point[out] type: The relationship between the test point and tetrahedron[out] v0: The first integer conveying relational information[out] v1: The second integer conveying relational information
- Note
When this method becomes a bottleneck (when the number of vertices in the mesh becomes too large) a large performance benefit can be had at the expense of preprocessing and memory use for metadata. As written now the method requires nVertices distance calculations to locate the vertex closest to the supplied point. One way to reduce this is to be able to quickly narrow-down the number of vertices which must be checked by, e.g., dividing the vertices into 3D bins. Bin dimesnions can be chosen to keep a similar number of vertices in each bin. The metadata we need to maintain are the bin boundaries, and either a linked list of the vertices in each bin or (after sorting the vertices) a list of the bin boundaries in the vertices (first vertex in each bin), e.g., [0, first vertex in second bin, first vertex in third bin, …]. Then, to locate a point’s closest vertex, we first find which bin it falls into and then only check its distance to vertices in that bin and its neighbours, 3³ = 27 bins in total. If we choose an 8×8×8 binning we have 512 total bins to keep track of and would only need to check 5.3% of the total vertices; for 16×16×16 we would have 4096 bins and would only need to check 0.66% of all vertices.
-
std::vector<size_t>
neighbours(const size_t vert) const¶
-
double
volume(const size_t tet) const¶
-
TetTri()
-
TetTri(const std::vector<TetTriLayer> &l)¶
-
void
find_connections(const size_t highest = 0)¶
-
std::string
to_string() const
-
ind_t
number_of_tetrahedra() const
-
ind_t
number_of_vertices() const
-
const bArray<double> &
get_vertex_positions() const
-
std::set<size_t>
collect_keys() const¶
-
size_t