# SNESConvergedReasonViewSet
Sets an ADDITIONAL function that is to be used at the end of the nonlinear solver to display the conver reason of the nonlinear solver. 
## Synopsis
```
#include "petscsnes.h"  
PetscErrorCode SNESConvergedReasonViewSet(SNES snes, PetscErrorCode (*f)(SNES, void *), void *vctx, PetscErrorCode (*reasonviewdestroy)(void **))
```
Logically Collective on snes


## Input Parameters

- ***snes -*** the `SNES` context
- ***f -*** the snes converged reason view function
- ***vctx -*** [optional] user-defined context for private data for the
snes converged reason view routine (use NULL if no context is desired)
- ***reasonviewdestroy -*** [optional] routine that frees reasonview context
(may be NULL)



## Options Database Keys

- ***-snes_converged_reason        -*** sets a default `SNESConvergedReasonView()`
- ***-snes_converged_reason_view_cancel -*** cancels all converged reason viewers that have
been hardwired into a code by
calls to `SNESConvergedReasonViewSet()`, but
does not cancel those set via
the options database.



## Note
Several different converged reason view routines may be set by calling
`SNESConvergedReasonViewSet()` multiple times; all will be called in the
order in which they were set.




## See Also
 `SNES`, `SNESSolve()`, `SNESConvergedReason`, `SNESGetConvergedReason()`, `SNESConvergedReasonView()`, `SNESConvergedReasonViewCancel()`

## Level
intermediate

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/tutorials/ex6.c.html">src/snes/tutorials/ex6.c.html</A><BR>


---
[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)  
