forked from 1b-agent/fieldcraft-upstream
Tet mesh quality: one validity criterion, Delaunay refinement, ODT, Klingner–Shewchuk, tet10
The end-to-end demo met a raw-CDT sliver that the validity gate accepted (exactly positive) and the solver refused. Now: - One validity criterion, `fieldcraft_model::admissible_jacobian` (normalized Jacobian above 1e-12), used by the implicit solver (fem `positive_inverse`), the explicit tet4/hex8 kinematics and the mesh gate, which proves it on the whole element (tet4: the solvers' own Jacobian; curved kinds: a Bernstein floor), so whatever passes the gate passes the solvers. - CDT rounding repaired by flips on the rounded mesh (Diazzi et al. 2023 §5.1) instead of the ±2-ulp nudge. - `fieldcraft-mesh::tet`: a mutable tetrahedral complex whose every change is a checked replacement (positive and admissible tetrahedra, faces matched with opposite orientation) with an exact undo log; edge removal (Klincsek), multi-face removal, Delaunay insertion with boundary faces, edge collapse; a curvature- and thickness-graded size field; constrained Delaunay refinement with encroachment splits; ODT smoothing; the Klingner–Shewchuk schedule; boundary vertices moved onto the exact B-rep surfaces at the end; tet10 with mid-edge nodes on the geometry. - `mesh.tet.generate` gains size, order, quality, quality_target, curvature_angle, grading, max_passes, max_points and reports the CDT's and the mesh's quality; `solve.probe` takes a set and reports its largest von Mises stress. - Oracle cases filleted-bracket-fillet-stress(-coarse): the fillet's peak von Mises stress on tet10 meshes of 2k and 13.5k elements, 213.3 MPa (a four-level study stays within 1.8%); the CDT cases keep the raw tetrahedralization. - Corpus quality columns: all 20 valid parts mesh and pass the gate. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01NmAttHhUZTokgPeEJia8sm
This commit is contained in:
1 parent
fed27d816d
commit
9469ac0853
53 files changed
+5880
-278
No files matched your search
+11
-4
@@ -65,9 +65,13 @@ Rules beyond the layer order:
|
||||
perturbation for degeneracies), boundary recovery by the robust constrained Delaunay method of
|
||||
Diazzi et al. 2023 (implicit Steiner points on indirect predicates, gift-wrapping facet
|
||||
recovery; `fieldcraft-mesh::cdt`, command `mesh.tet.generate`), so every boundary triangle and
|
||||
its B-rep face tag survives. Then constrained Delaunay refinement to a
|
||||
size field, ODT smoothing interleaved as in Tournois et al. 2009, and the Klingner–Shewchuk 2007
|
||||
improvement schedule against slivers.
|
||||
its B-rep face tag survives; rounding is repaired by flips (§5.1). Then the quality stage
|
||||
(`fieldcraft-mesh::tet`): a curvature-graded size field, edge-collapse coarsening, constrained
|
||||
Delaunay refinement with boundary points projected onto the B-rep faces and curves (exact
|
||||
surfaces from SolidCraft where analytic, the tessellation otherwise), ODT smoothing
|
||||
interleaved as in Tournois et al. 2009, the Klingner–Shewchuk 2007 improvement schedule
|
||||
against slivers, and tet10 with mid-edge nodes on the geometry. Every step is a checked local
|
||||
replacement, so the mesh stays valid throughout.
|
||||
4. **Hexahedral meshing (the core).** Grid-based all-hex first, the one family that meshes any
|
||||
input validly. `fieldcraft-mesh::octree` (command `mesh.hex.octree`): a 27-tree over the part,
|
||||
refined by curvature, thickness and narrow faces, balanced and cut by the 3-refinement
|
||||
@@ -107,7 +111,10 @@ Rules beyond the layer order:
|
||||
faces, edges and vertices become geometry tags that sets select. It meshes the analytic
|
||||
shapes of the verification cases.
|
||||
6. **Quality.** Scaled Jacobian, aspect ratio, dihedral angles; every generated mesh is checked
|
||||
for positive Jacobians and conserved volume before it reaches the model.
|
||||
for valid Jacobians and conserved volume before it reaches the model. Validity is one
|
||||
criterion shared with both solvers (`fieldcraft_model::admissible_jacobian`: normalized
|
||||
Jacobian above 1e-12): the gate proves it on the whole element, the solvers check it at their
|
||||
integration points, so a mesh the gate accepts is never refused by a solver.
|
||||
|
||||
## Model definition
|
||||
|
||||
|
||||
+1
-1
@@ -28,7 +28,7 @@ the control channel and AI agents over MCP (docs/mcp.md) run the same commands.
|
||||
| Size | Global Size — One element size for the whole part | coming soon (M2) | |
|
||||
| Size | Seed Edges — Element counts, sizes and bias per edge and face | coming soon (M2) | |
|
||||
| Size | Curvature — Refine by curvature and proximity | coming soon (M2) | |
|
||||
| Tet | Tet Mesh — Constrained Delaunay tet mesh of a body: every boundary triangle kept, faces tagged (refinement comes next) | ready | `mesh.tet.generate` |
|
||||
| Tet | Tet Mesh — Quality tet4 or tet10 mesh of a body to a size: refined, smoothed and improved, boundary on the B-rep faces, faces tagged | ready | `mesh.tet.generate` |
|
||||
| Tet | Quadratic — Second-order elements with mid-side nodes on the geometry | coming soon (M2) | |
|
||||
| Tet | Delaunay Points — Delaunay tetrahedralization of a point list (debugging aid) | ready | `mesh.delaunay.points` |
|
||||
| 2D | 2D Mesh — Quad or triangle mesh of a planar face or polygon in the XY plane for plane stress, plane strain and axisymmetric models; edges tagged | ready | `mesh.planar` |
|
||||
|
||||
@@ -250,9 +250,12 @@ Delaunay methods with Voronoi/ODT improvement, then (2) all-hex and hex-dominant
|
||||
- Reference points (§3.3) are searched among the tetrahedra whose boxes meet the missing subsegment's box (they
|
||||
contain the tetrahedra the subsegment crosses); on the corpus this picks the same point as searching the whole
|
||||
diametral ball.
|
||||
- Rounding (§5.1): a Steiner point whose rounding leaves an incident tetrahedron non-positive tries the doubles
|
||||
within two ulps per coordinate, nearest first; the flip-based improvement of §5.1 is not implemented. All 20
|
||||
valid corpus parts pass the validity gate after rounding.
|
||||
- Rounding (§5.1): the flips of §5.1 run on the rounded coordinates (`cdt::repair`), decided by exact `orient3d` on
|
||||
the doubles: every tetrahedron that rounding (or nearly cospherical input) leaves flat, inverted or below
|
||||
FieldCraft's validity criterion is targeted by edge removal and multi-face removal that never touch a segment, and
|
||||
a flat tetrahedron lying on one input triangle is deleted. What survives (a flat tetrahedron spanning two nearly
|
||||
coplanar input triangles: 1–65 per part on 7 corpus parts) is counted by the gate and removed by the quality stage,
|
||||
whose boundary is the B-rep faces rather than the input triangles.
|
||||
|
||||
**A2.4 Diazzi and Attene 2021, convex polyhedral meshing.** **Verdict: reference.**
|
||||
- **Citation.** L. Diazzi, M. Attene. *Convex polyhedral meshing for robust solid modeling.* ACM TOG 40(6):259, 2021.
|
||||
@@ -319,6 +322,16 @@ Delaunay methods with Voronoi/ODT improvement, then (2) all-hex and hex-dominant
|
||||
- **Complexity.** Medium, on top of A2.3.
|
||||
- **Code.** None read.
|
||||
|
||||
- **Implemented** in `fieldcraft-mesh::tet::refine`: circumcentres of tetrahedra whose radius–edge ratio exceeds B = 2
|
||||
(when their circumradius is at least half the local size) or whose circumradius exceeds 0.75 of the local size; a
|
||||
circumcentre outside the domain or inside a boundary face's diametral sphere splits that face instead (at its
|
||||
circumcentre when inside it, else at its longest edge's midpoint, a feature edge split when that edge is one), every
|
||||
boundary point projected onto its B-rep face or curve. Small input angles are handled by bounds rather than Si's
|
||||
theory: faces below half the local size are not split, no vertex closer than 0.05 of the size to another, a
|
||||
tetrahedron whose point could not go in is not retried, caps on insertions and tetrahedra. Before refinement, edge
|
||||
collapse coarsens the boundary recovery's dense Steiner points (X. Li, M. S. Shephard, M. W. Beall, *3D anisotropic
|
||||
mesh adaptation by mesh modification*, CMAME 194(48–49):4915–4950, 2005).
|
||||
|
||||
**A3.2 Cheng, Dey, Shewchuk, *Delaunay Mesh Generation* (CRC, 2012).** **Verdict: reference (the textbook).**
|
||||
- **Links.** DOI [10.1201/b12987](https://doi.org/10.1201/b12987).
|
||||
- **Use.** The consolidated treatment of 3D refinement, small-angle handling and sliver theory. Buy it.
|
||||
@@ -356,6 +369,12 @@ Delaunay methods with Voronoi/ODT improvement, then (2) all-hex and hex-dominant
|
||||
- **Complexity.** Moderate.
|
||||
- **Code.** CGAL is GPL: FORBIDDEN. This paper is the readable source of the scheme.
|
||||
|
||||
- **Implemented** in `fieldcraft-mesh::tet::smooth` as the density-weighted ODT update (Chen–Xu, Alliez et al.; weight
|
||||
`h⁻³`), interleaved with refinement in three rounds as in A3.5; boundary vertices move in their face's tangent plane
|
||||
and are projected back onto the B-rep face, curve vertices move along their curve, corners stay. A move is kept when
|
||||
every tetrahedron stays positive and its star's worst quality stays above min(old worst, sin 17.5°). Tetrahedra whose
|
||||
circumcentre is further than their longest edge from their centroid contribute their centroid instead.
|
||||
|
||||
**A3.6 Klingner and Shewchuk 2007, Aggressive Tetrahedral Mesh Improvement.** **Verdict: BUILD ON (final sliver-removal stage).**
|
||||
- **Citation.** B. M. Klingner, J. R. Shewchuk. IMR 16, 3–23, 2007.
|
||||
- **Links.** DOI [10.1007/978-3-540-75103-8_1](https://doi.org/10.1007/978-3-540-75103-8_1).
|
||||
@@ -376,6 +395,16 @@ Delaunay methods with Voronoi/ODT improvement, then (2) all-hex and hex-dominant
|
||||
- **Complexity.** Moderate: edge removal requires Shewchuk's dynamic programming over the edge ring.
|
||||
PDF: https://people.eecs.berkeley.edu/~jrs/papers/edge.pdf, not separately verified.
|
||||
- **Code.** The Stellar code's licence was not verified, so it is not read.
|
||||
- **Implemented** in `fieldcraft-mesh::tet::{ops, improve}` from the two papers: Klincsek's dynamic programming for edge
|
||||
removal (interior edges; boundary edges of one flat B-rep face end in a 2-2 flip), multi-face removal grown greedily
|
||||
over the sandwiched faces, nonsmooth optimization smoothing (active set, smallest vector of the convex hull of the
|
||||
active gradients, line search; gradients by central differences), and the composite vertex insertion with rollback
|
||||
(barycentres of boundary faces, of the tetrahedron, midpoints of boundary edges, and a point inside off a flat
|
||||
boundary edge). Deviations: the inserted vertex takes the Delaunay cavity rather than the optimal cut of §3.4; each pass
|
||||
smooths and flips the tetrahedra below sin 40° and inserts only when the worst did not improve; passes and the
|
||||
insertion list are capped. Objective: the minimum dihedral sine. Every operation is a checked replacement of a region
|
||||
(positive by exact `orient3d`, faces matched with opposite orientation, removed vertices fully inside), so the mesh is
|
||||
valid after each step.
|
||||
|
||||
**A3.7 Cheng, Dey, Edelsbrunner, Facello, Teng 2000, Sliver exudation.** **Verdict: reference.**
|
||||
- **Citation.** J. ACM 47(5):883–904, 2000. DOI [10.1145/355483.355487](https://doi.org/10.1145/355483.355487).
|
||||
|
||||
+7
-1
@@ -2,7 +2,7 @@
|
||||
|
||||
Generated by `cargo xtask oracle` from [`tests/oracle/`](../tests/oracle/); the policy is [verification.md](verification.md). Every case is our own model, built with FieldCraft commands from the problem's published description, and compared with the reference value its `expected.json` cites, within the stated tolerance and for the stated reason. Accepted results are frozen in each case's `fixture.json`: a later change that moves one beyond its band (10⁻⁹ of its size) fails CI even while the reference still passes. No reference value was produced with a commercial product.
|
||||
|
||||
**170 of 176 quantities pass** (6 known failure(s)) in 50 active cases: 41 theory, 9 published benchmark, 0 experiment; 9 pending cases wait for capabilities still being built.
|
||||
**174 of 180 quantities pass** (6 known failure(s)) in 52 active cases: 43 theory, 9 published benchmark, 0 experiment; 9 pending cases wait for capabilities still being built.
|
||||
|
||||
## Theory: closed-form solutions, patch tests and mesh invariants
|
||||
|
||||
@@ -28,6 +28,10 @@ Generated by `cargo xtask oracle` from [`tests/oracle/`](../tests/oracle/); the
|
||||
| [cdt-stepped-block](../tests/oracle/cdt-stepped-block/) | volume of the tetrahedra | 47000 | 47000 | < 1e-7% | 1e-12 rel. | pass | matches |
|
||||
| [cdt-stepped-block](../tests/oracle/cdt-stepped-block/) | elements that fail the certified Jacobian check | 0 | 0 | ≈ 0 | exact | pass | matches |
|
||||
| [cdt-stepped-block](../tests/oracle/cdt-stepped-block/) | elements the Jacobian check could not decide | 0 | 0 | ≈ 0 | exact | pass | matches |
|
||||
| [filleted-bracket-fillet-stress](../tests/oracle/filleted-bracket-fillet-stress/) | largest nodal von Mises stress on the fillet face (MPa) | 213 | 213.31 | 0.144% | 3% | pass | matches |
|
||||
| [filleted-bracket-fillet-stress](../tests/oracle/filleted-bracket-fillet-stress/) | total reaction x (N) | -2000 | -2000 | < 1e-7% | 1e-9 rel. | pass | matches |
|
||||
| [filleted-bracket-fillet-stress-coarse](../tests/oracle/filleted-bracket-fillet-stress-coarse/) | largest nodal von Mises stress on the fillet face (MPa) | 213 | 213.31 | 0.144% | 3% | pass | matches |
|
||||
| [filleted-bracket-fillet-stress-coarse](../tests/oracle/filleted-bracket-fillet-stress-coarse/) | total reaction x (N) | -2000 | -2000 | < 1e-7% | 1e-9 rel. | pass | matches |
|
||||
| [free-beam-frequencies](../tests/oracle/free-beam-frequencies/) | sixth frequency (the last rigid-body mode) | 0 | ≈ 0 | ≈ 0 | ± 8.1264e-5 | pass | matches |
|
||||
| [free-beam-frequencies](../tests/oracle/free-beam-frequencies/) | first free–free bending frequency (mode 7) | 0.081264 | 0.080618 | -0.795% | 1.5% | pass | matches |
|
||||
| [free-beam-frequencies](../tests/oracle/free-beam-frequencies/) | total mass | 20 | 20 | < 1e-7% | 1e-12 rel. | pass | matches |
|
||||
@@ -200,6 +204,8 @@ Generated by `cargo xtask oracle` from [`tests/oracle/`](../tests/oracle/); the
|
||||
- **[cantilever-tet10](../tests/oracle/cantilever-tet10/)** (theory): Cantilever under a tip load, Timoshenko deflection (tet10). Source: Timoshenko and Gere, Mechanics of Materials (beam with shear deformation: δ = PL³/3EI + PL/κGA, κ = 5/6 for a rectangle); Cowper, J. Appl. Mech. 33 (1966) 335–340 for the shear coefficient. Tolerances — tip_uz: beam theory vs 3D elasticity (a few tenths of a percent at L/h = 10); quadratic tetrahedra are converged on this mesh; reaction: equilibrium holds to rounding
|
||||
- **[cdt-cylinder](../tests/oracle/cdt-cylinder/)** (theory): Constrained Delaunay mesh of a cylinder: volume within the chordal bound, valid elements. Source: mesh invariants: an inscribed polygon of sagitta s loses at most 2s/R of a circle's area (elementary geometry); constrained Delaunay tetrahedralization after Diazzi et al., ACM TOG 42(6) 2023. Tolerances — volume: the tessellation inscribes the cylinder within the chordal tolerance s = 0.05: the polygon section loses between 0 and 2s/R = 0.5% of the area; the reference is the middle of that band; invalid: every element of a valid mesh has positive volume
|
||||
- **[cdt-stepped-block](../tests/oracle/cdt-stepped-block/)** (theory): Constrained Delaunay mesh of a stepped block: exact volume, valid elements. Source: mesh invariants: a tetrahedralization of a polyhedron fills its volume exactly (Si, TetGen paper ACM TOMS 41(2) 2015 for the definition of a CDT; Diazzi et al., ACM TOG 42(6) 2023); the volume is 60·40·10 + 40·40·10 + 20·40·10 − 10·10·10. Tolerances — volume: a planar boundary is tessellated exactly and the constrained Delaunay mesh fills it exactly: only rounding; invalid: every element of a valid mesh has positive volume; undetermined: a linear tetrahedron's sign is exact
|
||||
- **[filleted-bracket-fillet-stress](../tests/oracle/filleted-bracket-fillet-stress/)** (theory): Filleted L-bracket under a side load: the peak von Mises stress on the R6 fillet, fine tet10 mesh. Source: mesh convergence of the finite element solution (P. J. Roache, Verification and Validation in Computational Science and Engineering, Hermosa, 1998, ch. 5): the bracket has no closed-form stress; the reference is the mesh-independent peak of a four-level study of quadratic tetrahedral meshes refined by √2 in size and in curvature resolution (README.md); equilibrium. Tolerances — fillet_peak: the four-level study gives 213.3, 210.6, 214.3, 213.3 MPa (2k to 13.5k elements): the bending stress is converged across the fillet, and the peak nodal value moves only with which of the fillet's tessellation lines (fixed angles, through every level) carries the largest node, by under 2%; reaction: equilibrium holds to rounding
|
||||
- **[filleted-bracket-fillet-stress-coarse](../tests/oracle/filleted-bracket-fillet-stress-coarse/)** (theory): Filleted L-bracket under a side load: the peak von Mises stress on the R6 fillet, coarse tet10 mesh. Source: mesh convergence of the finite element solution (P. J. Roache, Verification and Validation in Computational Science and Engineering, Hermosa, 1998, ch. 5): the bracket has no closed-form stress; the reference is the mesh-independent peak of a four-level study of quadratic tetrahedral meshes refined by √2 in size and in curvature resolution (README.md); equilibrium. Tolerances — fillet_peak: the four-level study gives 213.3, 210.6, 214.3, 213.3 MPa (2k to 13.5k elements): the bending stress is converged across the fillet, and the peak nodal value moves only with which of the fillet's tessellation lines (fixed angles, through every level) carries the largest node, by under 2%; reaction: equilibrium holds to rounding
|
||||
- **[free-beam-frequencies](../tests/oracle/free-beam-frequencies/)** (theory): Natural frequencies of a free beam: rigid-body modes and the first bending mode. Source: Euler–Bernoulli free–free beam, β₁L = 4.7300; Timoshenko, Young and Weaver, Vibration Problems in Engineering, 4th ed., Wiley 1974, §5.3. Tolerances — rigid_6: a free body has six zero frequencies; numerical rigid-body frequencies below 10⁻³ of the first elastic one (eigenvalues below 10⁻⁶ of it) are rounding of the shifted solve; f7: Euler–Bernoulli neglects shear and rotary inertia, about 0.8% at L/h = 20 for the free–free mode; mass: the mass matrix integrates the density exactly
|
||||
- **[j2-bauschinger](../tests/oracle/j2-bauschinger/)** (theory): Bauschinger effect of linear kinematic hardening: tension, then back to zero strain. Source: J2 plasticity with Prager's linear kinematic hardening in uniaxial stress (W. Prager, Ing.-Arch. 1955; Simo and Hughes, Computational Inelasticity, Springer 1998, §2.3): from σ_a = σ_y + E_t (ε_a − σ_y/E) the material unloads elastically by 2σ_y and then hardens with E_t, so at zero strain σ = σ_a − 2σ_y − E_t (ε_a − 2σ_y/E). Tolerances — residual_stress: a homogeneous small-strain state the element represents exactly, with increments that end at the load path's turn; isotropic hardening would give −281.835 (it yields again only at −σ_a); plastic_strain: (σ_a − σ_y)/H forward plus E/(E + H) (ε_a − 2σ_y/E) in reverse
|
||||
- **[j2-heated-bar](../tests/oracle/j2-heated-bar/)** (theory): A steel bar held at its ends and heated past yield (small strain). Source: Uniaxial J2 plasticity with linear hardening (Simo and Hughes, Computational Inelasticity, Springer 1998, §2.3) with the additive thermal strain: the bar's total axial strain is held at zero, so its mechanical strain is −α ΔT and σ = −(σ_y + E_t (α ΔT − σ_y/E)) once α ΔT exceeds σ_y/E. Tolerances — sigma: a homogeneous uniaxial state the elements represent exactly; plastic_strain: (\|σ\| − σ_y)/H, as for the stress
|
||||
|
||||
Reference in new issue
Block a user