:orphan:
# PetscSectionCreateSubsection
Create a new, smaller `PetscSection` composed of only selected fields 
## Synopsis
```
#include "petscsection.h"   
PetscErrorCode PetscSectionCreateSubsection(PetscSection s, PetscInt len, const PetscInt fields[], PetscSection *subs)
```
Collective


## Input Parameters

- ***s      -*** the `PetscSection`
- ***len    -*** the number of subfields
- ***fields -*** the subfield numbers



## Output Parameter

- ***subs   -*** the subsection





## Notes
The chart of `subs` is the same as the chart of `s`

This will error if a fieldnumber is out of range


## See Also
 [PetscSection](sec_petscsection), `PetscSection`, `PetscSectionCreateSupersection()`, `PetscSectionCreate()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/is/section/interface/section.c.html#PetscSectionCreateSubsection">src/vec/is/section/interface/section.c</A>


---
[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)  
