Skip to main content
`Ctrl`+`K`

# NEPSetTolerances

Sets the tolerance and maximum iteration count used by the `NEP` convergence tests.

## Synopsis

    #include "slepcnep.h"
    PetscErrorCode NEPSetTolerances(NEP nep,PetscReal tol,PetscInt maxits)

Logically Collective

## Input Parameters

- nep - the nonlinear eigensolver context

- tol - the convergence tolerance

- maxits - maximum number of iterations to use

## Options Database Keys

- -nep_tol tol - sets the convergence tolerance

- -nep_max_it maxits - sets the maximum number of iterations allowed

## Note

Use `PETSC_CURRENT` to retain the current value of any of the parameters. Use `PETSC_DETERMINE` for either argument to assign a default value computed internally (may be different in each solver). For `maxits` use `PETSC_UNLIMITED` to indicate there is no upper bound on this value.

## See Also

NEP: Nonlinear Eigenvalue Problems, `NEPGetTolerances()`

## Level

intermediate

## Location

src/nep/interface/nepopts.c

## Examples

src/nep/tutorials/ex20f.F90
src/nep/tutorials/ex20.c
src/nep/tutorials/ex22f.F90
src/nep/tutorials/ex22.c

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