# SNESGetConvergedReason

Gets the reason the SNES iteration was stopped.

### Synopsis

    #include "petscsnes.h"
    PetscErrorCode PETSCSNES_DLLEXPORT SNESGetConvergedReason(SNES snes,SNESConvergedReason *reason)

Not Collective

### Input Parameter

snes -the SNES context

### Output Parameter

reason -negative value indicates diverged, positive value converged, see petscsnes.h or the manual pages for the individual convergence tests for complete lists

Notes: Can only be called after the call the SNESSolve() is complete.

### Keywords

SNES, nonlinear, set, convergence, test

### See Also

SNESSetConvergenceTest(), SNESConverged_LS(), SNESConverged_TR(), SNESConvergedReason

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

### Examples

src/snes/examples/tutorials/ex30.c.html