:orphan:
# SNESSetMaxNonlinearStepFailures
Sets the maximum number of unsuccessful steps attempted by the nonlinear solver before it gives up and generates an error 
## Synopsis
```
#include "petscsnes.h"  
PetscErrorCode SNESSetMaxNonlinearStepFailures(SNES snes, PetscInt maxFails)
```
Not Collective


## Input Parameters

- ***snes     -*** `SNES` context
- ***maxFails -*** maximum of unsuccessful steps





## See Also
 [](ch_snes), `SNESSetErrorIfNotConverged()`, `SNESGetMaxLinearSolveFailures()`, `SNESGetLinearSolveIterations()`, `SNESSetMaxLinearSolveFailures()`, `SNESGetLinearSolveFailures()`,
`SNESGetMaxNonlinearStepFailures()`, `SNESGetNonlinearStepFailures()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/interface/snes.c.html#SNESSetMaxNonlinearStepFailures">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](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
