# TaoSetConvergedReason
Sets the termination flag on a Tao object 
## Synopsis
```
#include "petsctao.h" 
PetscErrorCode TaoSetConvergedReason(Tao tao, TaoConvergedReason reason)
```
Logically Collective


## Input Parameters

- ***tao -*** the Tao context
- ***reason -*** one of


```none
     TAO_CONVERGED_ATOL (2),
     TAO_CONVERGED_RTOL (3),
     TAO_CONVERGED_STEPTOL (4),
     TAO_CONVERGED_MINF (5),
     TAO_CONVERGED_USER (6),
     TAO_DIVERGED_MAXITS (-2),
     TAO_DIVERGED_NAN (-4),
     TAO_DIVERGED_MAXFCN (-5),
     TAO_DIVERGED_LS_FAILURE (-6),
     TAO_DIVERGED_TR_REDUCTION (-7),
     TAO_DIVERGED_USER (-8),
     TAO_CONTINUE_ITERATING (0)
```





## See Also
 `Tao`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/interface/taosolver.c.html#TaoSetConvergedReason">src/tao/interface/taosolver.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/unconstrained/tutorials/eptorsion2f.F90.html">src/tao/unconstrained/tutorials/eptorsion2f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/tao/bound/tutorials/jbearing2.c.html">src/tao/bound/tutorials/jbearing2.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/tao/interface/taosolver.c)


[Index of all Tao routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
