[petsc-users] petsc4py and numpy

Jed Brown jedbrown at mcs.anl.gov
Tue May 8 09:55:06 CDT 2012


On Tue, May 8, 2012 at 8:21 AM, Aron Ahmadia <aron.ahmadia at kaust.edu.sa>wrote:

> Conversion between ndarray and PETSc Vecs is practically free, so I would
> keep them as numpy arrays for as long as possible (this is the strategy in
> pyclaw).


I'm not sure what is meant by "as long as possible", but Vec deals with
parallel consistency. At the local level, parallelism has essentially been
removed by the presence of ghost values, so it's reasonable to pass around
numpy arrays. At the global/analysis level, using numpy arrays is
error-prone because they don't manage parallel consistency.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20120508/a445cb57/attachment.htm>


More information about the petsc-users mailing list