[petsc-users] access da local vector data array in petsc4py

Amal Alghamdi amal.ghamdi at kaust.edu.sa
Tue Oct 12 03:21:33 CDT 2010


Dear All,

I have a question regarding petsc4py. I'd like to access the data array in a
local vector generated from a one-dimension da, which has dof = 1. I used  q
= localVec.getArray(). However, q shape now does not take into account dof
which is one in my example. I always need to reshape q to match the intended
dof. Is there a way to do that automatically?

Thank you very much.
Amal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20101012/35f3bfcd/attachment.htm>


More information about the petsc-users mailing list