SNESConvergedDefault#
Default convergence test for SNESSolve()
.
Synopsis#
#include "petsc/private/snesimpl.h"
PetscErrorCode SNESConvergedDefault(SNES snes, PetscInt it, PetscReal xnorm, PetscReal snorm, PetscReal fnorm, SNESConvergedReason *reason, void *dummy)
Collective
Input Parameters#
snes - the
SNES
contextit - the iteration (0 indicates before any Newton steps)
xnorm - 2-norm of current iterate
snorm - 2-norm of current step
fnorm - 2-norm of function at current iterate
dummy - unused context
Output Parameter#
reason - converged reason, see
SNESConvergedReason
Options Database Keys#
-snes_convergence_test default - see
SNESSetFromOptions()
-snes_stol - convergence tolerance in terms of the norm of the change in the solution between steps
-snes_atol
- absolute tolerance of residual norm-snes_rtol
- relative decrease in tolerance norm from the initial 2-norm of the solution-snes_divergence_tolerance
- if the residual goes above divtol*rnorm0, exit with divergence-snes_max_funcs <max_funcs> - maximum number of function evaluations
-snes_max_fail <max_fail> - maximum number of line search failures allowed before stopping, default is none
-snes_max_linear_solve_fail - number of linear solver failures before
SNESSolve()
stops
Notes#
This routine is not generally called directly. It is set with SNESSetConvergenceTest()
automatically before the SNESSolve()
.
It can be called within a custom convergence test that should also apply the standard convergence tests
See Also#
SNES: Nonlinear Solvers, SNES
, SNESSolve()
, SNESSetConvergenceTest()
, SNESConvergedSkip()
, SNESSetTolerances()
, SNESSetDivergenceTolerance()
,
SNESConvergedReason
Level#
developer
Location#
Examples#
Implementations#
SNESConvergedDefault_VI() in src/snes/impls/vi/vi.c
Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages