Skip to content

Add physical curved-wall Stokes corrections and spherical pressure lifting - #1033

Open
gthyagi wants to merge 82 commits into
underworldcode:developmentfrom
gthyagi:feature/cylindrical-wall-boundaries_sph
Open

gthyagi wants to merge 82 commits into
underworldcode:developmentfrom
gthyagi:feature/cylindrical-wall-boundaries_sph

Conversation

@gthyagi

@gthyagi gthyagi commented Nov 10, 2026 •

Copy link
Copy Markdown
Contributor

Add opt-in physical curved-wall Stokes formulations and prescribed-pressure lifting for cylindrical and spherical P2/P1 benchmarks. The coupled methods integrate the physical domain rather than relying only on chordal walls, and keep pressure, reaction and rotation gauges explicit.

Implementations

  • Coupled free-slip and zero-slip walls: inner physical cut cells, outer gap/cap and curtain terms, mapped surface multipliers, and separately reported normal/tangential reactions.
  • Prescribed interface pressure splitting (p = q + p_J), fitted tetrahedral extraction, true-sphere sheet loads and pressure-lift adapters with shared replacement/reset lifetimes.
  • Topological fitted-region labels; active physical norm assembly and identity completion only for unsupported DOFs. Distributed preallocation and local coordinate projection avoid replicated global index/interpolation workspaces.
  • Operator-verified left/right pressure gauges, balanced pressure-response preconditioning, solver-local inner options, and fresh finalized original-equation residual checks.
  • Native spherical norms/stress/reactions, scoped read-only observers, runtime provenance, Kramer reference fields and analytical gravity kernels. Numerical gravity/topography integration is outside scope.
  • Shared Stokes state/observation/layout helpers with geometry/algebra machinery behind public solver APIs; documentation and CI coverage for the new modules.

Upstream integration and validation

Merged upstream development through abe5e0ca, including multigrid lifecycle and mesh-move field-refresh fixes. Earlier merge conflicts preserve upstream convergence, vector/adjoint, multigrid and failure-reporting contracts. Local development-only toolchain commits are excluded.

Integration repairs preserve coordinate embedding/degree metadata, verify rotation kernels on both sides of the constrained operator, retain original pressure equations, and select one global LU pressure datum. Scalar FMG now reaches its requested transfer builder rather than falling back on missing coordinate metadata. Rotated test fixtures supply exact analytic-normal kernels; null actions are checked against rounding bounds. Whole-domain transport profiles use owner-aware evaluation, with an independent exact-P2 regression. Original physical references and model tolerances are unchanged.

Regular Linux/arm64 PETSc 3.25.4 int32 package:

  • 33 serial adjoint/scalar/SUPG checks pass.
  • 25 per MPI2 rank coordinate/pressure-gauge checks pass.
  • Upstream lifecycle/move regressions: 14 serial, seven per MPI2 rank pass.
  • Final installed head: 10 serial passes and eight passes plus one existing XPASS per MPI2 rank, covering all 11 failures from the preceding CI run.
  • Deprecated-pattern checks and all 316 Python examples/27 notebooks pass.

One incremental native rebuild includes upstream Cython lifecycle changes; subsequent test-only edits reuse byte-identical native objects. Exactly one Mac build/task container is retained. Full GitHub CI passed at 1b740463: all six test shards and the aggregate test, style gates, and architectural review. Verified test run. Earlier long surface transport and 192-step Maxwell-tide results retain their actual source revisions and are not represented as fresh reruns.

Adversarial review: root causes, validation and limits. Review documents follow the CI schema; fork tokens skip comment-only steps without disabling validation or increasing permissions.

Limits

Coupled methods remain opt-in: uniform mixed/multiplier inf-sup stability is unproven, and automatic transcript/adjoint integration for the experimental gap APIs is not claimed. Earlier 336 benchmark records retain their original source pins and were not rerun for this merge. Fresh Gadi/PETSc int64 validation is pending; old int64 evidence is not claimed for this head. Required GitHub CI and maintainer review remain merge conditions.

Underworld development team with AI support from Codex

