# SNESSetDivergenceTolerance
Sets the divergence tolerance used for the `SNES` divergence test. 
## Synopsis
```
#include "petscsnes.h"  
PetscErrorCode SNESSetDivergenceTolerance(SNES snes, PetscReal divtol)
```
Logically Collective on snes


## Input Parameters

- ***snes -*** the `SNES` context
- ***divtol -*** the divergence tolerance. Use -1 to deactivate the test, default is 1e4



## Options Database Key

- ***-snes_divergence_tolerance <divtol> -*** Sets divtol





## See Also
 `SNES`, `SNESSolve()`, `SNESSetTolerances()`, `SNESGetDivergenceTolerance`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/interface/snes.c.html#SNESSetDivergenceTolerance">src/snes/interface/snes.c</A>


---
[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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
