Visualization using VTK

As an alternative escript supports the usage of visualization tools which base on VTK, eg. mayavi [2], VisIt [24]. In this case the solution is written to a file in the VTK format. This file the can read by the tool of choice. Using VTK file is MPI safe.

To write the solution u in Poisson problem to the file u.xml one need to add the line
\begin{python}
saveVTK(''u.xml'',sol=u)
\end{python}
The solution u is now available in the u.xml tagged with the name "sol".

The Poisson problem script is now
\begin{python}
from esys.escript import *
from esys.escript.linearPDEs import ...
...Solution()
...
The entire code is available as poissonVTK.py in the example directory

You can run the script using the escript environment and visualize the solution using mayavi:

  escript poisson\hackscore VTK.py
  mayavi2 -d u.xml -m SurfaceMap
The result is shown in Figure Figure 1.4.

esys@esscc.uq.edu.au