# VecSetValuesBlockedLocal
Inserts or adds values into certain locations of a vector, using a local ordering of the nodes. 
## Synopsis
```
#include "petscvec.h"   
PetscErrorCode VecSetValuesBlockedLocal(Vec x, PetscInt ni, const PetscInt ix[], const PetscScalar y[], InsertMode iora)
```
Not Collective


## Input Parameters

- ***x -*** vector to insert in
- ***ni -*** number of blocks to add
- ***ix -*** indices where to add in block count, not element count
- ***y -*** array of values
- ***iora -*** either INSERT_VALUES or ADD_VALUES, where
ADD_VALUES adds values to any existing entries, and
INSERT_VALUES replaces existing entries with new values





## Notes
VecSetValuesBlockedLocal() sets x[bs*ix[i]+j] = y[bs*i+j],
for j=0,..bs-1, for i=0,...,ni-1, where bs has been set with VecSetBlockSize().

Calls to VecSetValuesBlockedLocal() with the INSERT_VALUES and ADD_VALUES
options cannot be mixed without intervening calls to the assembly
routines.

These values may be cached, so VecAssemblyBegin() and VecAssemblyEnd()
MUST be called after all calls to VecSetValuesBlockedLocal() have been completed.

VecSetValuesBlockedLocal() uses 0-based indices in Fortran as well as in C.


## See Also
 `VecAssemblyBegin()`, `VecAssemblyEnd()`, `VecSetValues()`, `VecSetValuesBlocked()`,
`VecSetLocalToGlobalMapping()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/interface/rvector.c.html#VecSetValuesBlockedLocal">src/vec/vec/interface/rvector.c</A>

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/ksp/ksp/tutorials/ex71.c.html">src/ksp/ksp/tutorials/ex71.c.html</A><BR>


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