Subject: [Viper-dev] plot

From: "Garth N. Wells" <[email-masked]>
Date: Fri, 13 Mar 2009 10:04:45 +0000

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

---

From: Anders Logg <[email-masked]>
Date: Fri, 13 Mar 2009 11:26:19 +0100

> straight forward since Viper is built on top of VTK.

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.

-- 
Anders

---

From: Ola Skavhaug <[email-masked]>
Date: Fri, 13 Mar 2009 13:28:03 +0100

> and Viper could read it back. Viper just extracts the vertex values

Yes, this would be the simple solution.

Ola

> --
> Anders
>
> -----BEGIN PGP SIGNATURE-----
> Version: GnuPG v1.4.9 (GNU/Linux)
>
> iEYEARECAAYFAkm6NMsACgkQTuwUCDsYZdFkIwCfagdLVGWzPD63SPgRTAkYHWdt
> CSEAnjIzOS0HG+kXmWu6DlQEUXLrl4g6
> =SBxA
> -----END PGP SIGNATURE-----
>
> _______________________________________________
> DOLFIN-dev mailing list
> [email-masked]
> http://www.fenics.org/mailman/listinfo/dolfin-dev
>
>

-- 
Ola Skavhaug

---

From: Anders Logg <[email-masked]>
Date: Fri, 13 Mar 2009 22:17:52 +0100

> Yes, this would be the simple solution.

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