# PetscDSRegister
Adds a new `PetscDS` implementation 
## Synopsis
```
#include "petscds.h" 
PetscErrorCode PetscDSRegister(const char sname[], PetscErrorCode (*function)(PetscDS))
```
Not Collective


## Input Parameters

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



## Sample usage
```none
    PetscDSRegister("my_ds", MyPetscDSCreate);
```


Then, your PetscDS type can be chosen with the procedural interface via
```none
    PetscDSCreate(MPI_Comm, PetscDS *);
    PetscDSSetType(PetscDS, "my_ds");
```

or at runtime via the option
```none
    -petscds_type my_ds
```





## Note
`PetscDSRegister()` may be called multiple times to add several user-defined `PetscDSs`


## Fortran Note
Not available from Fortran


## See Also
 `PetscDSType`, `PetscDS`, `PetscDSRegisterAll()`, `PetscDSRegisterDestroy()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/dt/interface/dtds.c.html#PetscDSRegister">src/dm/dt/interface/dtds.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/dt/interface/dtds.c)


[Index of all DT routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
