# VecSetValueLocal
Set a single entry into a vector using the local numbering 
## Synopsis
```
#include <petscvec.h>
PetscErrorCode VecSetValueLocal(Vec v,PetscInt row,PetscScalar value, InsertMode mode);
```
Not Collective


## Input Parameters

- ***v -*** the vector
- ***row -*** the row location of the entry
- ***value -*** the value to insert
- ***mode -*** either `INSERT_VALUES` or `ADD_VALUES`



## Notes
For efficiency one should use `VecSetValues()` and set several or
many values simultaneously if possible.

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

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




## See Also
 `VecSetValues()`, `VecAssemblyBegin()`, `VecAssemblyEnd()`, `VecSetValuesBlockedLocal()`, `VecSetValue()`

## Level
beginner

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/include/petscvec.h.html#VecSetValueLocal">include/petscvec.h</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/include/petscvec.h)


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