Skip to main content
`Ctrl`+`K`

# 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

DM Basics, `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

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