# DMStagCreateCompatibleDMStag
create a compatible `DMSTAG` with different dof/stratum 
## Synopsis
```
PetscErrorCode DMStagCreateCompatibleDMStag(DM dm, PetscInt dof0, PetscInt dof1, PetscInt dof2, PetscInt dof3, DM *newdm)
```
Collective


## Input Parameters

- ***dm -*** the `DMSTAG` object
- ***dof0 -*** number of dof on the first stratum in the new `DMSTAG`
- ***dof1 -*** number of dof on the second stratum in the new `DMSTAG`
- ***dof2 -*** number of dof on the third stratum in the new `DMSTAG`
- ***dof3 -*** number of dof on the fourth stratum in the new `DMSTAG`



## Output Parameter

- ***newdm -*** the new, compatible `DMSTAG`





## Notes
DOF supplied for strata too big for the dimension are ignored; these may be set to `0`.
For example, for a 2-dimensional `DMSTAG`, `dof2` sets the number of dof per element,
and `dof3` is unused. For a 3-dimensional `DMSTAG`, `dof3` sets the number of DOF per element.

In contrast to `DMDACreateCompatibleDMDA()`, coordinates are not reused.


## See Also
 [](chapter_stag), `DMSTAG`, `DMDACreateCompatibleDMDA()`, `DMGetCompatibility()`, `DMStagMigrateVec()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/stag/stagutils.c.html#DMStagCreateCompatibleDMStag">src/dm/impls/stag/stagutils.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/stag/tutorials/ex1.c.html">src/dm/impls/stag/tutorials/ex1.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/stag/tutorials/ex2.c.html">src/dm/impls/stag/tutorials/ex2.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/stag/tutorials/ex3.c.html">src/dm/impls/stag/tutorials/ex3.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/stag/tutorials/ex4.c.html">src/dm/impls/stag/tutorials/ex4.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/stag/tutorials/ex6.c.html">src/dm/impls/stag/tutorials/ex6.c.html</A><BR>


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


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