# PetscSectionCreateSubsection
Create a new, smaller section composed of only the 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 section offsets now refer to a new, smaller vector.

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](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
