AXOM
Axom provides a robust, flexible software infrastructure for the development of multi-physics applications and computational tools.
|
A class for incremental generation of a 2D or 3D Delaunay triangulation. More...
#include </home/docs/checkouts/readthedocs.org/user_builds/axom/checkouts/latest/src/axom/quest/Delaunay.hpp>
Public Types | |
using | DataType = double |
using | PointType = primal::Point< DataType, DIM > |
using | ElementType = typename std::conditional< DIM==2, primal::Triangle< DataType, 2 >, primal::Tetrahedron< DataType, 3 > >::type |
using | BaryCoordType = primal::Point< DataType, DIM+1 > |
using | BoundingBox = primal::BoundingBox< DataType, DIM > |
using | IAMeshType = slam::IAMesh< DIM, DIM, PointType > |
using | IndexType = typename IAMeshType::IndexType |
using | IndexArray = typename IAMeshType::IndexArray |
using | IndexPairType = std::pair< IndexType, IndexType > |
Public Member Functions | |
AXOM_STATIC_ASSERT_MSG (DIM==2||DIM==3, "The template parameter DIM can only be 2 or 3. ") | |
Delaunay () | |
Default constructor. More... | |
void | initializeBoundary (const BoundingBox &bb) |
Defines the boundary of the triangulation. More... | |
void | insertPoint (const PointType &new_pt) |
Adds a new point and locally re-triangulates the mesh to ensure that it stays Delaunay. More... | |
template<int TDIM = DIM> | |
std::enable_if< TDIM==2, ElementType >::type | getElement (int element_index) const |
template<int TDIM = DIM> | |
std::enable_if< TDIM==3, ElementType >::type | getElement (int element_index) const |
void | printMesh () |
Prints out mesh details, for debugging purpose. More... | |
void | writeToVTKFile (const std::string &filename) |
Write the m_mesh to a legacy VTK file. More... | |
void | removeBoundary () |
Removes the vertices that defines the boundary of the mesh, and the elements attached to them. More... | |
const IAMeshType * | getMeshData () const |
Get the IA mesh data pointer. More... | |
bool | isValid (bool verboseOutput=false) const |
Checks that the underlying mesh is a valid Delaunay triangulation of the point set. More... | |
IndexType | findContainingElement (const PointType &query_pt, bool warnOnInvalid=true) const |
Find the index of the element that contains the query point, or the element closest to the point. More... | |
BaryCoordType | getBaryCoords (IndexType element_idx, const PointType &q_pt) const |
helper function to retrieve the barycentric coordinate of the query point in the element More... | |
Delaunay< 2 >::BaryCoordType | getBaryCoords (IndexType element_idx, const PointType &query_pt) const |
Delaunay< 3 >::BaryCoordType | getBaryCoords (IndexType element_idx, const PointType &query_pt) const |
Static Public Attributes | |
static constexpr int | VERT_PER_ELEMENT = DIM + 1 |
static constexpr IndexType | INVALID_INDEX = -1 |
A class for incremental generation of a 2D or 3D Delaunay triangulation.
Construct a Delaunay triangulation incrementally by inserting points one by one. A bounding box of the points needs to be defined first via initializeBoundary(...)
using axom::quest::Delaunay< DIM >::DataType = double |
using axom::quest::Delaunay< DIM >::PointType = primal::Point<DataType, DIM> |
using axom::quest::Delaunay< DIM >::ElementType = typename std::conditional<DIM == 2, primal::Triangle<DataType, 2>, primal::Tetrahedron<DataType, 3> >::type |
using axom::quest::Delaunay< DIM >::BaryCoordType = primal::Point<DataType, DIM + 1> |
using axom::quest::Delaunay< DIM >::BoundingBox = primal::BoundingBox<DataType, DIM> |
using axom::quest::Delaunay< DIM >::IAMeshType = slam::IAMesh<DIM, DIM, PointType> |
using axom::quest::Delaunay< DIM >::IndexType = typename IAMeshType::IndexType |
using axom::quest::Delaunay< DIM >::IndexArray = typename IAMeshType::IndexArray |
using axom::quest::Delaunay< DIM >::IndexPairType = std::pair<IndexType, IndexType> |
|
inline |
Default constructor.
axom::quest::Delaunay< DIM >::AXOM_STATIC_ASSERT_MSG | ( | DIM | = =2||DIM==3 , |
"The template parameter DIM can only be 2 or 3. " | |||
) |
|
inline |
Defines the boundary of the triangulation.
subsequent points added to the triangulation must not be outside of this boundary.
|
inline |
Adds a new point and locally re-triangulates the mesh to ensure that it stays Delaunay.
This function will traverse the mesh to find the element that contains this point, creates the Delaunay cavity, which takes out all the elements that contains the point in its sphere, and fill it with a Delaunay ball.
References axom::primal::BoundingBox< T, NDIMS >::contains(), axom::quest::Delaunay< DIM >::findContainingElement(), axom::quest::Delaunay< DIM >::INVALID_INDEX, SLIC_ASSERT_MSG, and SLIC_WARNING.
|
inline |
|
inline |
|
inline |
Prints out mesh details, for debugging purpose.
|
inline |
Write the m_mesh to a legacy VTK file.
filename | The name of the file to write to, |
This function uses mint to write the m_mesh to VTK format.
References axom::mint::UnstructuredMesh< TOPO >::appendCell(), axom::mint::UnstructuredMesh< TOPO >::appendNodes(), axom::mint::TET, axom::mint::TRIANGLE, and axom::mint::write_vtk().
|
inline |
Removes the vertices that defines the boundary of the mesh, and the elements attached to them.
After this function is called, no more points can be added to the m_mesh.
|
inline |
Get the IA mesh data pointer.
|
inline |
Checks that the underlying mesh is a valid Delaunay triangulation of the point set.
A Delaunay triangulation is valid when none of the vertices are inside the circumspheres of any of the elements of the mesh
References axom::primal::BoundingBox< T, NDIMS >::addPoint(), axom::utilities::ceil(), axom::numerics::dot_product(), axom::quest::Delaunay< DIM >::getElement(), axom::primal::ON_NEGATIVE_SIDE, and SLIC_INFO.
|
inline |
Find the index of the element that contains the query point, or the element closest to the point.
References axom::primal::NumericArray< T, SIZE >::argMin(), axom::primal::Point< T, NDIMS >::array(), axom::primal::BoundingBox< T, NDIMS >::contains(), axom::quest::Delaunay< DIM >::getBaryCoords(), axom::quest::Delaunay< DIM >::INVALID_INDEX, SLIC_ASSERT, SLIC_ERROR_IF, and SLIC_WARNING_IF.
BaryCoordType axom::quest::Delaunay< DIM >::getBaryCoords | ( | IndexType | element_idx, |
const PointType & | q_pt | ||
) | const |
helper function to retrieve the barycentric coordinate of the query point in the element
|
inline |
|
inline |
|
staticconstexpr |
|
staticconstexpr |