Add a field to a DM object. A field is a function space defined by of a set of discretization points (geometric entities) and a discretization object that defines the function space associated with those points.

## Synopsis#

#include "petscdm.h"
#include "petscdmlabel.h"
#include "petscds.h"
PetscErrorCode DMAddField(DM dm, DMLabel label, PetscObject disc)


Logically collective on dm

## Input Parameters#

• dm - The DM

• label - The label indicating the support of the field, or NULL for the entire mesh

• disc - The discretization object

## Notes#

The label already exists or will be added to the DM with DMSetLabel().

For example, a piecewise continous pressure field can be defined by coefficients at the cell centers of a mesh and piecewise constant functions within each cell. Thus a specific function in the space is defined by the combination of a Vec containing the coefficients, a DM defining the geometry entities, a DMLabel indicating a subset of those geometric entities, and a discretization object, such as a PetscFE.

DMSetLabel(), DMSetField(), DMGetField(), PetscFE

intermediate

## Location#

src/dm/interface/dm.c

Edit on GitLab