petsc-3.6.1 2015-08-06
Report Typos and Errors

VecGetArrayF90

Accesses a vector array from Fortran90. For default PETSc vectors, VecGetArrayF90() returns a pointer to the local data array. Otherwise, this routine is implementation dependent. You MUST call VecRestoreArrayF90() when you no longer need access to the array.

Synopsis

VecGetArrayF90(Vec x,{Scalar, pointer :: xx_v(:)},integer ierr)
Logically Collective on Vec

Input Parameter

x -vector

Output Parameters

xx_v - the Fortran90 pointer to the array
ierr - error code

Example of Usage

    PetscScalar, pointer :: xx_v(:)
    ....
    call VecGetArrayF90(x,xx_v,ierr)
    xx_v(3) = a
    call VecRestoreArrayF90(x,xx_v,ierr)

If you ONLY intend to read entries from the array and not change any entries you should use VecGetArrayReadF90().

See Also

VecRestoreArrayF90(), VecGetArray(), VecRestoreArray(), VecGetArrayReadF90(), UsingFortran

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

Examples

src/vec/vec/examples/tutorials/ex4f90.F.html
src/ksp/ksp/examples/tutorials/ex44f.F90.html
src/snes/examples/tutorials/ex5f90.F.html
src/snes/examples/tutorials/ex5f90t.F.html