KSPDefaultConverged

Determines convergence of the iterative solvers (default code).

Synopsis

int KSPDefaultConverged(KSP ksp,int n,double rnorm,void *dummy)
Collective on KSP

Input Parameters

ksp - iterative context
n - iteration number
rnorm - 2-norm residual value (may be estimated)
dummy - unused convergence context

Returns

1 - if the iteration has converged;
-1 - if residual norm exceeds divergence threshold;
0 - otherwise.

Notes

KSPDefaultConverged() reaches convergence when
     rnorm < MAX ( rtol * rnorm_0, atol );
Divergence is detected if
     rnorm > dtol * rnorm_0,

where

Use KSPSetTolerances() to alter the defaults for rtol, atol, dtol.

Keywords

KSP, default, convergence, residual

See Also

KSPSetConvergenceTest(), KSPSetTolerances()

Location: src/ksp/interface/iterativ.c
KSP Index
Table of Contents

rtol = relative tolerance,- . atol = absolute tolerance.
dtol = divergence tolerance,- - rnorm_0 = initial residual norm