# TSAdaptHistoryGetStep
Gets time and time step for a given step number in the history 
## Synopsis
```
#include "petscts.h" 
PetscErrorCode TSAdaptHistoryGetStep(TSAdapt adapt, PetscInt step, PetscReal *t, PetscReal *dt)
```
Logically Collective on adapt


## Input Parameters

- ***adapt    -*** the TSAdapt context
- ***step     -*** the step number



## Output Parameters

- ***t  -*** the time corresponding to the requested step (can be NULL)
- ***dt -*** the time step to be taken at the requested step (can be NULL)





## Note
The time history is internally copied, and the user can free the hist array. The user still needs to specify the termination of the solve via `TSSetMaxSteps()`.


## See Also
 [](chapter_ts), `TS`, `TSGetAdapt()`, `TSAdaptSetType()`, `TSAdaptHistorySetTrajectory()`, `TSADAPTHISTORY`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/adapt/impls/history/adapthist.c.html#TSAdaptHistoryGetStep">src/ts/adapt/impls/history/adapthist.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex40.c.html">src/ts/tutorials/ex40.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex41.c.html">src/ts/tutorials/ex41.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ts/adapt/impls/history/adapthist.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)  
