# DMMGSetDM

Sets the coarse grid information for the grids

### Synopsis

    #include "petscda.h"
    #include "petscksp.h"
    #include "petscmg.h"
    #include "petscdmmg.h"
    #include "petscpc.h"
    PetscErrorCode PETSCSNES_DLLEXPORT DMMGSetDM(DMMG *dmmg, DM dm)

Collective on DMMG

### Input Parameter

| dmmg | - the context
| dm | - the DA or DMComposite object

### Options Database Keys

| -dmmg_refine: Use the input problem as the coarse level and refine. Otherwise, use it as the fine level and coarsen. | - - -dmmg_hierarchy: Construct all grids at once

### See Also

DMMGCreate(), DMMGDestroy(), DMMGSetUseGalerkin(), DMMGSetMatType()

Level:advanced
Location:src/snes/utils/damg.c
Index of all DA routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/ksp/ksp/examples/tutorials/ex22.c.html
src/ksp/ksp/examples/tutorials/ex25.c.html
src/ksp/ksp/examples/tutorials/ex28.c.html
src/ksp/ksp/examples/tutorials/ex29.c.html
src/ksp/ksp/examples/tutorials/ex32.c.html
src/ksp/ksp/examples/tutorials/ex33.c.html
src/ksp/ksp/examples/tutorials/ex34.c.html
src/ksp/ksp/examples/tutorials/ex22f.F.html
src/snes/examples/tutorials/ex18.c.html
src/snes/examples/tutorials/ex19.c.html
src/snes/examples/tutorials/ex20.c.html