# VecNestSetSubVecs
Sets the component vectors at the specified indices in a nest vector. 
## Synopsis
```
#include "petscvec.h"   
PetscErrorCode VecNestSetSubVecs(Vec X, PetscInt N, PetscInt *idxm, Vec *sx)
```
Not collective


## Input Parameters

- ***X  -*** nest vector
- ***N -*** number of component vecs in sx
- ***idxm -*** indices of component vecs that are to be replaced
- ***sx -*** array of vectors



## Notes
The components in the vector array sx do not have to be of the same size as corresponding
components in X. The user can also free the array "sx" after the call.




## See Also
 `VecNestGetSize()`, `VecNestGetSubVec()`

## Level
developer

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

## Implementations

<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/impls/nest/vecnest.c.html#VecNestSetSubVecs_Nest">VecNestSetSubVecs_Nest in src/vec/vec/impls/nest/vecnest.c</A><BR>


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