# VecGetArray1dWrite
Returns a pointer to a 1d contiguous array that will contain this processor's portion of the vector data.  You MUST call VecRestoreArray1dWrite() when you no longer need access to the array. 
## Synopsis
```
#include "petscvec.h"   
PetscErrorCode VecGetArray1dWrite(Vec x, PetscInt m, PetscInt mstart, PetscScalar *a[])
```
Logically Collective


## Input Parameters

- ***x -*** the vector
- ***m -*** first dimension of two dimensional array
- ***mstart -*** first index you will use in first coordinate direction (often 0)



## Output Parameter

- ***a -*** location to put pointer to the array





## Notes
For a vector obtained from DMCreateLocalVector() mstart are likely
obtained from the corner indices obtained from DMDAGetGhostCorners() while for
DMCreateGlobalVector() they are the corner indices from DMDAGetCorners().

For standard PETSc vectors this is an inexpensive call; it does not copy the vector values.


## See Also
 `VecGetArray()`, `VecRestoreArray()`, `VecGetArrays()`, `VecGetArrayF90()`, `VecPlaceArray()`,
`VecRestoreArray2d()`, `DMDAVecGetArray()`, `DMDAVecRestoreArray()`, `VecGetArray3d()`, `VecRestoreArray3d()`,
`VecGetArray2d()`, `VecRestoreArray1d()`, `VecGetArray4d()`, `VecRestoreArray4d()`

## Level
developer

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


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