Skip to content

Stokes outer Krylov defaults to gmres while the fieldsplit sub-blocks are Krylov solves — must be fgmres #576

Description

@lmoresi

The default

On a plain uw.systems.Stokes, the solver configuration is:

type preconditioner
outer gmres fieldsplit
velocity block fgmres mg
pressure block fgmres gasm

The sub-blocks are flexible; the outer one is not.

Why that is the wrong way round

The velocity sub-solve is not a passive preconditioner — inside the Schur
factorisation it computes the search direction. It is a Krylov method,
therefore inexact, therefore the operator effectively applied differs between
outer iterations
. Plain GMRES assumes a fixed preconditioner; its residual
recurrence has no guarantee against an operator that varies. Flexibility is the
half of the design that tolerates inexact inner solves, and the inner tolerance
margins are the half that bounds them — they are two parts of one decision.

Measured cost

On the notch problem at refinement 3, varying only the outer method:

outer inner rtol velocity its/step result
gmres 3.3e-08 983 DIVERGED_LINEAR_SOLVE
gmres 3.3e-08, cap 2000 999 DIVERGED_LINEAR_SOLVE (residual identical to the above)
gmres 1e-03 915 DIVERGED_LINEAR_SOLVE
fgmres 3.3e-08 58 no linear failure
fgmres 1e-03 23 no linear failure

Seventeen times less work, and forty-three with a loosened inner tolerance.
Raising the velocity iteration cap is inert — byte-identical rows — so the
failure is inconsistency, not insufficient iterations. Loosening the inner
tolerance by five orders while the outer stayed non-flexible was worth 7%.

Why it goes unnoticed

Easy problems hide it. On isoviscous SolKz at refinement 2 the outer converges
in 2 iterations and nothing looks wrong. The default only bites where the inner
solves are genuinely inexact — hard nonlinear rheologies, strong viscosity
structure — which is where a user is least able to tell a solver defect from a
modelling problem.

Suggested fix

Default ksp_type to fgmres for the Stokes outer solve. The extra storage
over GMRES is one vector per Krylov direction, which is the normal price of
flexibility and is small against the cost of the block solves it wraps.

Worth auditing the other multi-block solvers for the same pattern at the same
time.

Underworld development team with AI support from Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions