Skip to content

feat(projection): opt-in linear_solver() + post-processing how-to (#156, #158)#281

Merged
lmoresi merged 1 commit into
developmentfrom
feature/projection-linear-solver-156
Jun 24, 2026
Merged

feat(projection): opt-in linear_solver() + post-processing how-to (#156, #158)#281
lmoresi merged 1 commit into
developmentfrom
feature/projection-linear-solver-156

Conversation

@lmoresi

@lmoresi lmoresi commented Jun 24, 2026

Copy link
Copy Markdown
Member

Two small post-processing improvements from the spherical-benchmark cluster.

#156 — opt-in lightweight projection solver

Projection does a linear SPD L2 solve but inherits the heavy newtonls/gmres/gamg default — GAMG setup/repartition is the memory/comm bottleneck for repeated post-processing projections (OOM-killed mid-sequence on Gadi). New opt-in method:

proj.linear_solver(pc="jacobi", rtol=1e-10)   # -> ksponly + CG + cheap PC, drops GAMG options

Global default unchanged (internal paths unaffected). Verified the lightweight solve matches the default projection (rel ~1e-5, the tighter of the two). Tests: test_0506_projection_linear_solver.py (sets options / matches default / opt-in).

#158 — 'project components, compose analytically' (doc)

Documents why direct projection of the composed nᵀσn loses accuracy (mixes derived-τ + discontinuous-p) and the reliable rule: project the τ components, form σ_rr = nᵀτ_proj n − p. New how-to: docs/developer/subsystems/boundary-stress-and-projection-postprocessing.md (covers both rules; registered in the toctree).

Closes the actionable parts of #156/#158 (the opt-in default-preset question and the documentation).

Underworld development team with AI support from Claude Code

…, #158)

#156: Projection (and its vector/tensor/multi-component variants) does a linear
SPD L2 projection, but inherits the heavy SNES_Scalar newtonls/gmres/gamg stack
— GAMG setup/repartition is the memory/communication bottleneck for repeated
post-processing projections (OOM-killed mid-sequence on Gadi). Add an opt-in
SNES_Projection.linear_solver(pc='jacobi', rtol=1e-10) that switches to
ksponly+CG+cheap-PC and drops the unused GAMG options. The global default is
unchanged (internal paths that rely on it are unaffected). Verified the
lightweight solve matches the default projection; tests/test_0506.

#158: document the 'project components, compose analytically' rule for boundary
stress recovery — projecting the composed nᵀσn mixes derived-τ and discontinuous
p at lower accuracy (~2x error on the Thieulot benchmark); project the τ
components and form σ_rr = nᵀτ_proj n − p instead. New how-to under
docs/developer/subsystems/ covering both rules.

Underworld development team with AI support from Claude Code
Copilot AI review requested due to automatic review settings June 24, 2026 02:16
@lmoresi lmoresi merged commit 8061dd1 into development Jun 24, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

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.

2 participants