# TSSetExactFinalTime
Determines whether to adapt the final time step to match the exact final time, interpolate solution to the exact final time, or just return at the final time TS computed. 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSSetExactFinalTime(TS ts, TSExactFinalTimeOption eftopt)
```
Logically Collective on TS


## Input Parameters

- ***ts -*** the time-step context
- ***eftopt -*** exact final time option



```none
TS_EXACTFINALTIME_STEPOVER    - Don't do anything if final time is exceeded
```
```none
TS_EXACTFINALTIME_INTERPOLATE - Interpolate back to final time
```
```none
TS_EXACTFINALTIME_MATCHSTEP - Adapt final time step to match the final time
```


## Options Database

- ***-ts_exact_final_time <stepover,interpolate,matchstep> -*** select the final step at runtime


Warning: If you use the option TS_EXACTFINALTIME_STEPOVER the solution may be at a very different time
then the final time you selected.




## See Also
 `TSExactFinalTimeOption`, `TSGetExactFinalTime()`

## Level
beginner

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex1.c.html">src/ts/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex10.c.html">src/ts/tutorials/ex10.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex11.c.html">src/ts/tutorials/ex11.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex11_sa.c.html">src/ts/tutorials/ex11_sa.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex12.c.html">src/ts/tutorials/ex12.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex13.c.html">src/ts/tutorials/ex13.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex14.c.html">src/ts/tutorials/ex14.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex15.c.html">src/ts/tutorials/ex15.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex16.c.html">src/ts/tutorials/ex16.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex16fwd.c.html">src/ts/tutorials/ex16fwd.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex17.c.html">src/ts/tutorials/ex17.c.html</A><BR>


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