SNESNGMRESSetAdaptive#
Sets whether SNESNGMRES grows the window of stored solutions during the solve
Synopsis#
#include "petscsnes.h"
PetscErrorCode SNESNGMRESSetAdaptive(SNES snes, PetscBool flg)
Logically Collective
Input Parameters#
snes - the
SNEScontextflg -
PETSC_TRUEto grow the window adaptively
Options Database Key#
-snes_ngmres_adaptive (true|false) - grow the window adaptively
Notes#
At each iteration \(k\), SNESNGMRES combines the candidate solution \(x_M\) with the stored solutions \(x_j\) in a window, by minimizing
the norm of the linear combination of their residuals. The ratio \(\theta_{k+1}\) of the minimum to the residual norm \(\| F(x_k) \|\)
predicts the residual reduction \(\| F(x_{k+1}) \| / \| F(x_k) \|\) up to terms of higher order in the residual [HRX26].
With the adaptive strategy, the window starts with a small number of stored solutions and grows by one whenever
\(| \theta_{k+1} - \| F(x_{k+1}) \| / \| F(x_k) \| |\) is below a tolerance, until it reaches the number set with -snes_ngmres_m.
A small window limits the effect of the higher-order terms far from the solution, and a large window improves the rate of convergence
close to the solution, where the higher-order terms are negligible.
Use this strategy when a large fixed window is unreliable far from the solution but a larger history is useful near convergence.
Enable it with SNESNGMRESSetAdaptive() or -snes_ngmres_adaptive, and choose the initial window size and growth tolerance
with SNESNGMRESSetAdaptiveParameters() or -snes_ngmres_adaptive_m and -snes_ngmres_adaptive_tol.
The strategy follows the algorithm of [HRX26] with SNES_NGMRES_SELECT_NONE and SNES_NGMRES_RESTART_NONE or
SNES_NGMRES_RESTART_PERIODIC.
References#
Yunhui He, Leo G. Rebholz, and M. Xiao. NGMRES convergence analysis and proof of acceleration for contractive and noncontractive iterations. arXiv preprint arXiv:2607.14268, 2026. URL: https://arxiv.org/abs/2607.14268.
See Also#
SNES: Nonlinear Solvers, SNES, SNESNGMRES, SNESNGMRESSetAdaptiveParameters(), SNESNGMRESSetSelectType(),
SNESNGMRESSetRestartType()
Level#
intermediate
Location#
Implementations#
SNESNGMRESSetAdaptive_NGMRES() in src/snes/impls/ngmres/snesngmres.c
Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages