# VecGetArray3d

Returns a pointer to a 3d contiguous array that contains this processor's portion of the vector data. You MUST call VecRestoreArray3d() when you no longer need access to the array.

### Synopsis

    #include "petscvec.h"
    PetscErrorCode PETSCVEC_DLLEXPORT VecGetArray3d(Vec x,PetscInt m,PetscInt n,PetscInt p,PetscInt mstart,PetscInt nstart,PetscInt pstart,PetscScalar ***a[])

Not Collective

### Input Parameter

| x | - the vector
| m | - first dimension of three dimensional array
| n | - second dimension of three dimensional array
| p | - third dimension of three dimensional array
| mstart | - first index you will use in first coordinate direction (often 0)
| nstart | - first index in the second coordinate direction (often 0)
| pstart | - first index in the third coordinate direction (often 0)

### Output Parameter

a -location to put pointer to the array

### Notes

For a vector obtained from DACreateLocalVector() mstart, nstart, and pstart are likely obtained from the corner indices obtained from DAGetGhostCorners() while for DACreateGlobalVector() they are the corner indices from DAGetCorners(). In both cases the arguments from DAGet[Ghost}Corners() are reversed in the call to VecGetArray3d().

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

### See Also

VecGetArray(), VecRestoreArray(), VecGetArrays(), VecGetArrayF90(), VecPlaceArray(),
VecRestoreArray2d(), DAVecGetarray(), DAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()

Level:beginner
Location:src/vec/interface/vector.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages