# DMMGSolve

Actually solves the (non)linear system defined with the DMMG

### Synopsis

    #include "petscda.h"
    #include "petscksp.h"
    #include "petscmg.h"
    #include "petscdmmg.h"
    #include "petscpc.h"
    PetscErrorCode PETSCSNES_DLLEXPORT DMMGSolve(DMMG *dmmg)

Collective on DMMG

### Input Parameter

dmmg - the context

### Options Database

| -dmmg_grid_sequence | - use grid sequencing to get the initial solution for each level from the previous
| -dmmg_monitor_solution | - display the solution at each iteration

Notes: For linear (KSP) problems may be called more than once, uses the same matrices but recomputes the right hand side for each new solve. Call DMMGSetKSP() to generate new matrices.

### See Also

DMMGCreate(), DMMGDestroy(), DMMG, DMMGSetSNES(), DMMGSetKSP(), DMMGSetUp(), 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