\chapter{The skeleton code}

The provided code for the course contains an implementation of a real-time fluid flow simulation. The fluid flows under the influence of a user-controlled force field. The simulation follows the Navier-Stokes equations for fluid flow. These equations describe how the velocity, pressure, temperature and density of a moving fluid are related. \\

\section{Grid-based smoke}

The visualization is done using a two dimensional grid as opposed to particle-based smoke visualization techniques. At every vertex a number of fluid attributes are
stored. The skeleton program keeps track of the density, velocity and force. These attributes can be visualized with different techniques. Each and every attribute has its own 'preferred' visualization technique. \\

Using these values at the cell's vertices, all sorts of techniques, additional values and other useful info can be used. The values are used in colormap techniques, calculation of the divergence and the rendering of the height plots. \\

\begin {center}
  \includegraphics[width=70mm]{flow_vis.png} \\
  Figure 2: Fluid visualization \\
\end {center}

The above screenshot shows us the fluid movement using a grey colormap. This simple yet effective visualization technique is explained in chapter 3. \\

\section{Internal structure}

The first assignment was to simply compile the code. This was fairly easy. However, the code was a bit unstructured. Everything was put into one big file. To be able to add additional functionality without losing sight it was needed to create a file for every new technique being implemented. Furthermore the calculations, rendering functions and user interaction code were split from eachother. \\

With this new structure it was possible to be able to manage the code and add additional functionality. The programming language of our choice was C and for the graphical user interface the GTK+ library with the OpenGL extension was chosen. For project managment SVN was used. This was very useful since both students had different development environments and also did a lot of work at home. \\
