[petsc-users] Usage of VecCreateMPIWithArray in fortran
Praveen C
cpraveen at gmail.com
Wed Feb 1 23:46:42 CST 2017
Dear all
I am creating a vector in fortran like this
PetscReal,allocatable :: res(:,:)
Vec :: v_res
allocate( res(nvar,nvl_nvg) )
call VecCreateMPIWithArray(PETSC_COMM_WORLD, nvar, nvar*nvl, &
PETSC_DECIDE, res(1,1), v_res, &
ierr); CHKERRQ(ierr)
Note that my array "res" is larger than needed by the vector v_res.
Is this ok to do this ?
I use the extra "res" array for dummy ghost values, but I dont need v_res
to be ghosted.
Thanks
praveen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20170202/eda7f59d/attachment.html>
More information about the petsc-users
mailing list