:orphan:
# PetscDSGetNumFields
Returns the number of fields in the `PetscDS`
## Synopsis
```
#include "petscds.h"
PetscErrorCode PetscDSGetNumFields(PetscDS prob, PetscInt *Nf)
```
Not Collective
## Input Parameter
- ***prob -*** The `PetscDS` object
## Output Parameter
- ***Nf -*** The number of fields
## See Also
`PetscDS`, `PetscDSGetSpatialDimension()`, `PetscDSCreate()`
## Level
beginner
## Location
src/dm/dt/interface/dtds.c
## Examples
src/snes/tutorials/ex26.c
src/ts/tutorials/ex18.c
src/ts/tutorials/ex53.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/dt/interface/dtds.c)
[Index of all DT routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)