:orphan: # DMFieldRegister Adds an implementation of the `DMField` object. ## Synopsis ``` #include "petscdmfield.h" PetscErrorCode DMFieldRegister(const char sname[], PetscErrorCode (*function)(DMField)) ``` Not collective ## Input Parameters - ***sname -*** name of a new user-defined implementation - ***function -*** 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 src/dm/field/interface/dmfieldregi.c --- [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](/manualpages/index.md) [Index of all manual pages](/manualpages/singleindex.md)