Repository navigation
Probe-pass batch: SurfaceCollection in 2-D (#540), complete chains for close lines (#494), cuts spare internal boundaries (#595), #429's test - #1126
Merged
Conversation
#540. SurfaceCollection in 2-D: Surface.face_normals and face_centers are per polyline segment (pyvista has no cell normals for lines); transfer_normals makes a mesh.cdim-component variable and takes each point's nearest SURFACE by exact distance, then that surface's nearest face (the nearest face centre over all surfaces gave a point near one trace's end the other trace's normal); compute_distance_field uses each surface's own exact distance (pyvista wants 3-D points). #494. cut_along_lines skipped any edge with an endpoint on ANY line, so a line's crossing of an edge touching another line within an edge of it was never split: gaps in the chain, silently (3 per chain at 0.7 h, 1 at 0.9 h). "Already on a line" is now per line. #595. A vertex on a labelled internal boundary (a stratum holding facets only, not on the domain boundary: a placed band's skin) is never snapped onto the cut; its crossing is split instead, and the cut warns how many were spared. 2 to 19 of a 0.02 band's 38 skin vertices used to move. add_fault passes snap_frac, snap_quality and snap_dist to the 2-D cut when given; without them the cut is unchanged (test_1176's fixture: 841 vertices, same coordinates as development). #429. test_custom_mg_rbf_drives_solver now asserts the nested-FMG solution and a competitive iteration count, and a direct test checks that rbf_prolongation is sparse and linear-exact with duplicated coarse points. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Underworld development team with AI support from Claude Code
This was referenced Nov 13, 2026
Cutting a thin labelled band along its centre-line can snap a band-boundary vertex onto the cut
#595
Open
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The probe-pass batch for one desk: four small fixes, each with a test shown failing on development (01dec8d), in one PR. Review: H1 (review and parallel test runs on a 96-thread Linux workstation).
Fixes #540, #494 and #595, and the test half of #429.
#540: SurfaceCollection works in 2-D
In 2-D a
Surfaceis a polyline, and the collection's nearest-surface director failed in three places.Surface.face_normalsraised KeyError, because pyvista has no cell normals for lines.face_normalsandface_centersare now defined per polyline segment: the normal is the tangent turned a quarter turn, with z = 0.transfer_normalsmade a 3-component variable, which a 2-D mesh refuses; it now hasmesh.cdimcomponents. It also takes each point's nearest surface by exact distance, then that surface's nearest face. Taking the nearest face centre over all surfaces at once gave a point near one trace's end the other trace's normal.compute_distance_fieldhanded 2-D points to pyvista; it now uses each surface's own exact distance (the polyline routine in 2-D, pyvista's implicit distance in 3-D as before).Test:
tests/test_0540_surface_collection_2d.pyhas two traces whose normals differ, and an analytic oracle for the normals and the distance. On development all 3 tests fail; on this branch they pass.#494: two lines cut within an edge of each other keep complete chains
cut_along_linesskipped every edge with an endpoint on any line. So where two lines ran within an edge of each other, line B's crossing of an edge touching line A was never split, and B's chain had gaps, silently. "Already on a line" is now per line, and a vertex on both lines (a junction) counts for both.Test:
tests/test_0494_two_lines_complete_chains.py. Two lines 0.7 h and 0.9 h apart, in one call and in two sequential calls, must each give a complete chain. On development the one-call cases fail (3 gaps per chain at 0.7 h, 1 at 0.9 h); the sequential cases pass there and stay as guards.#595: a cut does not snap a vertex of a labelled internal boundary
Cutting along the centre of a placed thin band, the cut could snap a vertex of the band's skin onto the line and pinch the band shut, with nothing refused. On a 0.02-wide band, 2 to 19 of its 38 skin vertices moved, depending on where the cut fell.
Such a vertex now keeps its place, its crossing is split instead, and the cut warns how many were spared. An internal boundary here is a label stratum holding facets only, not on the domain boundary. A label that holds cells on any rank is a region and is ignored, which is how gmsh's
Elementslabel is left alone; the verdict is agreed over the ranks, and the protected set is reduced over the ranks sharing each vertex.add_faultnow passessnap_frac,snap_qualityandsnap_distto the 2-D cut, only when given. A call without them makes the same cut as before: test_1176's fixture has 841 vertices with the same coordinates as on development.Test:
tests/test_0595_cut_spares_internal_boundaries.py. It checks:add_faultwith no snap options matches the defaults written out;All 3 fail on development.
#429: the RBF multigrid test tests the builder
test_custom_mg_rbf_drives_solverasserted only that the solve converged. It now also asserts:A new test checks that
rbf_prolongationis sparse and linear-exact, with duplicated and nearly duplicated coarse points. The builder was already fixed, so these pass on development. The direct test fails for a builder that is exact only for constants; I checked that with an overlaid mutant.Regressions
test_0850(surfaces and faults) passes;test_1015passes.ptest_0844_reconnect_parallel::test_adapt_with_repair_runs_in_parallelfails, and it fails identically on development; it is not this PR.Checklist
level_1/tier_bmarkers (S8)Underworld development team with AI support from Claude Code