next up previous contents
Next: 3.4 Using dynamic adaptive Up: 3 A more complex Previous: 3.2 Saving the whole   Contents

Subsections

3.3 Visualisation

Several tools can be used to visualise Gerris simulation files, either the standalone GfsView which interfaces directly with Gerris or external viewers such as geomview, openDX or MayaVi.

3.3.1 GfsView

GfsView is a tool written specifically to visualise Gerris simulation files. It is still young but fully usable both for 2D and 3D simulations. Its main advantage over other options and the reason for its existence is that it makes full use of the adaptive nature of the octree representation at the visualisation level. The octree structure is used within GfsView to dynamically select the appropriate level of refinement depending on the viewpoint, zoom and rendering speed. It is also used to efficiently compute complex geometrical entities such as isosurfaces or cut-planes.

The more classical viewers such as openDX or MayaVi are designed for either regular Cartesian grids or fully-unstructured meshes and do not take advantage of the octree representation (worse still, the octree representation first needs to be converted to Cartesian or fully-unstructured meshes before being imported into these programs).

To install GfsView, you need to have the Gtk+ toolkit installed on your system. If you are running a Linux machine, Gtk+ is most probably already installed. You will also need the GtkGlExt OpenGL extension to Gtk+.

If you are running a Debian-based system, you can install these packages using

% apt-get install libgtkglext1-dev

If you then download a recent version of GfsView from the Gerris web site (either an official release or a snapshot) and do the now classical:

% gunzip gfsview.tar.gz
% tar xvf gfsview.tar
% cd gfsview
% ./configure --prefix=/home/joe/local
% make
% make install
you will be able to start GfsView using:
% gfsview2D half-cylinder-0.5.gfs
Note that you can also install the most recent GfsView version using darcs and http://gfs.sourceforge.net/darcs/gfsview/gfsview-mainline as source repository (you will also need to install Gerris this way, see section 1.1.4 for details).

Clicking on ``Linear'', ``Vectors'' and ``Solid'' in the toolbar and changing the vector length by editing the properties of the ``Vectors'' object (select the object then choose ``Edit $ \rightarrow$ mathend000#Properties'') you should be able to get something looking like figure 5. You can pan by dragging the right mouse button, zoom by dragging the middle button and rotate by dragging the left button.

Figure 5: Screenshot of a GfsView session.
\begin{figure}\begin{center}
\includegraphics[width=\hsize]{gfsview.eps}
\end{center}
\end{figure}

While by no means complete, you can already do many things with GfsView. I hope it is fairly user-friendly so just play with it and discover for yourself.

3.3.2 Some post-processing using gfs2oogl

Gerris comes with a utility called gfs2oogl which converts simulation files to various representations in OOGL format. We are just going to look at two types of representations gfs2oogl can do: scalar field cross-sections and vector fields.

First of all, you can access a small summary of the options of gfs2oogl by typing:

% gfs2oogl2D -h
By default gfs2oogl will generate the same output as GfsOutputBoundaries like this:
% gfs2oogl2D < half-cylinder-0.1.gfs > boundaries.oogl
To generate an OOGL representation of a scalar field (a coloured square for each discretisation cell) do this:
% gfs2oogl2D -S -z 0 -c Vorticity < half-cylinder-0.5.gfs > squares.oogl
which tells gfs2oogl to do a cross-section for z = 0 mathend000# (-z 0) represented by squares (-S) and colored according to the local vorticity (-c Vorticity). To generate a vector field representing the velocity try:
% gfs2oogl2D -V 2 -z 0 < half-cylinder-0.5.gfs > vectors.oogl
where -V 2 specifies that the maximum length of the vector is twice the dimension of the smallest cell in the domain.

If you now load all these files in Geomview and do a bit of panning and zooming around (and possibly tune things like face shading) you should get an image looking like figure 6.

Figure 6: Scalar and vector representation generated using gfs2oogl.
\includegraphics[angle=90,width=0.6\hsize]{gfs2oogl.eps}

3.3.3 Visualisation with OpenDX

If you have OpenDX installed on your system, the installation process described above should have compiled and installed an OpenDX module which allows direct import of Gerris simulation files into an OpenDX visual program.

In order to be able to use this module you need to start OpenDX with a command line looking like:

% dx -mdf /home/joe/local/lib/gerris/dx2D.mdf
if you want to import a 2D simulation file or
% dx -mdf /home/joe/local/lib/gerris/dx3D.mdf
for a 3D simulation file (where /home/joe/local should be replaced with the proper installation directory). This tells OpenDX to load the module described by the given Module Description File.

If everything went correctly, within the OpenDX Visual Program Editor you should be able to select a tool named ``ImportGfs2D'' (resp. ``ImportGfs3D'') belonging to the ``Import and Export'' category. As its name suggests this tool reads a Gerris Flow Solver simulation file and produces a group containing named fields. A field called ``solid'' contains the geometry of the solid boundaries. The other fields represent the scalar or vector data contained in the simulation file. Vector fields are constructed from the velocity components (the resulting vector field is called ``U'' in OpenDX) and from any three components with names ending in ``x'', ``y'' or ``z'' and with a common root. This common root is used as the OpenDX field name. All the remaining fields are considered as scalar fields.

If you are not familiar with OpenDX, you should read the available documentation and go through the integrated tutorial. You can use the visual program called gfs2D.net provided with this tutorial as a starting point. Typing

% dx -mdf /home/joe/local/lib/gerris/dx2D.mdf -program gfs2D.net
in the directory containing your half-cylinder-0.5.gfs file (you also need to add the path to gfs2D.net if it is not contained in the same directory) and selecting the Execute $ \rightarrow$ mathend000#Execute Once menu should bring up windows looking like figure 7.
Figure 7: Screenshot of an OpenDX session using the ImportGfs2D module.
\begin{figure}\begin{center}
\includegraphics[width=\hsize]{dxscreen.eps}
\end{center}
\end{figure}


next up previous contents
Next: 3.4 Using dynamic adaptive Up: 3 A more complex Previous: 3.2 Saving the whole   Contents