Loading and plotting PetClaw output

28 views
Skip to first unread message

Grady Lemoine

unread,
Nov 17, 2011, 11:26:07 PM11/17/11
to claw-...@googlegroups.com
Hi all,

I think I've got my poroelasticity code working in parallel with
PetClaw, but I'm not quite sure what to do with the output. I'd like
to load the data into an IPython instance to verify it against the
output from using serial PyClaw, but I'm not clear on how to do that
with the PetClaw output. Plotting would also be nice eventually, but
the HTML plots seem to have trouble, and I'm not clear on how to use
petclaw.plot.plotPetsc. Any tips?

Thanks,

--Grady

David Ketcheson

unread,
Nov 19, 2011, 11:16:46 AM11/19/11
to claw-users
I already responded privately, but here's the answer in case others
have the same question. After running the simulation, just do (in the
same directory)

ipython

from petclaw import plot

plot.interactive_plot()

(or plot.html_plot())

You shouldn't plot from inside your parallel script, since then each
process will try to plot.

-David

David Ketcheson

unread,
Nov 19, 2011, 11:20:56 AM11/19/11
to claw-users
Additionally:

You can load a solution from petclaw output via

import pyclaw
solution = pyclaw.Solution(frame, format='petsc',read_aux=False)

Here 'frame' should be the number of the frame you want to load. Then
the solution q is available as

solution.state.q

-David


On Nov 18, 7:26 am, Grady Lemoine <grady.lemo...@gmail.com> wrote:

Grady Lemoine

unread,
Nov 19, 2011, 11:27:27 AM11/19/11
to claw-...@googlegroups.com
Ah! That's the part I was missing -- how to load the solution so I
could evaluate it with a more sharply critical tool than the eyeball
norm. Thanks!

--Grady

> --
> You received this message because you are subscribed to the Google Groups "claw-users" group.
> To post to this group, send email to claw-...@googlegroups.com.
> To unsubscribe from this group, send email to claw-users+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/claw-users?hl=en.
>
>

Reply all
Reply to author
Forward
0 new messages