# TSAdaptSetCheckStage
Set a callback to check convergence for a stage 
## Synopsis
```
#include "petscts.h" 
PetscErrorCode TSAdaptSetCheckStage(TSAdapt adapt, PetscErrorCode (*func)(TSAdapt, TS, PetscReal, Vec, PetscBool *))
```
Logically collective


## Input Parameters

- ***adapt -*** adaptive controller context
- ***func -*** stage check function



## Arguments of func
```none
PetscErrorCode func(TSAdapt adapt,TS ts,PetscBool *accept)
```


- ***adapt -*** adaptive controller context
- ***ts -*** time stepping context
- ***accept -*** pending choice of whether to accept, can be modified by this routine





## See Also
 [](chapter_ts), `TSAdapt`, `TSGetAdapt()`, `TSAdaptChoose()`

## Level
advanced

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


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


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