# 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 on dmc


## 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
 `DMRestrict()`, `DMInterpolate()`, `DMDestroy()`, `DMView()`, `DMCreateGlobalVector()`, `DMCreateColoring()`, `DMCreateMatrix()`, `DMCreateMassMatrix()`, `DMRefine()`, `DMCoarsen()`, `DMCreateInterpolation()`

## Level
developer

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/interface/dm.c.html#DMCreateRestriction">src/dm/interface/dm.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/stag/tutorials/ex4.c.html">src/dm/impls/stag/tutorials/ex4.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/stag/stag.c.html#DMCreateRestriction_Stag">DMCreateRestriction_Stag in src/dm/impls/stag/stag.c</A><BR>


---
[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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
