Add reaction-based spherical-shell geoid projection - #686
Open
gthyagi wants to merge 1 commit into
Open
Conversation
…ntegral Extract only the outstanding spherical postprocessing changes from PR underworldcode#646 onto upstream development at 9da04b7. Reuse boundary_normal_traction_integral already provided by underworldcode#648; no solver, Cython, SLCN/SUPG, checkpoint, or evaluation changes are included. Add opt-in projection=reaction to contract the normal reaction with the axisymmetric harmonic and normalize by its matching finite-element boundary inner product. Preserve centroid as the compatibility default. Carry the projection-validation and Zhong serial/MPI regressions, including near-machine-precision rank comparisons, and update the postprocessing documentation and changelog. Post-extraction build and regression results are recorded separately in the benchmark repository.
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.
Summary
Supersedes #646 with a single, narrowly scoped commit from current
development(9da04b72). The original PR accumulated unrelated mantleconvection development; this replacement contains only the outstanding
spherical-shell reaction-projection changes.
The generic
Stokes.boundary_normal_traction_integral()implementation isalready upstream through #648. This PR reuses that API rather than adding a
second implementation or changing shared solver/Cython code.
projection="reaction"to the spherical-shell rotated-Stokes adapter.harmonic norm.
projection="centroid"as the compatibility default. Deprecating theConvexHull workflow discussed in geoid harmonic projection re-derives the surface mesh with ConvexHull instead of integrating over the boundary facets we already have #647 remains a separate API decision.
No SUPG/SLCN, checkpoint, evaluator, scalar heat-flux, or solver-configuration
changes are included. The diff is five files: one postprocessing module, two
test files, the subsystem documentation, and the changelog.
Why and How
A nodal reaction represents an integrated force, not a pointwise traction.
When only a harmonic coefficient is needed, recovering pointwise P2 values and
then reconstructing a surface triangulation is unnecessary. It also encounters
the curved-boundary P2 issues discussed in #414, #431, and #633/#649.
For the scalar normal-reaction load
Rand nodal samples of the harmonicphi = P_l(cos(theta)), the existing upstream integral API evaluates:The adapter divides by
BdIntegral(phi**2)and applies its existing boundarysign and buoyancy scale. Numerator and denominator therefore use the same
faceted finite-element boundary geometry. Reaction ownership and reductions
remain the responsibility of the upstream API.
The reaction path needs no global boundary-sample gather, rank-zero
ConvexHull, or pointwise traction recovery. Consumers needing a nodaltopography field continue to use the existing pointwise APIs.
Fresh Validation of This Branch
Tested commit:
fd0a3bcc. A wheel was built from this clean branch and installedinto an isolated target using the existing Pixi dependencies.
PYTHONPATHselected that installation for the tests; its imported UW3 had the upstream
reaction API and no
AdvDiffusionSUPGclass. The installedgeoid.pychecksummatches the branch source.
Environment: macOS/arm64, Python 3.12, PETSc 3.25.0, Open MPI 5.0.10,
MPI-enabled h5py.
test_1070_postprocessing_geoid.pytest_1120_SLVectorCartesian.pyparallel/test_1071_spherical_shell_geoid_parallel.pyThe MPI comparison allows near-machine-precision reduction differences
(
rtol=1e-13,atol=1e-14) rather than requiring bitwise equality.Serial output contained three non-interactive plotting warnings and no failures.
Separately, the synchronized mantle integration branch passed strict
Level 1 selection: 1676 passed, 36 skipped, 2 expected failures in 1053.89 s.
That broader check is not presented as a full Level 1 run of this standalone
branch. Linux CI remains to be verified.
Build, extraction, and validation report.
Historical Production Evidence
These are the controlled Gadi results already reported in #646, not new
measurements of this extracted commit. The layered Zhong case used degree 5,
load depth 0.5,
cellsize=1/64, a fitted10^4viscosity lid, P2P1, rotatedfree slip, 192 ranks, and Stokes tolerance
1e-5.The response stage was 3.25 times faster. It includes common velocity/divergence
integrals, not geoid evaluation alone. The small Stokes timing change is
run-to-run variation; no Stokes speedup or whole-job memory reduction is claimed.
Velocity is unchanged by projection, including the approximately 8.46% residual
error in this case's small surface velocity.
Production benchmark
and historical results.
Review
@lmoresi: this isolates the spherical adapter from the unrelated changes you
flagged in #646. Please review its use of the already-merged reaction integral
and matching boundary norm. No generic reaction-recovery implementation is
being replaced. The mantle branch remains the development branch and is not
deleted when the superseded PR is closed.