# DMAdaptLabel
Adapt a dm based on a label with values interpreted as coarsening and refining flags.  Specific implementations of DM maybe have specialized flags, but all implementations should accept flag values DM_ADAPT_DETERMINE, DM_ADAPT_KEEP, DM_ADAPT_REFINE, and DM_ADAPT_COARSEN. 
## Synopsis
```
#include "petscdm.h"          
PetscErrorCode DMAdaptLabel(DM dm, DMLabel label, DM *dmAdapt)
```
Collective on dm


## Input parameters

- ***dm -*** the pre-adaptation DM object
- ***label -*** label with the flags



## Output parameters

- ***dmAdapt -*** the adapted DM object: may be NULL if an adapted DM could not be produced.





## See Also
 `DMAdaptMetric()`, `DMCoarsen()`, `DMRefine()`

## Level
intermediate

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/tutorials/ex10.c.html">src/dm/impls/plex/tutorials/ex10.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ts/tutorials/ex11.c.html">src/ts/tutorials/ex11.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/forest/forest.c.html#DMAdaptLabel_Forest">DMAdaptLabel_Forest in src/dm/impls/forest/forest.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/plex/plexadapt.c.html#DMAdaptLabel_Plex">DMAdaptLabel_Plex in src/dm/impls/plex/plexadapt.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/interface/dmgenerate.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)  
