a -location to put pointer to the array
Fortran Note
This routine is used differently from Fortran 77
Vec x
PetscScalar x_array(1)
PetscOffset i_x
PetscErrorCode ierr
call VecGetArray(x,x_array,i_x,ierr)
Access first local entry in vector with
value = x_array(i_x + 1)
...... other code
call VecRestoreArray(x,x_array,i_x,ierr)
For Fortran 90 see VecGetArrayF90()
See the Fortran chapter of the users manual and
petsc/src/snes/tutorials/ex5f.F for details.
See Also
VecRestoreArray(), VecGetArrayRead(), VecGetArrays(), VecGetArrayF90(), VecGetArrayReadF90(), VecPlaceArray(), VecGetArray2d(),
VecGetArrayPair(), VecRestoreArrayPair(), VecGetArrayWrite(), VecRestoreArrayWrite()
Level
beginner
Location
src/vec/vec/interface/rvector.c
Examples
src/vec/vec/utils/tagger/tutorials/ex1.c.html
src/vec/vec/tutorials/ex3.c.html
src/vec/vec/tutorials/ex6.c.html
src/vec/vec/tutorials/ex9.c.html
src/vec/vec/tutorials/ex18.c.html
src/vec/vec/tutorials/ex19.c.html
src/vec/vec/tutorials/ex21.c.html
src/vec/vec/tutorials/ex4f.F.html
src/vec/is/sf/tutorials/ex2.c.html
src/dm/impls/plex/tutorials/ex7.c.html
src/dm/tutorials/ex5.c.html
Implementations
VecGetArray_Nest in src/vec/vec/impls/nest/vecnest.c
VecGetArray_Node in src/vec/vec/impls/node/vecnode.c
Index of all Vec routines
Table of Contents for all manual pages
Index of all manual pages