# DMCreateFieldDecomposition
Returns a list of `IS` objects defining a decomposition of a problem into subproblems corresponding to different fields: each `IS` contains the global indices of the dofs of the corresponding field, defined by `DMAddField()`. The optional list of `DM`s define the `DM` for each subproblem. The same as `DMCreateFieldIS()` but also returns a `DM` for each field. 
## Synopsis
```
#include "petscdm.h"          
#include "petscdmlabel.h"     
#include "petscds.h"     
PetscErrorCode DMCreateFieldDecomposition(DM dm, PetscInt *len, char ***namelist, IS **islist, DM **dmlist)
```
Not collective


## Input Parameter

- ***dm -*** the `DM` object



## Output Parameters

- ***len       -*** The number of fields (or NULL if not requested)
- ***namelist  -*** The name for each field (or NULL if not requested)
- ***islist    -*** The global indices for each field (or NULL if not requested)
- ***dmlist    -*** The `DM`s for each field subproblem (or NULL, if not requested; if NULL is returned, no `DM`s are defined)





## Note
The user is responsible for freeing all requested arrays. In particular, every entry of names should be freed with
`PetscFree()`, every entry of is should be destroyed with `ISDestroy()`, every entry of dm should be destroyed with `DMDestroy()`,
and all of the arrays should be freed with `PetscFree()`.


## Fortran Note
Not available in Fortran.


## Developer Note
It is not clear why this function and `DMCreateFieldIS()` exist. Having two seems redundant and confusing.


## See Also
 `DMAddField()`, `DMCreateFieldIS()`, `DMCreateSubDM()`, `DMCreateDomainDecomposition()`, `DMDestroy()`, `DMView()`, `DMCreateInterpolation()`, `DMCreateColoring()`, `DMCreateMatrix()`, `DMCreateMassMatrix()`, `DMCreateFieldIS()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/interface/dm.c.html#DMCreateFieldDecomposition">src/dm/interface/dm.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex43.c.html">src/ksp/ksp/tutorials/ex43.c.html</A><BR>

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/composite/pack.c.html#DMCreateFieldDecomposition_Composite">DMCreateFieldDecomposition_Composite in src/dm/impls/composite/pack.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/da/dacreate.c.html#DMCreateFieldDecomposition_DA">DMCreateFieldDecomposition_DA in src/dm/impls/da/dacreate.c</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/stag/stag.c.html#DMCreateFieldDecomposition_Stag">DMCreateFieldDecomposition_Stag in src/dm/impls/stag/stag.c</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/interface/dm.c)


[Index of all DM routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
