petsc-3.7.1 2016-05-15
Report Typos and Errors

# PCMGSetLevels

Sets the number of levels to use with MG. Must be called before any other MG routine.

### Synopsis

    #include "petscksp.h"
    PetscErrorCode  PCMGSetLevels(PC pc,PetscInt levels,MPI_Comm *comms)

Logically Collective on PC Many br

### Input Parameters

| pc | - the preconditioner context Many br
| levels | - the number of levels Many br
| comms | - optional communicators for each level; this is to allow solving the coarser problems Many bron smaller sets of processors. Use NULL_OBJECT for default in Fortran Many br

Many br

### Notes

If the number of levels is one then the multigrid uses the -mg_levels prefix Many brfor setting the level options rather than the -mg_coarse prefix. Many br

### Keywords

MG, set, levels, multigrid

### See Also

PCMGSetType(), PCMGGetLevels()

Level:intermediate
Location:src/ksp/pc/impls/mg/mg.c
Index of all PC routines
Table of Contents for all manual pages
Index of all manual pages

### Examples

src/ksp/ksp/examples/tutorials/ex42.c.html