# DMForestSetMaximumRefinement
During the pre-setup phase, set the maximum level of refinement (relative to the base DM, see DMForestGetBaseDM()) allowed in the forest.  If the forest is being created by refining a previous forest (see DMForestGetAdaptivityForest()), this limits the amount of refinement. 
## Synopsis
```
#include "petscdmforest.h" 
#include "petscdm.h" 
#include "petscdmlabel.h" 
PetscErrorCode DMForestSetMaximumRefinement(DM dm, PetscInt maxRefinement)
```
Logically collective on dm


## Input Parameters

- ***dm -*** the forest
- ***maxRefinement -*** default PETSC_DEFAULT (interpreted by the subtype of DMForest)





## See Also
 `DMForestGetMinimumRefinement()`, `DMForestSetMaximumRefinement()`, `DMForestSetInitialRefinement()`, `DMForestGetBaseDM()`, `DMForestGetAdaptivityDM()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/forest/forest.c.html#DMForestSetMaximumRefinement">src/dm/impls/forest/forest.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/forest/forest.c)


[Index of all DMForest routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
