# VecSetLocalToGlobalMapping
Sets a local numbering to global numbering used by the routine `VecSetValuesLocal()` to allow users to insert vector entries using a local (per-processor) numbering. 
## Synopsis
```
#include "petscvec.h"   
PetscErrorCode VecSetLocalToGlobalMapping(Vec x, ISLocalToGlobalMapping mapping)
```
Logically Collective


## Input Parameters

- ***x -*** vector
- ***mapping -*** mapping created with ISLocalToGlobalMappingCreate() or ISLocalToGlobalMappingCreateIS()





## Note
All vectors obtained with `VecDuplicate()` from this vector inherit the same mapping.

seealso: [](chapter_vectors), `Vec`, `VecAssemblyBegin()`, `VecAssemblyEnd()`, `VecSetValues()`, `VecSetValuesLocal()`,
`VecSetLocalToGlobalMapping()`, `VecSetValuesBlockedLocal()`

## Level
intermediate

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

## Examples
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex8.c.html">src/vec/vec/tutorials/ex8.c.html</A><BR>
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/vec/vec/tutorials/ex8f.F90.html">src/vec/vec/tutorials/ex8f.F90.html</A><BR>
<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/vector.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)  
