# TSSetPostEvaluate
Sets the general-purpose function called once at the end of each step evaluation. 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSSetPostEvaluate(TS ts, PetscErrorCode (*func)(TS))
```
Logically Collective on ts


## Input Parameters

- ***ts   -*** The `TS` context obtained from `TSCreate()`
- ***func -*** The function



## Calling sequence of func
```none
  PetscErrorCode func(TS ts);
```





## Note
Semantically, `TSSetPostEvaluate()` differs from `TSSetPostStep()` since the function it sets is called before event-handling
thus guaranteeing the same solution (computed by the time-stepper) will be passed to it. On the other hand, `TSPostStep()`
may be passed a different solution, possibly changed by the event handler. `TSPostEvaluate()` is called after the next step
solution is evaluated allowing to modify it, if need be. The solution can be obtained with `TSGetSolution()`, the time step
with `TSGetTimeStep()`, and the time at the start of the step is available via `TSGetTime()`


## See Also
 [](chapter_ts), `TS`, `TSSetPreStage()`, `TSSetPreStep()`, `TSSetPostStep()`, `TSGetApplicationContext()`

## Level
intermediate

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


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