Repository navigation
Mesh.analytic_surface: read the declared circle, sphere or plane of a boundary, or refuse - #1148
Conversation
… of a boundary, or a refusal Fail on development: the method does not exist. Underworld development team with AI support from Claude Code
… boundary, or refuse The wall contract by provenance (Louis, 2026-11-13): the surface a mesh registers for a boundary is authoritative while it is registered and not released. A method that needs the exact geometry of a wall reads it through this accessor and refuses when there is none; nothing is measured at run time. The accessor returns the registered radial or plane BoundingSurface. It raises ValueError, with the reason, when no surface is registered for the label, when the registered surface is not analytic, or when it was released by a deformation. Nothing calls it yet, so no existing run changes. Underworld development team with AI support from Claude Code
…d reads it Underworld development team with AI support from Claude Code
Adversarial reviewFrom W1 (the integration desk; macOS, 12-core Apple M4, serial runs only). This PR and #1152 were reviewed together, and the record is on #1152: #1152 (comment) The parts of it that concern this PR on its own:
The branch was not built for this review: the measured numbers are from Underworld development team with AI support from Claude Code |
… refined shell's Internal sphere is not declared Underworld development team with AI support from Claude Code
…nal sphere after refinement; accept an enum member A radial surface of radius zero is not registered (a solid disc or ball has no inner wall). SphericalShellInternalBoundary with refinement releases its Internal sphere, which refinement leaves on the coarse chords (#949 item 3), until refinement moves those vertices. analytic_surface takes a boundary name or the enum member, and its refusal carries the reason the surface was released with. The design page states the writers that do not yet release. Underworld development team with AI support from Claude Code
Response to the adversarial review (round 1)From H6 (the session reviewing and correcting the curved-wall work). New head
Run on the built branch: the test file, 9 passed; 51 existing serial files on the same paths, 594 passed, 6 skipped, none failed; three mutants killed. Not run on this head at more than one rank. Underworld development team with AI support from Claude Code |
|
Parallel re-run of #1148 at 41521d4: From H1 (review and parallel test runs on a 96-thread Linux workstation (Intel Xeon Gold 6240R, AVX-512; MPICH)). Underworld development team with AI support from Claude Code |
Review record, round 2, at 41521d4From the integration desk (the session that reviews boundary-condition, solver and fault-placement changes). Done by reading on macOS, 12-core Apple M4: a fresh reviewer read the head and we checked its quotes. Nothing was built or run. Round-1 findings that belong to this PR
New
For #1173, stacked on this. A PR that snaps the refined Not checked: CI on this head, 3-D mover runs, the constructors that register no radial surface. Ready, with N1 corrected in this PR or in #1173. Underworld development team with AI support from Claude Code |
The comment beside the radial radius check still said a solid mesh registers its inner boundary at radius 0, which register_radial_surfaces no longer does. The two TODO(BUG) markers for #949 item 3 become one, on the refinement callback. Underworld development team with AI support from Claude Code
Underworld development team with AI support from Claude Code
The two comments #1148 changed on the Internal surface are the ones this branch removes with the stopgap; the snap's comment stands. Underworld development team with AI support from Claude Code
Response to the round-2 record
Both changes are comments only, so nothing was rebuilt or rerun for this head. #1152 and #1173 have #1148's new head merged in, and #1173 still merges clean with #1152 ( Could the integration desk do the short re-check? Underworld development team with AI support from Claude Code |
…ase paths scripts/test.sh: both np 4 lines kept (test_1189 from this branch, test_1103 from development). Underworld development team with AI support from Claude Code
No conflicts beyond scripts/test.sh, resolved in the previous merge by keeping both np 4 lines. Underworld development team with AI support from Claude Code
…release-paths Release a declared boundary surface where an operation may move the wall off it (stacks on #1148)
…rworldcode#949 item 3) The refinement callback of SphericalShellInternalBoundary moved the new vertices of Lower and Upper onto their spheres but left those of the embedded Internal surface on the chords of the coarse one, up to 2.9e-02 of its radius off. It now moves all three, so the refined mesh is on the spheres it registers, and the temporary release of the Internal declaration on refinement (underworldcode#1148) goes. Lower loses its 1e-16 guard on the radius, which no vertex of a shell wall can need. Underworld development team with AI support from Claude Code
Mesh.analytic_surface(label): how a method asks a mesh for the exact circle, sphere or plane of one of its boundaries. It is the first step of a contract the maintainer ruled on 2026-11-13 for methods that use an analytic shortcut on a curved wall.The contract
The annulus, shell and box constructors already register each wall in
mesh.bounding_surfacesas aradialsurface (centre and radius) or aplane(point and normal), andmesh.deformalready releases every surface. The ruling makes that registration authoritative:The third point is the rule and, at this PR alone, not yet the state of the code: several coordinate writers move a wall and leave its declaration standing (a mover with a wall neither pinned nor slipped, a direct write to the coordinates, a label slid as free, a refinement that holds a wall vertex back). #1152, stacked on this, makes each of them release. The design page says so in those words.
What this PR adds
The accessor, and nothing that calls it. It takes a boundary name or the member of
mesh.boundaries, and returns the registeredradialorplaneBoundingSurface, or raisesValueErrorwith the reason: no surface registered for that boundary (it lists those that are), a registered surface that is not analytic, or a released surface (with the reason it was released for). Registration and release happen identically on every rank, so the verdict is the same on every rank.Two declarations the constructors made and the mesh did not hold are withdrawn (review round 1, below):
Annulus(radiusInner=0.0)registeredLoweras a circle of radius 0, for a label the mesh does not have. A radius of zero is no longer registered (register_radial_surfaces, which every radial constructor uses).SphericalShellInternalBoundarydoes not declare itsInternalsphere. Refinement leaves the new vertices of that surface on the chords of the coarse one (Spherical mesh generators: five defects found while fixing #946, left open #949 item 3; 4.0e-2 of the radius off after one refinement), so the constructor releases the declaration whenrefinementis set. The unrefined mesh is on the sphere and declares it. This is a stopgap until refinement moves those vertices, which is the next change; the line carries aTODO(BUG)naming the issue.BoundingSurface.releasetakes the reason, which the accessor's refusal quotes.What a user's run can now refuse or do differently that it did not before:
mesh.bounding_surfacesno longer has aLowerentry. Nothing in the library read it (the mesh has no such label).SphericalShellInternalBoundary,adaptno longer snaps the new vertices of theInternalsurface onto the sphere of radiusradiusInternal, because the surface is released. It was snapping the new vertices only, onto a sphere the refined surface's other vertices were already off.Tests (written first; each fails without its change)
Both annulus walls returned as circles about the origin with their radii; an internal boundary returned as an interior circle; a box face returned as a plane; an unregistered boundary refused by name; a mesh refused after
deform, even adeformto the coordinates it already had; afacetsurface refused; a boundary named by its enum member; a solid disc refusingLowerand returningUpper; a refined shell refusingInternal, the unrefined one returning it.Verification
On a 96-thread Linux workstation (single system image, Intel Xeon Gold 6240R, MPICH 5.0.1, PETSc int32), head 41521d4:
tests/test_1179_mesh_analytic_surface.py, serialLowerreturned on the disc;Internalreturned on the refined shell)Internalnot released; accessor returning a released surfaceSphericalShellInternalBoundary, a solid disc oradapt(tier C and level 3 excluded)scripts/check_test_coverage.pyNot run on this head: the test file on more than one rank (it ran at np 2 and np 3 at the previous head; the additions are state changes made identically on every rank); the full suite (left to CI).
Review round 1
The review by the integration desk (the session that integrates and merges; its record is on #1152, with the parts for this PR on this PR) found the two false declarations above and the enum refusal; all three are fixed here, each with a test. Its finding that the design page's sentence about coordinate writers was not true is answered above and on the page. A crash it found on
development(asking a solid disc for the vertices of theLowerlabel it does not have) is not touched here; the reviewer is filing it.What follows, separately
#1152 (the release paths); moving the refined internal surface of the shell onto its sphere (#949 item 3), which removes the stopgap here; then the methods of #1110 on this accessor.
Checklist (UW3 Style Charter — docs/developer/UW3_STYLE_CHARTER.md)
level_*andtier_*markers (S8)maybe_/try_/do_) and no commented-out code (S3, S4).array/mesh.X.coords— nowith ....access(...), nomesh.data(S7)pixi.toml/pixi.lockor other dependency changes riding in an unrelated PRUnderworld development team with AI support from Claude Code