# TSAdaptHistorySetHistory
Sets the time history in the adaptor 
## Synopsis
```
#include "petscts.h" 
PetscErrorCode TSAdaptHistorySetHistory(TSAdapt adapt, PetscInt n, PetscReal hist[], PetscBool backward)
```
Logically Collective


## Input Parameters

- ***adapt    -*** the `TSAdapt` context
- ***n        -*** size of the time history
- ***hist     -*** the time history
- ***backward -*** if the time history has to be followed backward





## 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), `TSGetAdapt()`, `TSAdaptSetType()`, `TSAdaptHistorySetTrajectory()`, `TSADAPTHISTORY`

## Level
advanced

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


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