:orphan:
# TSTrajectorySetTransform
Solution vector will be transformed by provided function before being saved to disk
## Synopsis
```
#include "petscts.h"
PetscErrorCode TSTrajectorySetTransform(TSTrajectory tj, PetscErrorCode (*transform)(void *, Vec, Vec *), PetscErrorCode (*destroy)(void *), void *tctx)
```
Collective
## Input Parameters
- ***tj -*** the `TSTrajectory` context
- ***transform -*** the transform function
- ***destroy -*** function to destroy the optional context
- ***ctx -*** optional context used by transform function
## See Also
[](ch_ts), `TSTrajectorySetVariableNames()`, `TSTrajectory`, `TSMonitorLGSetTransform()`
## Level
intermediate
## Location
src/ts/trajectory/interface/traj.c
## Examples
src/ts/tutorials/extchem.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ts/trajectory/interface/traj.c)
[Index of all TS routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)