Skip to main content
`Ctrl`+`K`

# NEPSetStoppingTestFunction

Sets a function to decide when to stop the outer iteration of the eigensolver.

## Synopsis

    #include "slepcnep.h"
    PetscErrorCode NEPSetStoppingTestFunction(NEP nep,NEPStoppingTestFn *stop,void *ctx,PetscCtxDestroyFn *destroy)

Logically Collective

## Input Parameters

- nep - the nonlinear eigensolver context

- stop - the stopping test function, see `NEPStoppingTestFn` for the calling sequence

- ctx - context for private data for the stopping routine (may be `NULL`)

- destroy - a routine for destroying the context (may be `NULL`), see `PetscCtxDestroyFn` for the calling sequence

## Note

When implementing a function for this, normal usage is to first call the default routine `NEPStoppingBasic()` and then set `reason` to `NEP_CONVERGED_USER` if some user-defined conditions have been met. To let the eigensolver continue iterating, the result must be left as `NEP_CONVERGED_ITERATING`.

## See Also

NEP: Nonlinear Eigenvalue Problems, `NEPSetStoppingTest()`, `NEPStoppingBasic()`

## Level

advanced

## Location

src/nep/interface/nepopts.c

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