Skip to main content
`Ctrl`+`K`

# DMCreateDomainDecomposition

Returns lists of `IS` objects defining a decomposition of a problem into subproblems corresponding to restrictions to pairs of nested subdomains.

## Synopsis

    #include "petscdm.h"
    #include "petscdmlabel.h"
    #include "petscds.h"
    PetscErrorCode DMCreateDomainDecomposition(DM dm, PetscInt *n, char ***namelist, IS *innerislist[], IS *outerislist[], DM *dmlist[])

Not Collective

## Input Parameter

- dm - the `DM` object

## Output Parameters

- n - The number of subproblems in the domain decomposition (or `NULL` if not requested), also the length of the four arrays below

- namelist - The name for each subdomain (or `NULL` if not requested)

- innerislist - The global indices for each inner subdomain (or `NULL`, if not requested)

- outerislist - The global indices for each outer subdomain (or `NULL`, if not requested)

- dmlist - The `DM`s for each subdomain subproblem (or `NULL`, if not requested; if `NULL` is returned, no `DM`s are defined)

## Notes

Each `IS` contains the global indices of the dofs of the corresponding subdomains with in the dofs of the original `DM`. The inner subdomains conceptually define a nonoverlapping covering, while outer subdomains can overlap.

The optional list of `DM`s define a `DM` for each subproblem.

The user is responsible for freeing all requested arrays. In particular, every entry of `namelist` should be freed with `PetscFree()`, every entry of `innerislist` and `outerislist` should be destroyed with `ISDestroy()`, every entry of `dmlist` should be destroyed with `DMDestroy()`, and all of the arrays should be freed with `PetscFree()`.

## Developer Notes

The `dmlist` is for the inner subdomains or the outer subdomains or all subdomains?

The names are inconsistent, the hooks use `DMSubDomainHook` which is nothing like `DMCreateDomainDecomposition()` while `DMRefineHook` is used for `DMRefine()`.

## See Also

DM Basics, `DM`, `DMCreateFieldDecomposition()`, `DMDestroy()`, `DMCreateDomainDecompositionScatters()`, `DMView()`, `DMCreateInterpolation()`, `DMSubDomainHookAdd()`, `DMSubDomainHookRemove()`,`DMCreateColoring()`, `DMCreateMatrix()`, `DMCreateMassMatrix()`, `DMRefine()`, `DMCoarsen()`

## Level

intermediate

## Location

src/dm/interface/dm.c

## Examples

src/dm/tutorials/ex14.c

## Implementations

DMCreateDomainDecomposition_DA() in src/dm/impls/da/dadd.c
DMCreateDomainDecomposition_pforest() in src/dm/impls/forest/p4est/pforest.h
DMCreateDomainDecomposition_Plex() in src/dm/impls/plex/plexdd.c

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