Skip to main content
`Ctrl`+`K`

# 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

## Input Parameters

- dm - The `DM` object

- method - The name of the `DMType`, for example `DMDA`, `DMPLEX`

## Options Database Key

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

## Note

Of the `DM` is constructed by directly calling a function to construct a particular `DM`, for example, `DMDACreate2d()` or `DMPlexCreateBoxMesh()`

## See Also

DM Basics, `DM`, `DMType`, `DMDA`, `DMPLEX`, `DMGetType()`, `DMCreate()`, `DMDACreate2d()`

## Level

intermediate

## Location

src/dm/interface/dm.c

## Examples

src/dm/impls/plex/tutorials/ex5.c
src/dm/impls/plex/tutorials/ex11.c
src/dm/impls/plex/tutorials/ex14.c
src/dm/impls/forest/tutorials/ex1.c
src/dm/impls/plex/tutorials/ex9.c
src/dm/impls/plex/tutorials/ex17.c
src/dm/impls/plex/tutorials/ex1.c
src/dm/impls/plex/tutorials/ex6.c
src/dm/impls/plex/tutorials/ex7.c
src/dm/field/tutorials/ex1.c

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