# TSAdjointSetUp
Sets up the internal data structures for the later use of an adjoint solver 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSAdjointSetUp(TS ts)
```
Collective


## Input Parameter

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





## See Also
 [](chapter_ts), `TSCreate()`, `TSAdjointStep()`, `TSSetCostGradients()`

## Level
advanced

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/explicit/rk/rk.c.html#TSAdjointSetUp_RK">TSAdjointSetUp_RK in src/ts/impls/explicit/rk/rk.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/impls/implicit/theta/theta.c.html#TSAdjointSetUp_Theta">TSAdjointSetUp_Theta in src/ts/impls/implicit/theta/theta.c</A><BR>


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


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