:orphan:
# DMCreateFieldIS
Creates a set of `IS` objects with the global indices of dofs for each field defined with `DMAddField()`
## Synopsis
```
#include "petscdm.h"
#include "petscdmlabel.h"
#include "petscds.h"
PetscErrorCode DMCreateFieldIS(DM dm, PetscInt *numFields, char ***fieldNames, IS **fields)
```
Not Collective; No Fortran Support
## Input Parameter
- ***dm -*** the `DM` object
## Output Parameters
- ***numFields -*** The number of fields (or `NULL` if not requested)
- ***fieldNames -*** The number of each field (or `NULL` if not requested)
- ***fields -*** The global indices for each field (or `NULL` if not requested)
## Note
The user is responsible for freeing all requested arrays. In particular, every entry of names should be freed with
`PetscFree()`, every entry of fields should be destroyed with `ISDestroy()`, and both arrays should be freed with
`PetscFree()`.
## Developer Note
It is not clear why both this function and `DMCreateFieldDecomposition()` exist. Having two seems redundant and confusing. This function should
likely be removed.
## See Also
[](ch_dmbase), `DM`, `DMAddField()`, `DMGetField()`, `DMDestroy()`, `DMView()`, `DMCreateInterpolation()`, `DMCreateColoring()`, `DMCreateMatrix()`,
`DMCreateFieldDecomposition()`
## Level
intermediate
## Location
src/dm/interface/dm.c
## Implementations
DMCreateFieldIS_Composite in src/dm/impls/composite/pack.c
---
[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](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)