Key source files:
crack_visibility.py,
crack_criterion.py,
static_crack_propagator.py,
crack_propagator.py,
crack.py
(all under GM_modules/Meshfree/src/solver/).
Assembly hook: mlpg/assembler.py — assemble_stiffness_voronoi().
Entry points:
solve_with_static_crack_path() (default),
solve_with_crack_propagation() (legacy).
CrackSettings.mode):
mode="static_path" (default) — Linear Static Crack Path solver.
Voronoi-edge-breaking algorithm with adaptive load scaling.
Described in Sections 4–6.mode="polyline" (legacy) — Iterative polyline crack propagation
(Belytschko visibility + MTS direction criterion).
Described in Sections 7–9.In meshfree methods the absence of a fixed mesh is a natural advantage for fracture mechanics: no remeshing is required as damage grows. Instead, the crack is treated as an internal boundary that modifies the visibility between nodes — nodes that are separated by the crack contribute zero (or reduced) stiffness to one another.
GearMaster implements two algorithms under a common CrackSettings configuration object.
Both rely on the same constitutive assumptions:
Both fracture modes exploit the Delaunay triangulation of the node set, which is the combinatorial dual of the Voronoi tessellation used by MLPG5. Two nodes I and J share a Voronoi integration edge precisely when (I, J) is a Delaunay edge. Removing this edge from the stiffness integral disconnects the two nodes in the structural sense.
BrokenEdgeConnectivity New
The class BrokenEdgeConnectivity (file: crack_visibility.py)
stores a set of explicitly broken Delaunay edge pairs and exposes the same
assembler interface as VoronoiCrackConnectivity:
break_edge(i, j) — irreversibly marks edge (i,j) as broken.voronoi_edge_is_cut(i, j) — returns True when the edge is broken.filter_support(node_idx, support) — geometric line-of-sight filter from
nodes[node_idx]: any support node whose direct connecting segment crosses a
broken Voronoi ridge is excluded. Delegates to _visible_from_origin().filter_support_from_point(origin_xy, support) — same geometric ray-cast
from an arbitrary 2-D point (used by crack-aware Gauss-point strain recovery in
compute_nodal_strain()).segment_crosses_crack(p_a, p_b) — returns True if the
straight segment p_a→p_b crosses any broken Voronoi ridge. Used during strain
recovery to discard Gauss-point samples on the far side of the crack from the node
being recovered.evaluate_edge_criterion(field, mode) — returns a dict mapping each
intact Delaunay edge to its criterion value: max(C_i, C_j) or
mean(C_i, C_j) (mode="mean" default).All visibility queries use a geometric crossing test rather than BFS graph traversal. For each query segment (origin→target), the test checks whether any broken Voronoi ridge segment intersects it via a 2-D segment-vs-segment cross-product criterion (proper intersection only, endpoints excluded).
The broken-ridge geometry is maintained by _ensure_broken_ridge_cache(),
keyed on len(self._broken) (monotonically non-decreasing — breaking is
irreversible). The cache stores:
_brc_p0, _brc_p1 — (B,2) endpoint arrays of all broken ridges._brc_mid — (B,2) ridge midpoints; indexed by a scipy.spatial.cKDTree._brc_max_half — maximum ridge half-length (used as search radius padding).
For each visibility query, cKDTree.query_ball_point(origin, d_max + max_half)
pre-selects only the ridges geometrically reachable by the query segment, keeping the
per-call cost bounded independently of the total broken-edge count B.
The actual crossing test is then fully vectorised over the filtered ridge set by
the module-level function
_segments_cross_any(origin, targets, rp0, rp1) (NumPy broadcasting,
no Python loop).
The Voronoi assembler (assemble_stiffness_voronoi()) accepts either a
VoronoiCrackConnectivity or a BrokenEdgeConnectivity object
via the crack_visibility parameter. Both are injected into
solver_settings["_crack_visibility"] before each solve call:
setup.solver_settings["_crack_visibility"] = broken_edge_connectivity
Inside the assembly loop two checks are applied:
voronoi_edge_is_cut(I, J), the entire Voronoi
integration segment between I and J is skipped._tree.query(segment_midpoints, k=2)), not by an O(N) linear scan over
all nodes. This reduces the assembly cost from O(N²) per step to
O(N log N + S) where S is the number of segments per node.filter_support(I, supp)
removes support nodes not visible from node I across the crack (geometric ray-cast,
see Section 2.2).
Implemented in crack_criterion.py. The same criterion fields are available
for both fracture modes:
| Key | Field | Typical use |
|---|---|---|
"sed" |
Averaged Strain Energy Density (ASED), Lazzarin-Berto with control radius R0 | Weld joints, notches (default) |
"von_mises" |
Von Mises equivalent stress σVM [MPa] | General initiation |
"max_principal" |
Maximum principal stress σ1 [MPa] | Brittle fracture, Mode-I dominated |
Under the small-scale yielding hypothesis, the linear elastic field around the dominant stress concentration (weld toe, notch) predicts where the fracture process zone will first open. When one Voronoi edge is broken, the stiffness topology changes and the load redistributes; the process repeats until either the nominal loads are safely below the threshold or the iteration cap is reached.
The load-scaling step follows the same logic as the proportional load factor in limit-analysis and cohesive-zone progressive damage models (Camacho & Ortiz 1996; Jirasek & Bazant 2002):
Because the system is linear, u(λF) = λu(F), so no extra solve
is needed to obtain the scaled field. The factor λ is a
post-processing quantity that records the structural utilisation at each
propagation step.
The scalar criterion is defined at the nodes, but the fracture driving force
acts at the Voronoi cell boundary shared by two adjacent nodes. Three
aggregation strategies are available, selected via
CrackSettings.edge_criterion_mode:
| Mode | Formula | Status | When to use |
|---|---|---|---|
"mean" (default) |
Cedge = (Ci + Cj) / 2 | ✅ Implemented | Balanced estimate; appropriate when the field gradient across the edge is moderate. The edge fails when the average of the two flanking nodes exceeds the threshold. |
"max" |
Cedge = max(Ci, Cj) | ✅ Implemented | Conservative upper bound — Camacho & Ortiz (1996)
cohesive-zone traction criterion. The edge fails as soon as
either flanking node exceeds the threshold. Produces
a slightly wider / earlier crack path than
"mean". |
"gauss_edge" |
Cedge = (1/L) ∫edge C(x) dℓ ≈ Σg wg C(xg) | 🚧 Not yet implemented | Physically most accurate: evaluates the criterion via MLS
shape functions at Gauss points distributed along the Voronoi
ridge segment, then computes a length-weighted average.
Requires a standalone probe-point MLS evaluator
(evaluate_at_point(), Phase 3).
Selecting this mode currently raises
NotImplementedError. |
evaluate_at_point(x, solver_context) in
mlpg_solver.py — returns displacement, strain and stress
at any 2-D point via MLS evaluation.BrokenEdgeConnectivity.evaluate_edge_criterion_gauss():
for each intact ridge segment place Ng = 3 Gauss points,
evaluate the criterion at each, and return the length-weighted average.StaticCrackPathSolver when
edge_criterion_mode == "gauss_edge".| Condition | Reason string |
|---|---|
| All edge criteria below threshold | "nominal loads safe" |
| λ ≥ 0.999 (edge failed at ~full load) | "reached nominal load level" |
| No intact Delaunay edges remain | "no intact Delaunay edges remain" |
| Locked front has no forward candidate (connected growth) | "crack front cannot advance without enclosing material" |
max_iterations reached | "max iterations reached" |
Before this Phase-2 addition, strain and stress recovery
(compute_nodal_strain() in results_strain_recovery.py)
used the full nodal support regardless of the crack state, causing the MLS gradient
fit to compute derivatives across the crack.
The symptom was a spurious, growing stress at crack-isolated nodes: as the crack opens
wider over successive iterations, the apparent displacement gradient across the gap
increases, producing a fictitious stress field at damaged nodes.
The fix propagates the crack_visibility object into
compute_nodal_strain(crack_visibility=...) and applies two filters:
filter_support_from_point(x_g, candidates)
before MLS shape functions are evaluated.
If fewer than min_supp (3 for linear basis, 6 for quadratic) nodes
remain visible, the Gauss point is skipped entirely.
segment_crosses_crack(nodes[i], x_g) returns True
is discarded from the patch of node i.
If the remaining visible support is smaller than min_supp,
the node is considered crack-isolated and its strain is forced to zero
(strain[i] = 0).
crack_visibility=None (no crack active),
the function follows the identical code path as before — the results are
byte-for-byte identical to the pre-Phase-2 implementation.
As crack propagation advances, one or more nodes may become fully isolated:
all their Voronoi-Delaunay neighbours have been cut by broken edges, so every row and
column of K corresponding to those nodes is identically zero after assembly.
A stiffness matrix with zero rows is exactly singular; the linear solve fails with
MatrixRankWarning.
GearMaster handles this in two layers:
|K[k,k]| < 10−14 max|diag(K)|.
Adds 10−8 max|diag(K)| to K[k,k]. Sufficient for
nearly-degenerate DOFs (off-diagonal entries are still nonzero).
u[k] = 0
and is physically correct because a fully isolated node receives no load transfer
and its displacement is arbitrary in the LEFM sense.
The solver emits a WARNING log entry identifying the pinned node indices
whenever dead-DOF pinning is applied, visible in the Solver Log tab.
Dead-DOF pinning makes the linear solve robust, but the propagator still needs to know
which nodes were pinned so that it does not treat their (numerically arbitrary)
recovered stress as a real driving force. After pinning, MLPGSolver.solve()
collects the unique node indices of all pinned DOFs and publishes them in the solver
context:
The static crack propagator reads this list right after building the criterion field
(step 2b of the algorithm in Section 4.3) and forces
C[isolated_nodes] = 0. This prevents an isolated node — whose poorly
conditioned solve can yield a large spurious stress — from dominating
C_max, collapsing the load scale λ, and producing a false
“hot spot” or a back-propagating crack. When no node is isolated the list is
empty and the criterion field is untouched.
With connected_growth=True (the default) the crack is required to grow as a
single, geometrically contiguous front rather than nucleating new branches anywhere the
criterion happens to peak. Earlier revisions enforced contiguity only on a
per-iteration basis: at every step they re-selected the instantaneously strongest
crack-tip vertex. Because the very first (seed) edge has two free ends, the
selection flip-flopped between them across iterations, producing two diverging branches
— the “double crack” and the apparent backward growth observed in
practice.
The current implementation keeps a persistent active front:
forward_edges_by_tip(C) — which groups the forward-advancing intact
edges by their crack-tip vertex (a Voronoi vertex touched by exactly one broken
ridge) — and locks active_tip onto the tip whose best edge
has the highest criterion. The lock is set once and never re-evaluated.
active_tip are considered
candidates. If that tip can no longer advance (it is enclosed by already-broken or
boundary ridges), edge_crits is empty and the crack arrests with
reason "crack front cannot advance without enclosing material" — it
does not jump to the other seed end.
ridge_vertices_of(i*, j*) returns the two Voronoi endpoints of the broken
ridge, and active_tip is set to whichever endpoint is not the old
active tip (a negative index means the boundary was reached and the front terminates).
Helper (BrokenEdgeConnectivity) | Returns |
|---|---|
forward_edges_by_tip(C) | {tip_vertex: {edge_key: ahead_criterion}} — only intact edges with exactly one fresh (non-crack) endpoint that advance the front away from the tip. |
forward_candidate_edges(C, single_front=True) | Convenience wrapper: the edge dict of the single strongest tip (True) or the union over all tips (False). |
ridge_vertices_of(i, j) | The two Voronoi-vertex indices of broken ridge (i,j), or None if the pair is not a Delaunay edge. |
crack_front_tip_vertices() | Voronoi vertices lying on exactly one broken ridge (the free ends of the crack). |
After the solver finishes, the SolverEditor automatically adds
the Linear Static Crack Path result item in the Results tree.
Visual encoding:
Stats tree: the solution tree shows:
CrackSettings| Parameter | Type | Default | Description |
|---|---|---|---|
mode | str | "static_path" | "static_path": Linear Static Crack Path (this section). "polyline": legacy iterative polyline propagation (Section 7). |
criterion | str | "sed" | Criterion field: "sed", "von_mises", "max_principal" |
threshold | float | required | Criterion value above which an edge is considered critical [MPa or same units as criterion] |
r0_mm | float | 0.28 | ASED control radius [mm] — used only when criterion="sed" |
max_iterations | int | 50 | Maximum number of edge-breaking iterations |
connected_growth | bool | True | Enforce a single, contiguous, persistent crack front (Section 4.7). When False the worst global edge breaks each step (multi-site nucleation). |
crack_model | str | "visibility" | "visibility": embedded crack via support filtering (Level A, current). "duplication": geometric free-surface model (Level B, reserved — not yet implemented). |
visibility_method | str | "binary" | "binary": hard line-of-sight cut. "diffraction": smooth stiffness reduction around the tip (Organ et al. 1996). |
diffraction_lambda | float | 2.0 | Diffraction exponent — used only when visibility_method="diffraction". Higher values sharpen the transition near the tip. |
da_factor | float | 1.5 | (Legacy, ignored by static_path mode) Step-length multiplier |
constrain_to_existing_nodes | bool | True | (Legacy, ignored by static_path mode) Snap tip to nearest node |
min_crack_length | float | ∞ | (Legacy, ignored by static_path mode) Minimum crack length [mm] |
The crack_model setting (Solver editor → Crack model drop-down)
selects how the broken edges modify the discrete problem. Two strategies are
foreseen; only the first is implemented today.
| Model | Mechanism | Status |
|---|---|---|
| Visibility ( "visibility") |
The crack is embedded: nodes separated by a broken ridge simply stop seeing each other, so their mutual stiffness is removed (support filtering, Sections 2–4). The node set and the Voronoi cells are unchanged. | Default — Level A (active) |
| Duplication ( "duplication") |
The crack becomes a true geometric free surface: nodes on the crack are duplicated into independent upper/lower copies with their own DOFs, and the Voronoi test cells are re-clipped against the crack line. Each flank then carries its own displacement field exactly like a pre-slit CAD body. | Reserved — Level B (disabled in the GUI, not yet implemented) |
domain_polygon + remesh. The crack
is cut into the domain boundary and the point cloud is regenerated, giving a fully
conforming free surface. Conceptual; no GUI exposure yet.
The original crack propagation algorithm (Phase 1) represents the crack as an immutable
ordered polyline Crack2D and grows it step by step using a geometry-based
visibility criterion.
Crack2D
The class is immutable: extend(da, θ) returns a new instance.
Segment intersection uses a cross-product test with endpoint-touch exclusion.
VoronoiCrackConnectivity
Cut edges are detected by testing each Delaunay edge (I,J) against all crack segments
(crack.intersects_segment(x_I, x_J)). BFS on the residual graph computes
the N×N reachability matrix. See Belytschko et al. (1994).
CrackPropagator)| Condition | Reason string |
|---|---|
| Criterion below threshold at step 0 | "no initiation" |
| Criterion below threshold at step k > 0 | "crack arrested" |
| Tip outside domain bounding box | "crack tip exited domain boundary" |
Crack length ≥ min_crack_length | "target length reached" |
max_iterations reached | "maximum iterations reached" |
| Property | Static Crack Path (static_path) |
Polyline Propagation (polyline) |
|---|---|---|
| Crack representation | Set of broken Voronoi edges (graph topology) | Ordered polyline Crack2D |
| Direction criterion | Implicit (follows stiffest path via Delaunay topology) | Explicit MTS direction θ* per step |
| Load scaling | Yes — λ = threshold / C_max per step | No — full nominal load at every step |
| Mesh dependency | Path follows Delaunay edges (mesh-dependent, reproducible) | Path tip can land anywhere (snapped to nearest node) |
| Physical basis | Cohesive-zone progressive damage (Camacho & Ortiz 1996) | LEFM propagation direction (Erdogan & Sih 1963) |
| Post-processing result | Linear Static Crack Path (red broken edges) | Criterion Field, polyline overlay, tip marker |
| Recommended for | Fatigue path estimation, weld toes, notches | Fracture mechanics research, strong Mode I |