Port only the Stokes pressure-lifting entry point, bounded circular-cut source helper and mathematical tests. No wall transfer, traction recovery, gravity or analytical-module changes. Base is local development 7222caf, matching the standalone baseline. Native rebuild and serial/MPI validation pending before campaign acceptance.

Underworld development team with AI support from Claude Code
Record natural-datum handling for free-slip and zero-slip walls in the boundary capability guide. Numerical source unchanged; build validation follows.

Underworld development team with AI support from Claude Code
Underworld development team with AI support from Claude Code
Underworld development team with AI support from Claude Code
Underworld development team with AI support from Claude Code
…to interface stars

Serial mathematical and manufactured PDE checks passed before this field-lifetime hardening. Validate the rebuilt package in serial and MPI before publishing.

Underworld development team with AI support from Claude Code
The matched Linux ARM64 int32 build passes all 14 pressure-extraction tests at 1, 2 and 8 MPI ranks. Manufactured fitted-square Stokes tests recover third-order velocity and second-order pressure from h=1/8 through 1/32; essential and natural boundary exactness tests, numerical jump data, finite tips, intersecting interfaces and tetrahedral lift traces pass. Runtime source remains 55ea3ff; this commit changes documentation only. Ready for review as an explicitly selected prescribed-jump API.

Underworld development team with AI support from Claude Code
Document the fixed field-lifetime collision, collective failure checks, native mathematical and manufactured PDE probes at 1/2/8 ranks, CI reach and open pressure/solver issues not claimed fixed. Remove a trailing blank line from the circular test; no runtime source or test logic changes. Component validation remains tied to runtime 55ea3ff.

Underworld development team with AI support from Claude Code
Map opt-in velocity/pressure KSP types and the outer iteration allowance into the private rotated prefix. Include overrides in workspace reuse decisions and publish effective settings; existing defaults are unchanged without overrides.

Add hydrostatic exactness and cached-option regression coverage. The old runtime reproduced the ignored-limit failure (300 instead of 500); clean container rebuild and serial/MPI validation follow before publishing this milestone.

Underworld development team with AI support from Claude Code
Check PREONLY by its one-application contract and exercise cache reuse with changed hydrostatic forcing. Add the focused option tests to the parallel test runner and clarify that nested-Schur accuracy requirements differ from explicit block applications.

Validation: 8 focused serial tests passed. On 8 MPI ranks all 4 new option tests and the dedicated box control passed; the annulus partition check passed before its platform-specific absolute anchor skipped. The serial-oriented annulus local-rotation assertion also fails on the old runtime under MPI8 and is retained as a pre-existing validation limitation. Native numerical source is unchanged from the rebuilt 1dbeafb runtime. Next: standalone driver checks and Gadi installation gate.

Underworld development team with AI support from Claude Code
…base

Add lagged rotated free-slip and full-vector zero-slip circle conditions without topography or gravity APIs. Accept symbolic circular lifts and cell-side DG P1 prescribed lifts, preserve parent rotated KSP overrides, and schedule FE datum evaluation collectively on empty ranks.

Validation: Python compilation, diff whitespace and test coverage reach pass. Native container build, mathematical controls and serial/MPI solver tests remain pending; this local snapshot pins the build input.

Underworld development team with AI support from Claude Code
…ial and MPI

Add coupled generalized-jump hydrostatic balance, use a linear solve with nonzero absolute tolerance for exact quiescent controls, and compare symbolic field identities rather than weak-reference proxy identities.

Validation: 49 focused tests pass serially; the 48-test regression suite and all nine final wall tests pass on eight MPI ranks. Twelve Kramer checks at h=1/16 cover four cases, serial before/after corrections and corrected MPI8. Velocity errors improve by 6.8–17.8x; pressure errors decrease; serial/MPI error metrics agree within 4e-17. Native/Python origins, PETSc int32 and parallel HDF5 verified on all eight ranks. Numerical runtime is unchanged from 908079a; this commit changes tests only. Next step: requested broader refinement/report campaigns.

Underworld development team with AI support from Claude Code
…ries

Retain actual KSP types and iteration limits per update so campaign provenance survives a final zero-increment warm start. No PDE, boundary transfer or solver settings change. Static compilation and whitespace checks pass; the pending Gadi build gates the complete 49-test suite serially and on 16 MPI ranks before the requested 108 models.

