:orphan:
# DMForestTemplate
Create a new `DM` that will be adapted from a source `DM`.  The new `DM` reproduces the configuration of the source, but is not yet setup, so that the user can then define only the ways that the new `DM` should differ (by, e.g., refinement or repartitioning).  The source `DM` is also set as the adaptivity source `DM` of the new `DM` (see `DMForestSetAdaptivityForest()`). 
## Synopsis
```
#include "petscdmforest.h" 
#include "petscdm.h" 
#include "petscdmlabel.h" 
PetscErrorCode DMForestTemplate(DM dm, MPI_Comm comm, DM *tdm)
```
Collective


## Input Parameters

- ***dm -*** the source `DM` object
- ***comm -*** the communicator for the new `DM` (this communicator is currently ignored, but is present so that `DMForestTemplate()` can be used within `DMCoarsen()`)



## Output Parameter

- ***tdm -*** the new `DM` object





## See Also
 `DM`, `DMFOREST`, `DMForestSetAdaptivityForest()`

## Level
intermediate

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/forest/p4est/pforest.h.html#DMForestTemplate_pforest">DMForestTemplate_pforest in src/dm/impls/forest/p4est/pforest.h</A><BR>


---
[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](/manualpages/index.md)  
[Index of all manual pages](/manualpages/singleindex.md)  
