petsc-3.10.5 2019-03-28
Report Typos and Errors

# DMSetType

Builds a DM, for a particular DM implementation.

### Synopsis

    #include "petscdm.h"
    #include "petscdmlabel.h"
    #include "petscds.h"
    PetscErrorCode  DMSetType(DM dm, DMType method)

Collective on DM

### Input Parameters

| dm | - The DM object
| method | - The name of the DM type

### Options Database Key

-dm_type <type> -Sets the DM type; use -help for a list of available types

### Notes

See "petsc/include/petscdm.h" for available DM types (for instance, DM1D, DM2D, or DM3D).

### Keywords

DM, set, type

### See Also

DMGetType(), DMCreate()

### Level

intermediate

### Location

src/dm/interface/dm.c

### Examples

src/dm/impls/plex/examples/tutorials/ex5.c.html
src/dm/impls/forest/examples/tutorials/ex1.c.html
src/dm/examples/tutorials/ex20.c.html
src/dm/examples/tutorials/swarm_ex1.c.html
src/dm/examples/tutorials/swarm_ex2.c.html
src/dm/examples/tutorials/swarm_ex3.c.html
src/ksp/ksp/examples/tutorials/ex70.c.html
src/ts/examples/tutorials/ex11.c.html
Index of all DM routines
Table of Contents for all manual pages
Index of all manual pages