Underworld development team with AI support from Claude Code
Add an affine-simplex coordinate regression reproducing PETSc error 63 on development 7222caf at 16 MPI ranks. Evaluate the coordinate identity through the source geometry in the target dual space, preserving local-section ordering and halo nodes. Native rebuild and focused serial/MPI validation are pending.

Underworld development team with AI support from Claude Code
The coordinate projection regression passes all 16 ranks after 7dfb793. The broader existing coordinate-layout suite also covers ranks with no local cells, where _cell_node_indices previously returned shape (0,) instead of (0, nodes_per_cell). Preserve the documented two-dimensional shape for those ranks. Serial 42-test baseline passed; full focused MPI validation follows this correction.

Underworld development team with AI support from Claude Code
Core coordinate projection and empty-rank layout regressions pass all 42 checks in serial and on every MPI16 rank on Mac and Gadi. Bring only this development-based core fix into the pressure-jump source branch. Annulus models remain paused; this branch needs a matching rebuild before resumed execution.

Underworld development team with AI support from Claude Code
Retain the pressure-jump parent relationship and include the same validated coordinate-identity projection and empty-rank node-map correction. All 42 core checks passed serial and MPI16 on Mac and Gadi. The 108-model wall campaign remains paused at 90 successes; a matching feature runtime rebuild is required before models resume.

Underworld development team with AI support from Claude Code
The full wall feature gate exposed last-bit differences between shared copies after local identity projection. A new exact-continuity regression fails on fef4f5b at MPI16 with differences of 1.11e-16. Restore owner-to-halo synchronization using vectors, retaining local projection and avoiding the defective global interpolation matrix. Rebuild and coordinate/wall regression validation follow.

Underworld development team with AI support from Claude Code
Restore single-valued shared coordinate rows after local projection; new exact-continuity regression fails before synchronization at MPI16. Matching runtime rebuild and full gate follow before any annulus replacements run.

Underworld development team with AI support from Claude Code
Retain local coordinate projection while distributing owner values to all halo copies, needed for exact circular-wall node identity. The new source will be rebuilt and gated before resubmitting failed dependency jobs.

Underworld development team with AI support from Claude Code
Promote the signed-domain P2/P1/P2 prototype to a solver-owned collective PETSc path. Use owned-cell assembly, circle multiplier traces including interior basis rows, paired pressure/reaction and rotation gauges, and distributed field scatters. Reuse UW3 force fields and explicit cap-force extensions. Document Gap-SBM, weak-slip and boundary-multiplier sources and the annulus-specific adaptation.

Validation status: independent prototype passed 27 component tests and three serial refinement pilots; new analytical API regression demonstrated absent on the baseline installation; exact cap area and empty-rank kernels pass. Matching rebuilt-runtime serial/MPI gates are pending and must pass before accepting this integration.

Underworld development team with AI support from Claude Code
The first rebuilt-runtime regression exposed NumPy searchsorted returning int64 while the supported PETSc build uses int32. Convert global multiplier indices explicitly at the PETSc boundary. Add independent cap-area and empty-partition controls. Native and MPI integration gates remain pending.

Underworld development team with AI support from Claude Code
A direct failing regression confirms PETSc Mat.setValues interprets transposed rectangular arrays in row order without honoring their NumPy strides. Supply C-contiguous buffers for both mixed transpose blocks and check global symmetry before the null-mode gates. Lower blocks and the independent prototype already agreed, isolating this transport-layout defect.

Validation: new rectangular 3-by-12 regression demonstrated 34/36 incorrect transpose entries before the fix. Rebuilt-runtime analytical and MPI gates follow this change.

Underworld development team with AI support from Claude Code
Use one full canonical field write after the distributed reaction scatter. Boolean-subset writes could omit synchronization on partitions without boundary nodes. Serial rebuilt-runtime gradient, cap-area and transpose gates pass; eight-rank gates follow this rebuilt candidate.

