|
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/feature-kweiss-improve-python-sidre/src/axom/quest/Delaunay.hpp>

Classes | |
| struct | CircumsphereEval |
| Precomputed circumsphere center and squared radius for in-sphere tests. More... | |
| struct | InsertionStats |
| Statistics about point insertion operations (cavity size during Bowyer-Watson insertion) More... | |
| struct | OrientationEval |
| Orientation determinant evaluation with tolerance for robust geometric tests. More... | |
| struct | PointLocationResult |
| Combined result from point location including element index and status. More... | |
| struct | PointLocationStats |
| Statistics about point location query performance. More... | |
Public Types | |
| enum class | InsertionValidationMode { None , Local , ConformingMesh , Full } |
| Controls the level of validation performed during point insertion. More... | |
| enum class | PointLocationStatus { Found , Outside , Failed } |
| Result status from point location queries. More... | |
| using | DataType = double |
| using | PointType = primal::Point< DataType, DIM > |
| using | VectorType = primal::Vector< 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... | |
| Delaunay (const Delaunay &)=delete | |
| Delaunay & | operator= (const Delaunay &)=delete |
| Delaunay (Delaunay &&other) | |
| Delaunay & | operator= (Delaunay &&other) |
| InsertionStats | getInsertionStats () const |
| Returns statistics about insertion operations. More... | |
| void | setCollectPointLocationStats (bool enabled) |
| Enable or disable collection of point location statistics. More... | |
| PointLocationStats | getPointLocationStats () const |
| Returns statistics about point location query performance. More... | |
| void | setInsertionValidationMode (InsertionValidationMode mode) |
| Controls the amount of validation performed around each point insertion. More... | |
| InsertionValidationMode | getInsertionValidationMode () const |
| Returns the current insertion validation mode. More... | |
| void | initializeBoundary (const BoundingBox &bb) |
| Defines the boundary of the triangulation. More... | |
| void | reserveForPointCount (IndexType num_points) |
| Reserve storage for an expected number of inserted points. More... | |
| void | insertPoint (const PointType &new_pt) |
| Adds a new point and locally re-triangulates the mesh to ensure it remains Delaunay. More... | |
| ElementType | getElement (int element_index) const |
| Retrieves the geometric element (triangle or tetrahedron) at the given index. More... | |
| void | printMesh () |
| Prints out mesh details, for debugging purpose. More... | |
| void | writeToVTKFile (const std::string &filename) |
| Write the mesh to a legacy VTK file for visualization. More... | |
| void | removeBoundary () |
| Removes the bounding box vertices and all attached elements. More... | |
| const IAMeshType * | getMeshData () const |
| Get the underlying IA mesh data structure. More... | |
| bool | isValid (bool verboseOutput=false) const |
| Checks that the mesh satisfies the Delaunay empty-circumsphere property. More... | |
| bool | isConforming (bool verboseOutput=false) const |
| Checks mesh conformity, orientation, and boundary consistency. More... | |
| bool | isSearchableElement (IndexType element_idx) const |
| Returns true if an element is active and can participate in point-location queries. More... | |
| IndexType | findContainingElement (const PointType &query_pt, bool warnOnInvalid=true) const |
| Locate the element containing a query point using directed walk. More... | |
| BaryCoordType | getBaryCoords (IndexType element_idx, const PointType &q_pt) const |
| Compute barycentric coordinates of a query point within an element. More... | |
| IndexArray | getSeedElements (IndexType element_idx, const BaryCoordType &bary_coord) const |
| Returns initial seed elements for cavity expansion based on point location. More... | |
| OrientationEval | evaluateElementOrientationDeterminant (IndexType element_idx) const |
| Computes the signed orientation determinant of an element together with its scale-aware tolerance and classification. More... | |
Static Public Member Functions | |
| static int | signWithTolerance (double value, double tolerance) |
| Classify a value as positive, negative, or zero within tolerance. More... | |
| static CircumsphereEval | evaluateCircumsphereOnMesh (const IAMeshType &mesh, IndexType element_idx) |
| Builds the circumsphere (center and squared radius) of a mesh element. More... | |
| static double | sphereSquaredDistanceTolerance (const CircumsphereEval &sphere, const PointType &x, double distance_sq) |
| Scale-aware tolerance for comparing a squared distance against a circumsphere's squared radius, used to classify on-sphere cases robustly. More... | |
| static int | inSphereOrientationOnMesh (const IAMeshType &mesh, const PointType &q, IndexType element_idx) |
| Classifies the query point against an element's circumsphere via the in-sphere determinant: ON_POSITIVE_SIDE (outside), ON_NEGATIVE_SIDE (inside), or ON_BOUNDARY (on the sphere, within tolerance). More... | |
| static double | inSphereDeterminantOnMesh (const IAMeshType &mesh, const PointType &q, IndexType element_idx) |
| Returns the raw (unclassified) in-sphere determinant of q against the circumsphere of element_idx. The sign indicates inside/outside. The caller applies its own tolerance (see inSphereOrientationOnMesh()). More... | |
| static const char * | orientationResultName (int result) |
| Returns a human-readable name for a primal::OrientationResult value (for diagnostics and warning messages). More... | |
| static bool | isPointInSphereOnMesh (const IAMeshType &mesh, const PointType &q, IndexType element_idx, bool includeBoundary) |
| Convenience predicate: true if q is inside element element_idx's circumsphere (and, when includeBoundary is set, on it within tolerance). More... | |
| static int | classifyOrientationDeterminant (double det, double tol) |
| Classifies an orientation determinant against a tolerance into a primal::OrientationResult (ON_POSITIVE_SIDE/ON_BOUNDARY/ON_NEGATIVE_SIDE). More... | |
Static Public Attributes | |
| static constexpr double | BARY_EPS = 1e-12 |
| static constexpr int | VERT_PER_ELEMENT = DIM + 1 |
| static constexpr int | VERTS_PER_FACET = VERT_PER_ELEMENT - 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. The public API lives in this header while the larger insertion, point-location, and validation routines are split into companion detail/ headers.
A bounding box of the points needs to be defined first via initializeBoundary(...). The algorithm uses the Bowyer-Watson incremental insertion approach with robust geometric predicates for handling degenerate cases including regular grids and co-spherical point configurations.
| DIM | The spatial dimension (2 for triangulation, 3 for tetrahedralization) |
| using axom::quest::Delaunay< DIM >::DataType = double |
| using axom::quest::Delaunay< DIM >::PointType = primal::Point<DataType, DIM> |
| using axom::quest::Delaunay< DIM >::VectorType = primal::Vector<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> |
|
strong |
Controls the level of validation performed during point insertion.
|
strong |
|
inline |
Default constructor.
|
delete |
|
inline |
| axom::quest::Delaunay< DIM >::AXOM_STATIC_ASSERT_MSG | ( | DIM | = =2||DIM==3, |
| "The template parameter DIM can only be 2 or 3. " | |||
| ) |
|
delete |
| Delaunay& axom::quest::Delaunay< DIM >::operator= | ( | Delaunay< DIM > && | other | ) |
|
inline |
Returns statistics about insertion operations.
|
inline |
Enable or disable collection of point location statistics.
| enabled | If true, track walk performance metrics (adds minimal overhead) |
|
inline |
Returns statistics about point location query performance.
|
inline |
Controls the amount of validation performed around each point insertion.
InsertionValidationMode::Full is a diagnostic mode and should not be enabled in performance-sensitive runs.
|
inline |
Returns the current insertion validation mode.
| void axom::quest::Delaunay< DIM >::initializeBoundary | ( | const BoundingBox & | bb | ) |
Defines the boundary of the triangulation.
Subsequent points added to the triangulation must lie within this boundary. Creates an initial bounding box triangulation (2 triangles in 2D, 6 tetrahedra in 3D).
| bb | The bounding box that will contain all inserted points |
|
inline |
Reserve storage for an expected number of inserted points.
Uses a dimension-specific heuristic for the total simplex count so large bulk-builds can avoid repeated mesh-container reallocations.
| num_points | Expected number of points to be inserted |
References axom::utilities::ceil().
| void axom::quest::Delaunay< DIM >::insertPoint | ( | const PointType & | new_pt | ) |
Adds a new point and locally re-triangulates the mesh to ensure it remains Delaunay.
Uses the Bowyer-Watson incremental insertion algorithm:
| new_pt | The point to insert |
|
inline |
Retrieves the geometric element (triangle or tetrahedron) at the given index.
| element_index | The index of the element to retrieve |
|
inline |
Prints out mesh details, for debugging purpose.
| void axom::quest::Delaunay< DIM >::writeToVTKFile | ( | const std::string & | filename | ) |
Write the mesh to a legacy VTK file for visualization.
| filename | The name of the file to write to |
| void axom::quest::Delaunay< DIM >::removeBoundary | ( | ) |
Removes the bounding box vertices and all attached elements.
The initial bounding box (created by initializeBoundary) consists of 2^DIM vertices that define a rectangular boundary. This method removes those vertices and all simplices incident to them, leaving only the Delaunay triangulation of the inserted points.
|
inline |
Get the underlying IA mesh data structure.
| bool axom::quest::Delaunay< DIM >::isValid | ( | bool | verboseOutput = false | ) | const |
Checks that the mesh satisfies the Delaunay empty-circumsphere property.
A Delaunay triangulation is valid when no vertex lies strictly inside the circumsphere of any simplex. This method checks all vertex-simplex pairs.
| verboseOutput | If true, prints detailed diagnostic information |
| bool axom::quest::Delaunay< DIM >::isConforming | ( | bool | verboseOutput = false | ) | const |
Checks mesh conformity, orientation, and boundary consistency.
Verifies three properties:
| verboseOutput | If true, prints detailed diagnostic information |
| bool axom::quest::Delaunay< DIM >::isSearchableElement | ( | IndexType | element_idx | ) | const |
Returns true if an element is active and can participate in point-location queries.
| element_idx | The element index to check |
| IndexType axom::quest::Delaunay< DIM >::findContainingElement | ( | const PointType & | query_pt, |
| bool | warnOnInvalid = true |
||
| ) | const |
Locate the element containing a query point using directed walk.
| query_pt | The point to locate |
| warnOnInvalid | If true, log a warning if location fails |
| BaryCoordType axom::quest::Delaunay< DIM >::getBaryCoords | ( | IndexType | element_idx, |
| const PointType & | q_pt | ||
| ) | const |
Compute barycentric coordinates of a query point within an element.
| element_idx | The element containing (or near) the query point |
| q_pt | The query point |
|
inline |
Returns initial seed elements for cavity expansion based on point location.
If the query point lies on a face/edge of the containing element (indicated by a barycentric coordinate near zero), the neighbor across that face is also included as a seed. This ensures the cavity expansion starts from all elements that might contain the point in their circumsphere.
| element_idx | The element containing (or nearest to) the query point |
| bary_coord | Barycentric coordinates of the query point in that element |
References axom::utilities::abs(), axom::quest::Delaunay< DIM >::BARY_EPS, SLIC_ASSERT, and axom::quest::Delaunay< DIM >::VERT_PER_ELEMENT.
|
inlinestatic |
Classify a value as positive, negative, or zero within tolerance.
| value | The value to classify |
| tolerance | The tolerance for considering the value as zero |
|
static |
Builds the circumsphere (center and squared radius) of a mesh element.
| mesh | The triangulation containing the element |
| element_idx | The element whose circumsphere is computed |
|
static |
Scale-aware tolerance for comparing a squared distance against a circumsphere's squared radius, used to classify on-sphere cases robustly.
| sphere | The circumsphere being tested against |
| x | The query point |
| distance_sq | The squared distance from x to the sphere center |
|
static |
Classifies the query point against an element's circumsphere via the in-sphere determinant: ON_POSITIVE_SIDE (outside), ON_NEGATIVE_SIDE (inside), or ON_BOUNDARY (on the sphere, within tolerance).
| mesh | The triangulation containing the element |
| q | The query point |
| element_idx | The element whose circumsphere is tested |
|
static |
Returns the raw (unclassified) in-sphere determinant of q against the circumsphere of element_idx. The sign indicates inside/outside. The caller applies its own tolerance (see inSphereOrientationOnMesh()).
| mesh | The triangulation containing the element |
| q | The query point |
| element_idx | The element whose circumsphere is tested |
|
static |
Returns a human-readable name for a primal::OrientationResult value (for diagnostics and warning messages).
| result | An orientation result code (ON_POSITIVE_SIDE/ON_BOUNDARY/ON_NEGATIVE_SIDE) |
|
static |
Convenience predicate: true if q is inside element element_idx's circumsphere (and, when includeBoundary is set, on it within tolerance).
| mesh | The triangulation containing the element |
| q | The query point |
| element_idx | The element whose circumsphere is tested |
| includeBoundary | If true, on-sphere points count as contained |
|
static |
Classifies an orientation determinant against a tolerance into a primal::OrientationResult (ON_POSITIVE_SIDE/ON_BOUNDARY/ON_NEGATIVE_SIDE).
| det | The raw orientation determinant |
| tol | The scale-aware tolerance for the ON_BOUNDARY band |
| OrientationEval axom::quest::Delaunay< DIM >::evaluateElementOrientationDeterminant | ( | IndexType | element_idx | ) | const |
Computes the signed orientation determinant of an element together with its scale-aware tolerance and classification.
| element_idx | The element to evaluate |
|
staticconstexpr |
Tolerance for barycentric coordinate comparisons (distinguishes interior from boundary) Value chosen to handle typical floating-point error accumulation in coordinate computation
|
staticconstexpr |
|
staticconstexpr |
|
staticconstexpr |