← Back to team overview

dolfin team mailing list archive

Re: plot

 

On Fri, Mar 13, 2009 at 01:28:03PM +0100, Ola Skavhaug wrote:
> On Fri, Mar 13, 2009 at 11:26 AM, Anders Logg <logg@xxxxxxxxx> wrote:
> > On Fri, Mar 13, 2009 at 10:04:45AM +0000, Garth N. Wells wrote:
> >> We have lots of demos failing now because it's no longer possible to
> >> write functions to an xml file, which plot(..) tries to do. What's the
> >> plan for plotting? Should Viper support the .vtu format? This should be
> >> straight forward since Viper is built on top of VTK.
> >>
> >> Garth
> >
> > We could also write a Mesh together with vertex values to an XML file
> > and Viper could read it back. Viper just extracts the vertex values
> > anyway.
> >
> 
> Yes, this would be the simple solution.
> 
> Ola

I looked at plot.cpp and try to see what was needed to get this
working but gave up. It has become quite complex and is difficult to
extend.

How about the following. We create a script dolfin-plot that can take
"any" DOLFIN XML file and plot it. Then the C++ plotting just needs to
write the data to XML and then run

  system("dolfin-plot <tmpfile>.xml [options]")

The Python script dolfin-plot can do all the dirty work of figuring
out what should be plotted and how.

The question is then how much of dolfin-plot should be handled by
Viper. In the simplest case, dolfin-plot would just call Viper
directly. It can also be that Viper has a simpler interface, and
dolfin-plot does some of the dirty work.

For plotting of Functions, we could have a simple XML format that
looks something like

<function ...>
  <mesh ...>
    ...
  </mesh>
  <vector ...>
    ...
  </vector>
</function>

The vector would be the vector of vertex values.

This would have two benefits (in addition to making plotting of
Functions work again): a much simplified plot.cpp and the ability to
plot XML data directly from the command line (partly supported by
Viper already).

-- 
Anders

Attachment: signature.asc
Description: Digital signature


References