:orphan: # SNESSetTolerances Sets `SNES` various parameters used in convergence tests. ## Synopsis ``` #include "petscsnes.h" PetscErrorCode SNESSetTolerances(SNES snes, PetscReal abstol, PetscReal rtol, PetscReal stol, PetscInt maxit, PetscInt maxf) ``` Logically Collective ## Input Parameters - ***snes -*** the `SNES` context - ***abstol -*** absolute convergence tolerance - ***rtol -*** relative convergence tolerance - ***stol -*** convergence tolerance in terms of the norm of the change in the solution between steps, || delta x || < stol*|| x || - ***maxit -*** maximum number of iterations, default 50. - ***maxf -*** maximum number of function evaluations (-1 indicates no limit), default 1000 ## Options Database Keys - ***-snes_atol -*** Sets abstol - ***-snes_rtol -*** Sets rtol - ***-snes_stol -*** Sets stol - ***-snes_max_it -*** Sets maxit - ***-snes_max_funcs -*** Sets maxf ## See Also [](ch_snes), `SNESolve()`, `SNES`, `SNESSetTrustRegionTolerance()`, `SNESSetDivergenceTolerance()`, `SNESSetForceIteration()` ## Level intermediate ## Location src/snes/interface/snes.c --- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/interface/snes.c) [Index of all SNES routines](index.md) [Table of Contents for all manual pages](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)