Repository navigation
Native spherical Kramer Stokes references, gravity kernels and real spherical harmonics - #1108
Conversation
…al spherical harmonics Cut from #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
…e that exists The geoid adapter defers imports of analytic.cylindrical.kramer and analytic.cylindrical.gravity, which are not in the repository; this test fails on them (2 missing). Underworld development team with AI support from Claude Code
… that do not exist _KramerGeoidMixin is used by the spherical solution only. Its cylindrical branches imported analytic.cylindrical.kramer and analytic.cylindrical.gravity, neither of which is in the repository, so they could only fail if reached. The adapter now says it is spherical. The cylindrical geoid response already lives in underworld3.postprocessing.geoid. Underworld development team with AI support from Claude Code
Tier A is for tests that have been hardened and reviewed; a new proven test starts at tier B. Underworld development team with AI support from Claude Code
…closed forms Neither was reached by a test: mutants that divided the geoid by the other wall's gravity, or flipped the sign of the outer topography, passed the suite. The shell response is now checked against the thin-sheet superposition for two interfaces and an internal sheet, with the self-gravity fixed point; the adapter's topography against the wall normal stress read from the Cartesian stress field. Underworld development team with AI support from Claude Code
…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 #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
Review of #1108 (H3, second review desk)Verdict: READY at 40b5007. The analytic fields solve the equations they claim to, and agree with the published implementation. The tests catch small coefficient errors, and the import cost is small. The only CI failure is the pre-existing Built at 40b5007 on hyperion. Probes are in Findings
Attacks that failed
Not checkedDegrees above 4 in our own probes; the gravity kernels beyond the PR's tests; Underworld development team with AI support from Claude Code |
…y body force underworldcode#1108 added KramerSphericalStokes to the family but not to this file's SWEEP, and its default (a density sheet at r_int) carries no body force, so the negative control flipped a zero vector. The sweep now covers smooth density and two non-axisymmetric modes (real_orthonormal harmonics, which m > 0 requires), and the flip test flips the smooth-density case. Underworld development team with AI support from Claude Code
Native SymPy reference solutions for Stokes flow in a spherical shell (Kramer, Davies and Wilson 2021), with the gravity kernels and real spherical harmonics they use. This is @gthyagi's work, cut out of #1033 at
1b740463as a unit of its own: it depends on nothing else in that PR and nothing in the solvers.Until now the spherical Kramer cases were available only through the external
assesspackage, as numbers. These are symbolic, so the conformance suite can check them against the equations they claim to solve, and they are finite at the poles.What is added (gthyagi, one commit, authorship kept)
uw.analytic.KramerSphericalStokes: smooth and delta-sheet density, free-slip and zero-slip walls, any degree from 2, registered with the analytic family.uw.analytic.spherical.gravity: analytical potential of spherical sheets and power-law volume densities, and the two-interface shell response with self-gravity.uw.maths.spherical_harmonics: real orthonormal harmonics, numeric and as Cartesian polynomials.KramerSphericalStokes.geoid_response: wall topography and geoid from the analytic wall stress.What we changed, and why
analytic.cylindrical.kramerandanalytic.cylindrical.gravity, which are not in the repository. Only the spherical class uses the adapter, so the branches are removed. A new test, shown failing first, checks that every relative import in the analytic package names a module that exists.gravity.pycarriedGeoidResponse,SelfGravityResponse,spherical_shell_geoid_responseandspherical_shell_self_gravity_response, whichuw.postprocessing.geoidalready provides with the same signatures. They gave identical numbers and nothing imported the copies.Verification (hyperion, PETSc int32, MPICH 5.0.1, head 40b5007)
scipy's harmonicsassessat random points, four families, degrees 2 to 8import underworld3timeConventions confirmed:
div(sigma) + f = 0; smooth body force-g (r/R_outer)^k Y e_r; at the delta sheet the normal stress jumps byg Y(outer minus inner) with velocity and shear traction continuous.Left open
apply_forcingandapply_boundary_conditionsare not exercised. That comparison belongs with the spherical convergence studies.SphericalStokesis exported as a second name forKramerSphericalStokes.gravity.pystill have no test (the potential operator, the quadrature variant, the volume-density radial derivative).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