Skip to content

Commit 0f583ab

Browse files
lmoresiclaude
andcommitted
Size the band mask on the mesh the labels are read from
place_fault_ribbon_2d built the per-strand footprint mask from an array sized on the mesh BEFORE add_fault, then filled it from labels read on the mesh after. The two agree whenever the cut adds no cells, which is the usual case with embedded spines, and disagree as soon as it does: the coarse rig with a short junction ligament refused with a broadcast error, 2582 cells against 2562. Underworld development team with AI support from Claude Code Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01RzK7JXSxsc2GoG7TGnQgUS
1 parent 8105169 commit 0f583ab

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

src/underworld3/utilities/place_surface.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8950,7 +8950,11 @@ def place_fault_ribbon_2d(base_mesh, traces, width, *, margin_rings=2,
89508950
# belong to no trace). A band cell belongs to the trace whose USER
89518951
# polyline is nearest, within the band's reach of it and not past
89528952
# its ends by more than half a rung (_footprints_by_user_polyline).
8953-
band = np.zeros_like(band_all)
8953+
# sized on the CURRENT mesh, not on band_all: a cut adds cells where
8954+
# the trace does not already lie on mesh edges, so after add_fault the
8955+
# chart is longer than the one band_all was built for (measured: 2582
8956+
# against 2562 on the coarse rig with a short junction ligament)
8957+
band = np.zeros(int(mesh.dm.getHeightStratum(0)[1]), dtype=bool)
89548958
for k in range(len(spines)):
89558959
band |= mesh.cells_labelled(band_label, band_value + k)
89568960
S_all = np.vstack(extended)

0 commit comments

Comments
 (0)