Underworld development team with AI support from Claude Code
UW3 normalizes body-force vectors to columns while MeshVariable.sym is a row. Compare vector entries rather than matrix orientation when recognizing an unmodified P1/P2 source. Exercise coordinate, continuous-P1 and DG-P2 gradient loads against u=0,p=x. Reject custom divergence constraints and grad-div penalties that the focused backend does not implement.

Prior rebuilt validation: 41 serial tests and the original three integration tests on each of eight ranks pass. Pressure-split Kramer smoke exposed this source-layout contract; rerun integration and source-field gates on this revision.

Underworld development team with AI support from Claude Code
The extended pure-gradient regression exposed that DG P2 nodes lie inside cells rather than at vertices and edge midpoints. Reconstruct the same FE source polynomial using actual nodal coordinates before volume quadrature. Add an independent quadratic reproduction regression in addition to the failing DG-source gradient gate.

Validation before this fix: 42 serial tests passed; DG-P2 source case correctly rejected the incorrect standard-node assumption. Rebuild and serial/MPI source tests required next.

Underworld development team with AI support from Claude Code
Include the pressure-lift circle traction in the regular-pressure momentum RHS. It vanishes for the Kramer radial lift but is essential for a general nonzero trace: with p_J=1 and no physical force, q=-1, p=0 and lambda=0 must hold together. Add the analytical hydrostatic regression, demonstrated failing before this correction, and explain the term in the public API.

Previous integration gates: 44 serial regressions and six new tests on each of eight ranks passed, with h16 serial/MPI fields agreeing to 2.8e-14. Rebuild and rerun on this final consistency correction before accepting the milestone.

Underworld development team with AI support from Claude Code
Add normal and tangential P2-in-angle multipliers for full zero velocity on the physical circles. Preserve the paired pressure/normal-reaction gauge; do not remove rotation or reject applied torque when tangential velocity is constrained. Retain the scalar free-slip API through the shared constraint-basis assembly.

Match ordinary UW3 FE quadrature for volume forcing while retaining signed-cap extensions. Add analytical gradient and azimuthal-torque convergence regressions, demonstrated absent on the prior installed API. Rebuilt serial/MPI gates required before the requested 108-model campaign.

Underworld development team with AI support from Claude Code
Gadi int32 MUMPS on 16 ranks returns an unpinned relative residual of 1.00273e-10, inside the API 1e-9 acceptance bound but 0.27 percent beyond the test-only 1e-10 assertion. Keep the manufactured-solution accuracy and convergence assertions; align this residual check with the existing runtime contract. No solver settings or implementation change. The existing 9674bf9 build remains valid; rerun the serial/16-rank gates with this test revision.
Extract matrix creation with the prior uniform reservation and enable PETSc allocation errors for the reproducer. Add an exact distributed mixed-block baseline with remote velocity, pressure and multiplier entries. This checkpoint is intentionally expected to fail in MPI before exact graph preallocation is implemented.

Underworld development team with AI support from Claude Code
Tiny quad partitions may have no local cells. Keep the DMPlex table oracle on every owning rank and validate the empty (0, 0) API result on empty ranks rather than requiring cells on all ranks.

Underworld development team with AI support from Codex
Record serial and MPI evidence, upstream test-contract adaptations, issue adjudication and the outstanding Gadi/int64 maintenance gap.

Underworld development team with AI support from Codex
@gthyagi
gthyagi requested a review from lmoresi as a code owner November 10, 2026 03:58
Preserve evidence and add explicit pending maintainer sign-off tables to both review documents; no approval or numerical change is implied.

Underworld development team with AI support from Codex
Skip only comment-posting steps for fork PRs, whose pull_request tokens are read-only. Keep document and test validation active without expanding token privileges.

Underworld development team with AI support from Codex
Surface basis DMs retain physical coordinate dimension during local identity projection; three affine-facet regression cases reproduce the prior failure. Hoist the pressure-context collective outside conditional context state. Add Kramer parameter/sign coverage and forward the verified-gauge keyword in the coarse regression wrapper. Numerical validation follows in a fresh regular package; no solver tolerance changes.

Underworld development team with AI support from Codex
…ations

