[petsc-users] petsc4py, plotting DA and writing to file

Jed Brown jed at 59A2.org
Mon Sep 27 12:14:37 CDT 2010


On Mon, Sep 27, 2010 at 19:06, Lisandro Dalcin <dalcinl at gmail.com> wrote:
> On 27 September 2010 13:54, Jed Brown <jed at 59a2.org> wrote:
>> On Mon, Sep 27, 2010 at 18:47, Lisandro Dalcin <dalcinl at gmail.com> wrote:
>>> viewer = PETSc.Viewer.DRAW(globalvec.comm)
>>> globalvec.view(viewer) # or viewer(globalvec)
>>
>> What do you think about having a top-level matplotlib viewer?
>
> Yes, we could have it, and a VisIt plugin, and a ParaView one, and
> what about Mayavi, and <put here your preferred viewer>... This could
> go to a separate petsc4py.plotting module (I prefer to not contaminate
> the petsc4py.PETSc namespace with stuff that is not pure-PETSc)
>
>> Ideally
>> it would have an option to drop you into an interactive python session
>> after the initial view.
>>
>
> Could you elaborate?

Usually you need a bit of annotation to produce a figure for a talk or
publication.  I don't find it reasonable to expose an API on the PETSc
side that is capable of everything the package can do (i suppose you
could shuttle strings, but that's lame for debugging in the event of
an API change, for example).  So another option would be to get an
interactive Python session that the user could use to manipulate the
figure and write it out in whatever formats they like (probably by
passing it through a filter that they have written).

>> I know this brings up the multiple dispatch problem, since the viewer
>> would naturally be distributed with petsc4p, but then you don't get to
>> modify the case statement in VecView_XX.
>>
>
> Sorry, now I'm confused. Are you suggesting this for petsc4py, or core PETSc?

petsc4py or any other non-core PETSc.

Jed


More information about the petsc-users mailing list