# DMNetworkGetLocalVecOffset
Get the offset for accessing the variables associated with a component at the given vertex/edge from the local vector 
## Synopsis
```
#include "petscdmnetwork.h"  
PetscErrorCode DMNetworkGetLocalVecOffset(DM dm, PetscInt p, PetscInt compnum, PetscInt *offset)
```
Not Collective


## Input Parameters

- ***dm -*** the DMNetwork object
- ***p -*** the edge or vertex point
- ***compnum -*** component number; use ALL_COMPONENTS if no specific component is requested



## Output Parameters

- ***offset -*** the local offset



## Notes
These offsets can be passed to MatSetValuesLocal() for matrices obtained with DMCreateMatrix().

For vectors obtained with DMCreateLocalVector() the offsets can be used with VecSetValues().

For vectors obtained with DMCreateLocalVector() and the array obtained with VecGetArray(vec,&array) you can access or set
the vector values with array[offset].

For vectors obtained with DMCreateGlobalVector() the offsets can be used with VecSetValuesLocal().




## See Also
 `DMGetLocalVector()`, `DMNetworkGetComponent()`, `DMNetworkGetGlobalVecOffset()`, `DMCreateGlobalVector()`, `VecGetArray()`, `VecSetValuesLocal()`, `MatSetValuesLocal()`

## Level
intermediate

## Location
<A HREF="PETSC_DOC_OUT_ROOT_PLACEHOLDER/src/dm/impls/network/network.c.html#DMNetworkGetLocalVecOffset">src/dm/impls/network/network.c</A>


---
[Edit on GitLab](https://gitlab.com/petsc/petsc/-/edit/release/src/dm/impls/network/network.c)


[Index of all DMNetwork routines](index.md)  
[Table of Contents for all manual pages](/docs/manualpages/index.md)  
[Index of all manual pages](/docs/manualpages/singleindex.md)  
