:orphan:
# DMAdaptorAdapt
Creates a new `DM` that is adapted to the problem 
## Synopsis
```
#include "petscdmadaptor.h" 
PetscErrorCode DMAdaptorAdapt(DMAdaptor adaptor, Vec x, DMAdaptationStrategy strategy, DM *adm, Vec *ax)
```
Not Collective


## Input Parameters

- ***adaptor  -*** The `DMAdaptor` object
- ***x        -*** The global approximate solution
- ***strategy -*** The adaptation strategy



## Output Parameters

- ***adm -*** The adapted `DM`
- ***ax  -*** The adapted solution



## Options database Keys

- ***-snes_adapt <strategy> -*** initial, sequential, multigrid
- ***-adapt_gradient_view -*** View the Clement interpolant of the solution gradient
- ***-adapt_hessian_view -*** View the Clement interpolant of the solution Hessian
- ***-adapt_metric_view -*** View the metric tensor for adaptive mesh refinement





## Note

## The available adaptation strategies are

- **** -*** Adapt the initial mesh until a quality metric, e.g., a priori error bound, is satisfied
- **** -*** Solve the problem on a series of adapted meshes until a quality metric, e.g. a posteriori error bound, is satisfied
- **** -*** Solve the problem on a hierarchy of adapted meshes generated to satisfy a quality metric using multigrid



## See Also
 `DMAdaptor`, `DMAdaptorSetSolver()`, `DMAdaptorCreate()`, `DMAdaptorAdapt()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/snes/utils/dmadapt.c.html#DMAdaptorAdapt">src/snes/utils/dmadapt.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/snes/utils/dmadapt.c)


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