GMRES#
Source: solvers/gmres.py
Matrix-free restarted GMRES(m) linear solver for the implicit Newton step.
Never assembles the Jacobian: each inner iteration applies J.v (the
compiled/eager Matvec). Best for the well-conditioned near-identity
systems of implicit backward-Euler updates, where a handful of matvecs beat
an O(N^3) dense factorization. Configure it as a Newton linear_solver.
Other options#
restart—int· default40GMRES(m) restart width (Krylov subspace size)
max_its—int· default1000Maximum inner (Krylov) iterations per Newton step
abs_tol—float· default0.0Absolute inner-residual tolerance (0 disables the absolute test)
rel_tol—float· default0.0001Relative inner-residual tolerance. Loose is fine (and faster): the outer Newton re-solves each step, so an inexact inner solve still converges – tighten only for stiff/ill-conditioned systems
preconditioner—strPreconditioner object (a [Solvers] NoPreconditioner / Jacobi / BlockJacobi / FullPreconditioner); unset = no preconditioner
cache_strategy—str· defaultnonePreconditioner rebuild policy across Newton iterations: none (rebuild each step) | chord (build once, reuse) | max_its (rebuild when a solve exceeds cache_max_its iterations)
cache_max_its—int· default10Iteration bar that triggers a preconditioner rebuild under the max_its cache strategy