:orphan:
# TSRegister
Adds a creation method to the `TS` package. 
## Synopsis
```
#include "petscts.h"  
PetscErrorCode TSRegister(const char sname[], PetscErrorCode (*function)(TS))
```
Not Collective


## Input Parameters

- ***sname        -*** The name of a new user-defined creation routine
- ***function -*** The creation routine itself





## Notes
`TSRegister()` may be called multiple times to add several user-defined tses.


## Sample usage
```none
  TSRegister("my_ts",  MyTSCreate);
```


Then, your ts type can be chosen with the procedural interface via
```none
    TS ts;
    TSCreate(MPI_Comm, &ts);
    TSSetType(ts, "my_ts")
```

or at runtime via the option
```none
    -ts_type my_ts
```



## See Also
 [](ch_ts), `TSSetType()`, `TSType`, `TSRegisterAll()`, `TSRegisterDestroy()`

## Level
advanced

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


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/ts/interface/tsreg.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)  
