# PetscDualSpaceRegister
Adds a new `PetscDualSpaceType` 
## Synopsis
```
#include "petscfe.h" 
PetscErrorCode PetscDualSpaceRegister(const char sname[], PetscErrorCode (*function)(PetscDualSpace))
```
Not Collective


## Input Parameters

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



## Sample usage
```none
    PetscDualSpaceRegister("my_space", MyPetscDualSpaceCreate);
```


Then, your PetscDualSpace type can be chosen with the procedural interface via
```none
    PetscDualSpaceCreate(MPI_Comm, PetscDualSpace *);
    PetscDualSpaceSetType(PetscDualSpace, "my_dual_space");
```

or at runtime via the option
```none
    -petscdualspace_type my_dual_space
```





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


## See Also
 `PetscDualSpace`, `PetscDualSpaceType`, `PetscDualSpaceRegisterAll()`, `PetscDualSpaceRegisterDestroy()`

## Level
advanced

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


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


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