:orphan:
# TSGetConvergedReason
Gets the reason the `TS` iteration was stopped. 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSGetConvergedReason(TS ts, TSConvergedReason *reason)
```
Not Collective


## Input Parameter

- ***ts -*** the `TS` context



## Output Parameter

- ***reason -*** negative value indicates diverged, positive value converged, see `TSConvergedReason` or the
manual pages for the individual convergence tests for complete lists





## Note
Can only be called after the call to `TSSolve()` is complete.


## See Also
 [](ch_ts), `TS`, `TSSolve()`, `TSSetConvergenceTest()`, `TSConvergedReason`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/interface/ts.c.html#TSGetConvergedReason">src/ts/interface/ts.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex11.c.html">src/ts/tutorials/ex11.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex11_sa.c.html">src/ts/tutorials/ex11_sa.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex18.c.html">src/ts/tutorials/ex18.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex1f.F90.html">src/ts/tutorials/ex1f.F90</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex22.c.html">src/ts/tutorials/ex22.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex25.c.html">src/ts/tutorials/ex25.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex26.c.html">src/ts/tutorials/ex26.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex34.c.html">src/ts/tutorials/ex34.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex35.cxx.html">src/ts/tutorials/ex35.cxx</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex48.c.html">src/ts/tutorials/ex48.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/extchem.c.html">src/ts/tutorials/extchem.c</A><BR>


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


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