:orphan:
# PetscSectionSetNumFields
Sets the number of fields in a `PetscSection`
## Synopsis
```
#include "petscsection.h"
PetscErrorCode PetscSectionSetNumFields(PetscSection s, PetscInt numFields)
```
Not Collective
## Input Parameters
- ***s -*** the `PetscSection`
- ***numFields -*** the number of fields
## Notes
Calling this destroys all the information in the `PetscSection` including the chart.
You must call `PetscSectionSetChart()` after calling this.
## See Also
[PetscSection](sec_petscsection), `PetscSection`, `PetscSectionGetNumFields()`, `PetscSectionSetChart()`, `PetscSectionReset()`
## Level
intermediate
## Location
src/vec/is/section/interface/section.c
## Examples
src/dm/impls/plex/tutorials/ex7.c
src/ts/tutorials/ex11_sa.c
---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/is/section/interface/section.c)
[Index of all PetscSection routines](index.md)
[Table of Contents for all manual pages](/manualpages/index.md)
[Index of all manual pages](/manualpages/singleindex.md)