# VecCreateNest
Creates a new vector containing several nested subvectors, each stored separately 
## Synopsis
```
#include "petscvec.h"   
PetscErrorCode VecCreateNest(MPI_Comm comm, PetscInt nb, IS is[], Vec x[], Vec *Y)
```
Collective


## Input Parameters

- ***comm -*** Communicator for the new `Vec`
- ***nb -*** number of nested blocks
- ***is -*** array of nb index sets describing each nested block, or NULL to pack subvectors contiguously
- ***x -*** array of nb sub-vectors



## Output Parameter

- ***Y -*** new vector





## See Also
 `VecCreate()`, `MatCreateNest()`, `DMSetVecType()`, `VECNEST`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/nest/vecnest.c.html#VecCreateNest">src/vec/vec/impls/nest/vecnest.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/vec/impls/nest/vecnest.c)


[Index of all Vec routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
