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.
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 installyou will be able to start GfsView using:
% gfsview2D half-cylinder-0.5.gfsNote 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
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.
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:
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.
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:
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
3.3.2 Some post-processing using gfs2oogl
% 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
% 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.
3.3.3 Visualisation with OpenDX
% 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.
% 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
Next: 3.4 Using dynamic adaptive
Up: 3 A more complex
Previous: 3.2 Saving the whole
Contents