#include "vec.h" int VecRestoreArray(Vec x,Scalar *a[])Not Collective
x | - the vector | |
a | - location of pointer to array obtained from VecGetArray() |
This routine actually zeros out the a pointer. This is to prevent accidental us of the array after it has been restored. If you pass null for a it will not zero the array pointer a.
Vec x
Scalar x_array(1)
PetscOffset i_x
int 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)
See the Fortran chapter of the users manual and petsc/src/snes/examples/tutorials/ex5f.F for details.
Level:beginner
Location:src/vec/interface/vector.c
Vector Index
Table of Contents