:orphan:
# DMFieldGetNumComponents
Returns the number of components in the field
## Synopsis
```
#include "petscdmfield.h"
#include "petscdmfield.h"
PetscErrorCode DMFieldGetNumComponents(DMField field, PetscInt *nc)
```
Not Collective
## Input Parameter
- ***field -*** The `DMField` object
## Output Parameter
- ***nc -*** The number of field components
## See Also
`DMField`, `DMFieldEvaluate()`
## Level
intermediate
## Location
src/dm/field/interface/dmfield.c
## Examples
src/dm/field/tutorials/ex1.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/field/interface/dmfield.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)