DMFieldRegister — PETSc 3.23.0 documentation

Skip to main content
`Ctrl`+`K`

# DMFieldRegister

Adds an implementation of the `DMField` object.

## Synopsis

    #include "petscdmfield.h"
    PetscErrorCode DMFieldRegister(const char sname[], PetscErrorCode (*function)(DMField))

Not collective, No Fortran Support

## Input Parameters

- sname - name of a new user-defined implementation

- function - routine to create method context

## Example Usage

       DMFieldRegister("my_impl",MyImplCreate);

Then, this implementation can be chosen with the procedural interface via

    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

Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages