:orphan: # DMGetField Return the `DMLabel` and discretization object for a given `DM` field ## Synopsis ``` #include "petscdm.h" #include "petscdmlabel.h" #include "petscds.h" PetscErrorCode DMGetField(DM dm, PetscInt f, DMLabel *label, PetscObject *disc) ``` Not Collective ## Input Parameters - ***dm -*** The `DM` - ***f -*** The field number ## Output Parameters - ***label -*** The label indicating the support of the field, or `NULL` for the entire mesh (pass in `NULL` if not needed) - ***disc -*** The discretization object (pass in `NULL` if not needed) ## See Also [](ch_dmbase), `DM`, `DMAddField()`, `DMSetField()` ## Level intermediate ## Location src/dm/interface/dm.c ## Examples src/snes/tutorials/ex56.c
src/snes/tutorials/ex62.c
src/snes/tutorials/ex63.c
src/snes/tutorials/ex69.c
src/snes/tutorials/ex77.c
src/ts/tutorials/ex46.c
src/ts/tutorials/ex76.c
src/ts/tutorials/ex77.c
--- [Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/interface/dm.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)