Skip to content

Add a "bulletproof" smoother strategy: Schwarz, to take the solver off the suspect list - #757

Open
lmoresi wants to merge 1 commit into
developmentfrom
feature/bulletproof-smoother
Open

lmoresi wants to merge 1 commit into
developmentfrom
feature/bulletproof-smoother

Conversation

@lmoresi

@lmoresi lmoresi commented Sep 18, 2026

Copy link
Copy Markdown
Member

What

A third variant on the geometric-MG smoother axis, selected by solver.strategy = "bulletproof": gmres/8 preconditioned by additive Schwarz instead of SOR. Each subdomain solve inverts the local coupling directly, so the smoother does not depend on the operator being close to symmetric or elliptic — which SOR does.

Why

Its purpose is diagnostic as much as numerical. When a run misbehaves and the linear solve, the transport scheme and the mesh resolution are all candidates, rerunning under this variant takes the first off the list.

That is not hypothetical — it is how this variant earned its way in. Creeping Oldroyd-B past a confined cylinder (Wi 0.4, β = 0.59, three levels), where the viscoelastic velocity block carries upper-convected stretching terms and a stress layer thinner than a cell. Same problem, one option key changed:

smoother the failing step drag
sor 26947 s −4642
asm 115 s 86.05

90% of the inner velocity solves hit their iteration cap under sor, 77% under asm. It then produced the same wrong drag as every other smoother, at the same step, which is what identified the real fault as lying outside the linear algebra.

Cost on a benign operator

Smaller than expected. SolCx (free-slip Stokes, viscosity jump), velocity error identical to four significant figures in every case:

case default fast bulletproof
32², contrast 1e6 15.5 s 11.3 s 12.0 s
32², contrast 1e8 15.9 s 10.6 s 12.6 s
48², 3 levels, 1e6 157.0 s 112.2 s 135.6 s

Faster than the current default, 10–20% behind fast. So it is an opt-in, not a change of default: fast still wins where the operator is benign, and nothing here justifies displacing a measured default.

Notes for review

  • Every variant still writes the same option keys — that invariant is what keeps the stale-key derivation variant-independent. This is why the variant takes PETSc's own Schwarz defaults rather than tuning overlap, which would need a key the others do not have.
  • It covers the velocity smoother only. A fuller "take the solver off the table" switch would extend the same idea to the coarse solve and the pressure block; that is deliberately not in this PR.
  • Not measured on a genuinely easy operator: SolCx is singular at uniform viscosity, so the cheapest case where Schwarz should lose most clearly is untested here.

Check

tests/test_1021_mg_option_bundle.py — 19 passed. tests/test_1015_analytic_solcx.py — 4 passed. The SolCx comparison above was run directly.

🤖 Generated with Claude Code

https://claude.ai/code/session_018T2VHUGaZiQVJ95qQ4DiSL

…f the suspect list

A third variant on the geometric-MG smoother axis, selected by
`solver.strategy = "bulletproof"`: gmres/8 preconditioned by additive Schwarz
instead of SOR. Each subdomain solve inverts the local coupling directly, so the
smoother does not rely on the operator being close to symmetric or elliptic.

Its purpose is diagnostic as much as numerical. When a run misbehaves and the
linear solve, the transport scheme and the mesh resolution are all candidates,
rerunning under this variant removes the first from the list.

Measured on creeping Oldroyd-B past a confined cylinder (Wi 0.4, beta 0.59,
three levels), where the velocity block carries upper-convected stretching terms
and a cell-scale stress layer. Same problem, one key changed:

  sor -> one step took 26947 s and the drag reached -4642
  asm -> the same step took 115 s and stayed finite

90% of the inner velocity solves hit their iteration cap under sor, 77% under
asm. It then produced the SAME wrong drag as every other smoother, which is how
the real fault was identified as being outside the linear algebra.

Cost on a benign operator is smaller than expected. SolCx (free-slip, viscosity
jump), identical velocity error to four significant figures in every case:

  32^2, contrast 1e6:   default 15.5 s   fast 11.3 s   bulletproof 12.0 s
  32^2, contrast 1e8:   default 15.9 s   fast 10.6 s   bulletproof 12.6 s
  48^2, 3 levels, 1e6:  default 157 s    fast 112 s    bulletproof 136 s

Faster than the current default and 10-20% behind "fast", so it is an opt-in and
not a change of default. Every variant still writes the same option keys, which
is what keeps the stale-key derivation variant-independent; this is why the
variant takes PETSc's own Schwarz defaults rather than tuning overlap.

Underworld development team with AI support from Claude Code

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018T2VHUGaZiQVJ95qQ4DiSL
Copilot AI lite review requested due to automatic review settings September 18, 2026 06:25

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