A reproduced annulus response exhausted200 iterations on rounding along an exact rotation; projecting only an inner source copy converges in2. Preserve original A*z for all coarse and residual audits. Add an independent singular-block regression that fails on the unprojected source. Fresh serial/MPI validation follows; outer tolerances are unchanged.

Underworld development team with AI support from Codex
…unds

Independent3DOF oracles reproduce false rotation admission after normal elimination and for one-sided kernels. Verify both constrained actions before gauge removal. Three affine-node regressions reproduce roundoff outside the physical box; bound correction by64eps and reject larger excursions collectively. Replace XDMF zero-relative and FAC host-count assertions with roundoff and3/4 coverage contracts. Fresh installed-package validation follows; no Stokes tolerance changes.

Underworld development team with AI support from Codex
The raw facet co-normal included radial constraint reaction; reuse the orthonormal in-surface frame. An independent tangency assertion reproduces the prior failure and preserves the membrane-resultant bound. Update gauge contracts to retain physical weak rotations and independently recompute finalized original equations, with exact analytic-normal controls. Fresh installed validation follows.

Underworld development team with AI support from Codex
…n fixtures

Underworld development team with AI support from Codex
… owning ranks

Underworld development team with AI support from Codex
Choose an interior vertex incident to owned cells on multiple ranks and place a short tangent fault through it. Require the moved-level wrapper on every MPI size instead of relying on a measured rank-count table. Check inherited declarations before the solve; retain all original tolerance and gauge assertions. The fixture body passes all three tests per rank at2 and8 ranks on Gadi PETSc int64; final module import placement is covered by the subsequent pinned component gate. Test-only change: installed numerical code and336 campaign outputs are unchanged.

Underworld development team with AI support from Codex
lmoresi added a commit that referenced this pull request Nov 13, 2026
Stokes.pressure_split: a prescribed interface pressure jump on fitted facets (opt-in, from #1033)
gthyagi added a commit to gthyagi/underworld3 that referenced this pull request Nov 13, 2026
…al spherical harmonics

Cut from underworldcode#1033 at 1b74046 as a unit of its own, on development 01b06c9.
The files are as they stand at that head; they were written in f5b3f85
(Restore validated spherical Kramer and sheet-load dependencies), 0dd36aa
(Cover spherical gravity kernels with independent analytical oracles) and
efd48ff.

- analytic/spherical/kramer.py: Kramer, Davies and Wilson (2021) spherical
  shell solutions in SymPy, smooth and delta density, free-slip and zero-slip
  walls, registered as KramerSphericalStokes.
- analytic/spherical/gravity.py and analytic/_kramer_geoid.py: analytical
  gravity kernels and the stress-to-geoid adapter.
- maths/spherical_harmonics.py: real spherical harmonics.
- tests 1032 and 1033, and KramerSphericalStokes added to the 1028 sweep.

Underworld development team with AI support from Claude Code
gthyagi pushed a commit to gthyagi/underworld3 that referenced this pull request Nov 13, 2026
…vity kernels

gravity.py carried GeoidResponse, SelfGravityResponse,
spherical_shell_geoid_response and spherical_shell_self_gravity_response,
which underworld3.postprocessing.geoid already provides with the same
signatures. The two gave identical numbers on a probe case, and nothing in
this unit or in underworldcode#1033 imports the copies. The physical kernels and
spherical_physical_shell_response, which are new, stay.

Underworld development team with AI support from Claude Code
gthyagi added a commit to gthyagi/underworld3 that referenced this pull request Nov 13, 2026
…= q + p_J on fitted facets

Cut from underworldcode#1033 (gthyagi/underworld3 feature/cylindrical-wall-boundaries_sph at
1b74046), unchanged apart from test file numbers: the pressure_split method,
utilities/_pressure_split.py, its triangle and tetrahedron tests (1184, 1185;
1099 is taken on development) and the guide page. The jump is prescribed on
named, fitted interior facets; nothing here needs to know the shape of a wall.

Underworld development team with AI support from Claude Code
lmoresi added a commit that referenced this pull request Nov 19, 2026
…ylindrical-walls

Lagged physical circular walls and exact-circle pressure lifting for annulus Stokes (held for the mesh-declaration contract; from #1033)

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant