# DMFieldRegister
Adds an implementation of the `DMField` object. 
## Synopsis
```
#include "petscdmfield.h"  
PetscErrorCode DMFieldRegister(const char sname[], PetscErrorCode (*function)(DMField))
```
Not collective


## Input Parameters

- ***name_impl -*** name of a new user-defined implementation
- ***routine_create -*** routine to create method context



## Sample usage
```none
   DMFieldRegister("my_impl",MyImplCreate);
```


Then, this implementation can be chosen with the procedural interface via
```none
DMFieldSetType(tagger,"my_impl")
```




## Note
`DMFieldRegister()` may be called multiple times to add several user-defined implementations.


## See Also
 `DMField`, `DMFieldRegisterAll()`, `DMFieldRegisterDestroy()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/field/interface/dmfieldregi.c.html#DMFieldRegister">src/dm/field/interface/dmfieldregi.c</A>


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


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