# VecStrideScatter
Scatters a single component from a vector into a multi-component vector. 
## Synopsis
```
#include "petscvec.h" 
PetscErrorCode VecStrideScatter(Vec s, PetscInt start, Vec v, InsertMode addv)
```
Collective


## Input Parameters

- ***s -*** the single-component vector
- ***start -*** starting point of the subvector (defined by a stride)
- ***addv -*** one of ADD_VALUES,INSERT_VALUES,MAX_VALUES



## Output Parameter

- ***v -*** the location where the subvector is scattered (the multi-component vector)



## Notes
One must call VecSetBlockSize() on the multi-component vector before this
routine to set the stride  information, or use a vector created from a multicomponent DMDA.

The parallel layout of the vector and the subvector must be the same;
i.e., nlocal of v = stride*(nlocal of s)

Not optimized; could be easily




## See Also
 `VecStrideNorm()`, `VecStrideGather()`, `VecStrideMin()`, `VecStrideMax()`, `VecStrideGatherAll()`,
`VecStrideScatterAll()`, `VecStrideSubSetScatter()`, `VecStrideSubSetGather()`

## Level
advanced

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/utils/vinv.c.html#VecStrideScatter">src/vec/vec/utils/vinv.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex12.c.html">src/vec/vec/tutorials/ex12.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex12f.F90.html">src/vec/vec/tutorials/ex12f.F90.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex16.c.html">src/vec/vec/tutorials/ex16.c.html</A><BR>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/vec/vec/utils/vinv.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)  
