#include "petscksp.h" PetscErrorCode KSPConvergedDefault(KSP ksp,PetscInt n,PetscReal rnorm,KSPConvergedReason *reason,void *ctx)Collective on KSP
ksp | - iterative context | |
n | - iteration number | |
rnorm | - residual norm (may be estimated, depending on the method may be the preconditioned residual norm) | |
ctx | - convergence context which must be created by KSPConvergedDefaultCreate() |
positive | - if the iteration has converged; | |
negative | - if residual norm exceeds divergence threshold; | |
0 | - otherwise. |
rtol = relative tolerance, | - . abstol = absolute tolerance. | |
dtol = divergence tolerance, | - - rnorm_0 is the two norm of the right hand side. When initial guess is non-zero you can call KSPConvergedDefaultSetUIRNorm() to use the norm of (b - A*(initial guess)) as the starting point for relative norm convergence testing, that is as rnorm_0 |