:orphan:
# DMLabelRegister
Adds a new label component implementation 
## Synopsis
```
#include "petscdmlabel.h"   
#include "petscsection.h"   
PetscErrorCode DMLabelRegister(const char name[], PetscErrorCode (*create_func)(DMLabel))
```
Not Collective


## Input Parameters

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



## Notes
`DMLabelRegister()` may be called multiple times to add several user-defined labels


## Sample usage
```none
  DMLabelRegister("my_label", MyLabelCreate);
```


Then, your label type can be chosen with the procedural interface via
```none
  DMLabelCreate(MPI_Comm, DMLabel *);
  DMLabelSetType(DMLabel, "my_label");
```

or at runtime via the option
```none
  -dm_label_type my_label
```





## See Also
 `DMLabel`, `DM`, `DMLabel`, `DMLabelType`, `DMLabelRegisterAll()`, `DMLabelRegisterDestroy()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/label/dmlabel.c.html#DMLabelRegister">src/dm/label/dmlabel.c</A>


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


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