# DMAdaptMetric
Generates a mesh adapted to the specified metric field. 
## Synopsis
```
#include "petscdm.h"          
PetscErrorCode DMAdaptMetric(DM dm, Vec metric, DMLabel bdLabel, DMLabel rgLabel, DM *dmAdapt)
```

## Input Parameters

- ***dm -*** The DM object
- ***metric -*** The metric to which the mesh is adapted, defined vertex-wise.
- ***bdLabel -*** Label for boundary tags, which will be preserved in the output mesh. bdLabel should be NULL if there is no such label, and should be different from "_boundary_".
- ***rgLabel -*** Label for cell tags, which will be preserved in the output mesh. rgLabel should be NULL if there is no such label, and should be different from "_regions_".



## Output Parameter

- ***dmAdapt  -*** Pointer to the DM object containing the adapted mesh


Note: The label in the adapted mesh will be registered under the name of the input DMLabel object




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

## Level
advanced

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


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