# DMRestrict
restricts user-defined problem data to a coarser `DM` by running hooks registered by `DMCoarsenHookAdd()` 
## Synopsis
```
#include "petscdm.h"          
#include "petscdmlabel.h"     
#include "petscds.h"     
PetscErrorCode DMRestrict(DM fine, Mat restrct, Vec rscale, Mat inject, DM coarse)
```
Collective if any hooks are


## Input Parameters

- ***fine -*** finer `DM` from which the data is obtained
- ***restrct -*** restriction matrix, apply using `MatRestrict()`, usually the transpose of the interpolation
- ***rscale -*** scaling vector for restriction
- ***inject -*** injection matrix, also use `MatRestrict()`
- ***coarse -*** coarser DM to update





## Developer Note
Though this routine is called `DMRestrict()` the hooks are added with `DMCoarsenHookAdd()`, a consistent terminology would be better


## See Also
 `DMCoarsenHookAdd()`, `MatRestrict()`, `DMInterpolate()`, `DMRefineHookAdd()`

## Level
developer

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


---
[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)  
