[petsc-users] extract data from vector in petsc into fortran array

Bo Sun sciam at iastate.edu
Wed May 2 23:32:48 CDT 2012


Hi there,
I am coding using Fortran 90 with petsc. I extract the results from vector
in petsc as follows,

   PetscScalar, pointer :: xx_v(:)
   Vec pet_u

   ..............
   call VecGetArrayF90(pet_u,xx_v,ierr)
    data_for_fortran = xx_v
    call VecRestoreArrayF90(pet_u,xx_v,ierr)
   ...................


For small size of vector, there is no problem. But when the size of vector
is above million, some strange data appear. Could you recommend another way
to output the data of vector in petsc into fortran array ?


Thanks,
Bo
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120502/e81782e5/attachment.htm>


More information about the petsc-users mailing list