# TSGetStages
Get the number of stages and stage values 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSGetStages(TS ts, PetscInt *ns, Vec **Y)
```

## Input Parameter

- ***ts -*** the `TS` context obtained from `TSCreate()`



## Output Parameters

- ***ns -*** the number of stages
- ***Y -*** the current stage vectors





## Note
Both ns and Y can be NULL.


## See Also
 [](chapter_ts), `TS`, `TSCreate()`

## Level
advanced

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/explicit/rk/rk.c.html#TSGetStages_RK">TSGetStages_RK in src/ts/impls/explicit/rk/rk.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/glee/glee.c.html#TSGetStages_GLEE">TSGetStages_GLEE in src/ts/impls/glee/glee.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/implicit/discgrad/tsdiscgrad.c.html#TSGetStages_DiscGrad">TSGetStages_DiscGrad in src/ts/impls/implicit/discgrad/tsdiscgrad.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/implicit/theta/theta.c.html#TSGetStages_Theta">TSGetStages_Theta in src/ts/impls/implicit/theta/theta.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/multirate/mprk.c.html#TSGetStages_MPRK">TSGetStages_MPRK in src/ts/impls/multirate/mprk.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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
