KSPSetTolerances
Sets the relative, absolute, divergence, and maximum iteration tolerances used by the default KSP convergence testers.
Synopsis
#include "ksp.h"
int KSPSetTolerances(KSP ksp,PetscReal rtol,PetscReal atol,PetscReal dtol,int maxits)
Collective on KSP
Input Parameters
| ksp | - the Krylov subspace context
|
| rtol | - the relative convergence tolerance
(relative decrease in the residual norm)
|
| atol | - the absolute convergence tolerance
(absolute size of the residual norm)
|
| dtol | - the divergence tolerance
(amount residual can increase before KSPDefaultConverged()
concludes that the method is diverging)
|
| maxits | - maximum number of iterations to use
|
Options Database Keys
| -ksp_atol <atol> | - Sets atol
|
| -ksp_rtol <rtol> | - Sets rtol
|
| -ksp_divtol <dtol> | - Sets dtol
|
| -ksp_max_it <maxits> | - Sets maxits
|
Notes
Use PETSC_DEFAULT to retain the default value of any of the tolerances.
See KSPDefaultConverged() for details on the use of these parameters
in the default convergence test. See also KSPSetConvergenceTest()
for setting user-defined stopping criteria.
Keywords
KSP, set, tolerance, absolute, relative, divergence,
convergence, maximum, iterations
See Also
KSPGetTolerances(), KSPDefaultConverged(), KSPSetConvergenceTest()
Examples
src/sles/examples/tutorials/ex1f.F
src/sles/examples/tutorials/ex2f.F
src/sles/examples/tutorials/ex15f.F
src/sles/examples/tutorials/ex13f90.F
src/sles/examples/tutorials/ex21f.F
src/sles/examples/tutorials/ex1.c
src/sles/examples/tutorials/ex2.c
src/sles/examples/tutorials/ex3.c
src/sles/examples/tutorials/ex7.c
src/sles/examples/tutorials/ex13.c
src/sles/examples/tutorials/ex15.c
src/sles/examples/tutorials/ex17.c
src/snes/examples/tutorials/ex1f.F
src/snes/examples/tutorials/ex1.c
Level:intermediate
Location:src/sles/ksp/interface/itfunc.c
KSP Index
Table of Contents