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


## Input Parameters

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


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




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