:orphan:
# DMGetRefineLevel
Gets the number of refinements that have generated this `DM` from some initial `DM`.
## Synopsis
```
#include "petscdm.h"
#include "petscdmlabel.h"
#include "petscds.h"
PetscErrorCode DMGetRefineLevel(DM dm, PetscInt *level)
```
Not Collective
## Input Parameter
- ***dm -*** the `DM` object
## Output Parameter
- ***level -*** number of refinements
## Note
This can be used, by example, to set the number of coarser levels associated with this `DM` for a multigrid solver.
## See Also
[](ch_dmbase), `DM`, `DMRefine()`, `DMCoarsen()`, `DMGetCoarsenLevel()`, `DMDestroy()`, `DMView()`, `DMCreateGlobalVector()`, `DMCreateInterpolation()`
## Level
developer
## Location
src/dm/interface/dm.c
## Examples
src/ksp/ksp/tutorials/ex65.c
src/snes/tutorials/ex48.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)