Skip to main content
`Ctrl`+`K`

# SNESSetDivergenceTolerance

Sets the divergence tolerance used for the `SNES` divergence test.

## Synopsis

    #include "petscsnes.h"
    PetscErrorCode SNESSetDivergenceTolerance(SNES snes, PetscReal divtol)

Logically Collective

## Input Parameters

- snes - the `SNES` context

- divtol - the divergence tolerance. Use `PETSC_UNLIMITED` to deactivate the test. If the residual norm \( F(x^n) \ge divtol * F(x^0) \) the solver is stopped due to divergence.

## Options Database Key

- -snes_divergence_tolerance <divtol> - Sets `divtol`

## Notes

Use `PETSC_DETERMINE` to use the default value from when the object’s type was set.

## Fortran Note

Use ``PETSC_DETERMINE_REAL`or`PETSC_UNLIMITED_REAL`

## See Also

SNES: Nonlinear Solvers, `SNES`, `SNESSolve()`, `SNESSetTolerances()`, `SNESGetDivergenceTolerance()`

## Level

intermediate

## Location

src/snes/interface/snes.c

Index of all SNES routines
Table of Contents for all manual pages
Index of all manual pages