Skip to main content
`Ctrl`+`K`

# DMRefine

Refines a `DM` object using a standard nonadaptive refinement of the underlying mesh

## Synopsis

    #include "petscdm.h"
    #include "petscdmlabel.h"
    #include "petscds.h"
    PetscErrorCode DMRefine(DM dm, MPI_Comm comm, DM *dmf)

Collective

## Input Parameters

- dm - the `DM` object

- comm - the communicator to contain the new `DM` object (or `MPI_COMM_NULL`)

## Output Parameter

- dmf - the refined `DM`, or `NULL`

## Options Database Key

- -dm_plex_cell_refiner - chooses the refinement strategy, e.g. regular, tohex

## Note

If no refinement was done, the return value is `NULL`

## See Also

DM Basics, `DM`, `DMCoarsen()`, `DMDestroy()`, `DMView()`, `DMCreateGlobalVector()`, `DMCreateInterpolation()`, `DMCreateDomainDecomposition()`, `DMRefineHookAdd()`, `DMRefineHookRemove()`

## Level

developer

## Location

src/dm/interface/dm.c

## Examples

src/ksp/ksp/tutorials/ex36.cxx
src/dm/tutorials/ex3.c
src/snes/tutorials/ex56.c
src/ksp/ksp/tutorials/ex73.c
src/ksp/ksp/tutorials/ex65.c
src/ts/tutorials/ex30.c
src/ksp/ksp/tutorials/ex35.cxx
src/dm/impls/plex/tutorials/ex11.c

## Implementations

DMRefine_Composite() in src/dm/impls/composite/pack.c
DMRefine_DA() in src/dm/impls/da/da.c
DMRefine_Forest() in src/dm/impls/forest/forest.c
DMRefine_Moab() in src/dm/impls/moab/dmmbmg.cxx
DMRefine_Plex() in src/dm/impls/plex/plexrefine.c
DMRefine_Redundant() in src/dm/impls/redundant/dmredundant.c
DMRefine_Stag() in src/dm/impls/stag/stag.c

Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages