![]() |
v0.16.3 |
#include "src/interfaces/CGALTools.hpp"
Classes | |
| struct | CrackExtensionCandidate |
| struct | CrackExtensionReport |
| struct | CrackExtensionSettings |
| struct | CrackJoinFace |
| struct | ImplicitMeshSettings |
| struct | RemeshReport |
| struct | RemeshSettings |
| struct | Simplex |
Public Types | |
| enum class | ReconstructionMethod { PointDelaunay , ConstrainedStrict } |
Public Member Functions | |
| void | remesh (TetMeshData &result, const TetMeshData &source, const std::vector< int > &selected_cells, const RemeshSettings &settings, RemeshReport &report) const |
| void | createImplicitMesh (TetMeshData &result, const std::function< double(const std::array< double, 3 > &)> &sdf, const ImplicitMeshSettings &settings) const |
| std::vector< int > | reconstructDelaunay (TetMeshData &result, const TetMeshData &vertices, ReconstructionMethod method=ReconstructionMethod::PointDelaunay) const |
| std::vector< int > | validateReconstruction (const TetMeshData &source, TetMeshData &result, const std::vector< std::array< int, 2 > > &protected_edges={}, const std::function< void(const std::string &)> &warning={}) const |
| std::vector< std::uint64_t > | findVertexParents (const std::vector< std::array< double, 3 > > &points, const std::vector< Simplex > &sources) const |
| void | createDelaunay (CGALMesh &mesh, const std::vector< std::array< double, 3 > > &points, const std::vector< std::uint64_t > &identifiers={}) const |
| std::vector< CrackExtensionCandidate > | crackExtensionCandidates (const TetMeshData &patch, const std::vector< int > &crack_faces, std::array< int, 2 > front_edge, std::array< double, 3 > direction, const CrackExtensionSettings &settings, CrackExtensionReport *report=nullptr) const |
| std::vector< CrackExtensionCandidate > | crackClosureCandidates (const TetMeshData &patch, const std::vector< int > &crack_faces, std::array< int, 2 > front_edge, std::array< double, 3 > direction, const CrackExtensionSettings &settings, CrackExtensionReport *report=nullptr) const |
| std::vector< CrackExtensionCandidate > | crackJoiningCandidates (const TetMeshData &patch, const std::vector< int > &crack_faces, std::array< int, 2 > front_edge, std::array< double, 3 > direction, const CrackExtensionSettings &settings, CrackExtensionReport *report=nullptr) const |
| void | applyCrackExtension (TetMeshData &patch, std::vector< int > &crack_faces, const CrackExtensionCandidate &candidate) const |
| std::vector< std::array< int, 3 > > | crackFillFaces (const TetMeshData &patch, const std::vector< int > &crack_faces) const |
| std::vector< CrackJoinFace > | crackJoinFaces (const TetMeshData &patch, const std::vector< int > &crack_faces, const std::vector< std::array< int, 2 > > &front_order={}, const std::function< bool(const std::array< int, 3 > &)> &accept_face={}) const |
Public Attributes | |
| double | surfaceFlipAngle = 1e-6 |
Definition at line 31 of file CGALTools.hpp.
|
strong |
| Enumerator | |
|---|---|
| PointDelaunay | |
| ConstrainedStrict | |
Definition at line 91 of file CGALTools.hpp.
| void MoFEM::CGALTools::applyCrackExtension | ( | TetMeshData & | patch, |
| std::vector< int > & | crack_faces, | ||
| const CrackExtensionCandidate & | candidate | ||
| ) | const |
Apply a candidate returned for this exact patch state. Rejects a candidate whose patch digest differs (stale or foreign), then validates the proposed result before changing anything: created cells fill the removed cavity and are positive after the move, retained cells around a moved node keep their orientation, no face gains a third cell, and the new face and closure faces are interior. Removed cells are erased, created cells appended with labels/partitions of their parents, the free node moved, and the new face and closure faces appended to boundary and crack_faces. Throws MoFEMException without changing patch or crack_faces.
Definition at line 2411 of file CgalCrackExtension.cpp.
| std::vector< CGALTools::CrackExtensionCandidate > MoFEM::CGALTools::crackClosureCandidates | ( | const TetMeshData & | patch, |
| const std::vector< int > & | crack_faces, | ||
| std::array< int, 2 > | front_edge, | ||
| std::array< double, 3 > | direction, | ||
| const CrackExtensionSettings & | settings, | ||
| CrackExtensionReport * | report = nullptr |
||
| ) | const |
Candidates that close a gap at front_edge whose closing face is missing: the free node is a crack node joined to an end of the edge by a front edge and ahead of it, and the face (f0, f1, w) closes that corner. The face exists, one edge removal makes it, or removing the edges that cross it recovers it. Same contract and ranking as crackExtensionCandidates; only class 1 applies.
Definition at line 2384 of file CgalCrackExtension.cpp.
| std::vector< CGALTools::CrackExtensionCandidate > MoFEM::CGALTools::crackExtensionCandidates | ( | const TetMeshData & | patch, |
| const std::vector< int > & | crack_faces, | ||
| std::array< int, 2 > | front_edge, | ||
| std::array< double, 3 > | direction, | ||
| const CrackExtensionSettings & | settings, | ||
| CrackExtensionReport * | report = nullptr |
||
| ) | const |
Candidates for extending the crack by one face at front_edge. patch: cells positively oriented, det(p1-p0, p2-p0, p3-p0) > 0; a non-positive cell in the region is rejected, not flipped, since flipping cannot tell an inverted element from reversed vertex order. boundary holding crack faces and protected faces (body skin, interfaces), optional cellLabels, featureEdges (geometry curves) and fixedVertices. crack_faces index patch.boundary. front_edge (point indices) must be an interior edge of exactly one crack face. direction is the extension direction; its component orthogonal to the edge is used and must point away from that crack face. No point is created, no fixed entity changes and no cell outside settings.ringLimit vertex rings changes. A non-convex front corner at a new edge (its two front edges open away from the crack behind it; a sign test, no threshold) is closed by the face spanning them, existing or created by one forced edge removal; closures repeat at the new edges they create. With lookAheadCandidates > 0, retain a bounded shortlist including alternative ring triangulations, and preview one further extension within the original region. Returns candidates by operation (gap, join, flip-only advance, vertex move), then class, open corners and continuation feasibility. Future closure, join and flip-only advance precede a future move; quality score and free node break remaining ties. Empty means no admissible extension. Throws MoFEMException on invalid input, or on an audit failure.
Definition at line 2372 of file CgalCrackExtension.cpp.
| std::vector< std::array< int, 3 > > MoFEM::CGALTools::crackFillFaces | ( | const TetMeshData & | patch, |
| const std::vector< int > & | crack_faces | ||
| ) | const |
Faces that close notches of the crack front, by the edge-based rule of the fracture module. An interior face that is not protected joins the crack when two of its edges lie on the crack boundary and their common node does not turn the crack back, when all three edges do (or two do and the third is on the body skin), or when one does and another is a feature edge. A face is also rejected if a cell next to it would get two crack faces or three crack or skin faces. Iterated to a fixed point; returns the faces in the order they were added. A face sharing only one crack edge cannot reconnect to the same crack component at its third vertex: that would create a new hole. The patch is not modified.
Definition at line 2590 of file CgalCrackExtension.cpp.
| std::vector< CGALTools::CrackJoinFace > MoFEM::CGALTools::crackJoinFaces | ( | const TetMeshData & | patch, |
| const std::vector< int > & | crack_faces, | ||
| const std::vector< std::array< int, 2 > > & | front_order = {}, |
||
| const std::function< bool(const std::array< int, 3 > &)> & | accept_face = {} |
||
| ) | const |
Faces that join the crack front to the existing crack, without moving any node. A face through a front edge (f0, f1) qualifies when its third node w is a crack node ahead of the edge, or a skin node that ends the crack on the skin or closes a front corner along it; the face exists in the mesh between two cells; it is neither a crack nor a protected face; no edge would get a third crack face; and no cell next to it would then be bounded by crack and skin faces only. Categories are tried in their order; within a category the face best aligned with the edge's extension direction wins. Applied greedily, one face at a time, to a fixed point; returns the faces in the order they were added. A point contact back to the same connected crack component is rejected when only one edge is shared, since it would create a new hole. Joining separate components and filling an existing hole remain allowed. With front_order, consider only listed edges and return one join, prioritising edge order before category/alignment. An optional accept_face predicate further restricts eligible faces before ranking; it never bypasses the topology checks. Its face is ordered (f0, f1, w). The patch is not modified.
Definition at line 2711 of file CgalCrackExtension.cpp.
| std::vector< CGALTools::CrackExtensionCandidate > MoFEM::CGALTools::crackJoiningCandidates | ( | const TetMeshData & | patch, |
| const std::vector< int > & | crack_faces, | ||
| std::array< int, 2 > | front_edge, | ||
| std::array< double, 3 > | direction, | ||
| const CrackExtensionSettings & | settings, | ||
| CrackExtensionReport * | report = nullptr |
||
| ) | const |
Join the front without moving vertices, recovering a missing face by flips. The recovered result must pass the same hole, pocket and edge manifold checks as crackJoinFaces. joinGapsOnly restricts this to a face sharing at least two existing crack edges. Same publication contract as crackExtensionCandidates.
Definition at line 2396 of file CgalCrackExtension.cpp.
| void MoFEM::CGALTools::createDelaunay | ( | CGALMesh & | mesh, |
| const std::vector< std::array< double, 3 > > & | points, | ||
| const std::vector< std::uint64_t > & | identifiers = {} |
||
| ) | const |
Replace mesh with the Delaunay triangulation of points. Identifiers are opaque provenance; zero means an unlinked vertex. An empty identifiers vector assigns zero to every vertex. Nonzero IDs must be unique. Coincident or non-finite points are rejected with MoFEMException, leaving mesh unchanged.
Definition at line 2123 of file CGALTools.cpp.
| void MoFEM::CGALTools::createImplicitMesh | ( | TetMeshData & | result, |
| const std::function< double(const std::array< double, 3 > &)> & | sdf, | ||
| const ImplicitMeshSettings & | settings | ||
| ) | const |
Mesh a closed negative implicit region strictly inside the bounding sphere. Sequential Mesh_3; no optimisation. Throws before replacing the result.
Definition at line 14 of file CgalImplicitMesh.cpp.
| std::vector< std::uint64_t > MoFEM::CGALTools::findVertexParents | ( | const std::vector< std::array< double, 3 > > & | points, |
| const std::vector< Simplex > & | sources | ||
| ) | const |
Return the lowest-dimensional containing source simplex for each point. Sources are nondegenerate segments, triangles or tetrahedra with unique, nonzero identifiers. Exact predicates classify the supplied coordinates. Missing or ambiguous parents throw MoFEMException.
Definition at line 2045 of file CGALTools.cpp.
| std::vector< int > MoFEM::CGALTools::reconstructDelaunay | ( | TetMeshData & | result, |
| const TetMeshData & | vertices, | ||
| ReconstructionMethod | method = ReconstructionMethod::PointDelaunay |
||
| ) | const |
Reconstruct using exactly the given coordinates and IDs. PointDelaunay fills the convex hull; validateReconstruction is separate. ConstrainedStrict (CGAL 6.2) requires source cells, the complete exterior and protected internal boundary facets with positive surfaceLabels. Exactly planar, equally classified simple patches may reconnect; seams and featureEdges stay constrained. Physical volume classification is uniform. Outside cells are removed. If CGAL inserts points, throws before replacing result; there is no permissive fallback. Returns source.boundary parent indices for constrained result.boundary, or empty for point mode. surfaceFlipAngle applies only to point-mode validation.
Definition at line 1664 of file CGALTools.cpp.
| void MoFEM::CGALTools::remesh | ( | TetMeshData & | result, |
| const TetMeshData & | source, | ||
| const std::vector< int > & | selected_cells, | ||
| const RemeshSettings & | settings, | ||
| RemeshReport & | report | ||
| ) | const |
Improve existing connectivity in one conforming triangulation. selected_cells contains source cell indices; empty selects nothing. CGAL 6.2 constrained construction supports non-convex domains and cavities. Unselected cell faces constrain recovery; conforming subdivision may change neighbours. The selection grows around intersecting auxiliary support near invalid source cells. Physical constraints must form a valid PLC. Supplied boundary triangles include internal patches. Feature curves and fixed vertices are respected. New/moved points receive fresh positive IDs. A zero targetEdgeLength runs constraint recovery only: all source vertices keep coordinates and IDs, and only recovery may add Steiner points. No isotropic remeshing or quality-improvement requirement is applied. Geometry-tolerance exceedances warn on the tagged CGALTools channel. Validity, topology and quality failures throw MoFEMException without replacing result/report.
Definition at line 922 of file CGALTools.cpp.
| std::vector< int > MoFEM::CGALTools::validateReconstruction | ( | const TetMeshData & | source, |
| TetMeshData & | result, | ||
| const std::vector< std::array< int, 2 > > & | protected_edges = {}, |
||
| const std::function< void(const std::string &)> & | warning = {} |
||
| ) | const |
Validate surface preservation before importing reconstruction into MOAB. source.boundary contains exterior/protected triangles, grouped by identical classification in source.surfaceLabels. Adjacent facets below surfaceFlipAngle may reconnect, preserving topology, boundary and vertex IDs. Above-threshold edges remain fixed. Nonzero angles permit changes to piecewise-planar geometry, with local normal deviations bounded. Explicit protected edges use source point indices. Returns source.boundary parent indices for result.boundary, which is replaced by the preserved patches. Disconnected reconstructed vertex links and their associated patch defects are logged on CGALTools and reported to the optional warning observer; the available patch is retained for inspection. Throws if constraint recovery is needed; this is not a constrained CDT.
Definition at line 1718 of file CGALTools.cpp.
| double MoFEM::CGALTools::surfaceFlipAngle = 1e-6 |
Maximum accepted surface flip angle in degrees, measured between facet planes (0 is flat, range 0..90). Used by validated reconstruction; point triangulation itself remains unconstrained.
Definition at line 73 of file CGALTools.hpp.