# DMCoarsenHierarchy
Coarsens a `DM` object, all levels at once 
## Synopsis
```
#include "petscdm.h"          
#include "petscdmlabel.h"     
#include "petscds.h"     
PetscErrorCode DMCoarsenHierarchy(DM dm, PetscInt nlevels, DM dmc[])
```
Collective on dm


## Input Parameters

- ***dm -*** the `DM` object
- ***nlevels -*** the number of levels of coarsening



## Output Parameter

- ***dmc -*** the coarsened `DM` hierarchy





## See Also
 `DMCoarsen()`, `DMRefineHierarchy()`, `DMDestroy()`, `DMView()`, `DMCreateGlobalVector()`, `DMCreateInterpolation()`

## Level
developer

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex42.c.html">src/ksp/ksp/tutorials/ex42.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/da/da.c.html#DMCoarsenHierarchy_DA">DMCoarsenHierarchy_DA in src/dm/impls/da/da.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/moab/dmmbmg.cxx.html#DMCoarsenHierarchy_Moab">DMCoarsenHierarchy_Moab in src/dm/impls/moab/dmmbmg.cxx</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/plexcoarsen.c.html#DMCoarsenHierarchy_Plex">DMCoarsenHierarchy_Plex in src/dm/impls/plex/plexcoarsen.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)  
