petsc-3.9.4 2018-09-11
Report Typos and Errors


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


#include "petscvec.h"   
PetscErrorCode  VecGetArray4d(Vec x,PetscInt m,PetscInt n,PetscInt p,PetscInt q,PetscInt mstart,PetscInt nstart,PetscInt pstart,PetscInt qstart,PetscScalar ****a[])
Logically Collective

Input Parameter

x - the vector
m - first dimension of four dimensional array
n - second dimension of four dimensional array
p - third dimension of four dimensional array
q - fourth dimension of four 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)
qstart - first index in the fourth coordinate direction (often 0)

Output Parameter

a -location to put pointer to the array


For a vector obtained from DMCreateLocalVector() mstart, nstart, and pstart are likely obtained from the corner indices obtained from DMDAGetGhostCorners() while for DMCreateGlobalVector() they are the corner indices from DMDAGetCorners(). In both cases the arguments from DMDAGet[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(), DMDAVecGetarray(), DMDAVecRestoreArray(), VecGetArray3d(), VecRestoreArray3d(), VecGetArray1d(), VecRestoreArray1d(), VecGetArray4d(), VecRestoreArray4d()




Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages