:orphan:
# TSClone
This function clones a time step `TS` object. 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSClone(TS tsin, TS *tsout)
```
Collective


## Input Parameter

- ***tsin    -*** The input `TS`



## Output Parameter

- ***tsout   -*** The output `TS` (cloned)





## Notes
This function is used to create a clone of a `TS` object. It is used in `TSARKIMEX` for initializing the slope for first stage explicit methods.
It will likely be replaced in the future with a mechanism of switching methods on the fly.

When using `TSDestroy()` on a clone the user has to first reset the correct `TS` reference in the embedded `SNES` object: e.g., by running
```none
 SNES snes_dup = NULL;
 TSGetSNES(ts,&snes_dup);
 TSSetSNES(ts,snes_dup);
```



## See Also
 [](ch_ts), `TS`, `SNES`, `TSCreate()`, `TSSetType()`, `TSSetUp()`, `TSDestroy()`, `TSSetProblemType()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/interface/ts.c.html#TSClone">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](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
