Matthew Knepley <knepley at gmail.com> wrote: >> a) Is there an easy and efficient way to convert a numpy.ndarray to a >> PETSc.Vec or PETSc.Mat (and vice-versa)? (A PETSc.Vec.getArray() returns a >> numpy.ndarray, though I have found no such method for PETSc.Mat yet. ) >> > > If you are using dense matrices (MATDENSE) then MatGetArray() works.
I don't think this is implemented in petsc4py: At least, there's no method PETSc.Mat.getArray() -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120508/15d46a47/attachment.htm>