:orphan: # DMCreateRestriction Gets restriction matrix between two `DM` objects. The resulting matrix map degrees of freedom in the vector obtained by `DMCreateGlobalVector()` on the fine `DM` to similar vectors on the coarse grid `DM`. ## Synopsis ``` #include "petscdm.h" #include "petscdmlabel.h" #include "petscds.h" PetscErrorCode DMCreateRestriction(DM dmc, DM dmf, Mat *mat) ``` Collective ## Input Parameters - ***dmc -*** the `DM` object - ***dmf -*** the second, finer `DM` object ## Output Parameter - ***mat -*** the restriction ## Note This only works for `DMSTAG`. For many situations either the transpose of the operator obtained with `DMCreateInterpolation()` or that matrix multiplied by the vector obtained with `DMCreateInterpolationScale()` provides the desired object. ## See Also [](ch_dmbase), `DM`, `DMRestrict()`, `DMInterpolate()`, `DMDestroy()`, `DMView()`, `DMCreateGlobalVector()`, `DMCreateColoring()`, `DMCreateMatrix()`, `DMCreateMassMatrix()`, `DMRefine()`, `DMCoarsen()`, `DMCreateInterpolation()` ## Level developer ## Location src/dm/interface/dm.c ## Examples src/dm/impls/stag/tutorials/ex4.c
## Implementations DMCreateRestriction_Stag in src/dm/impls/stag/stag.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)