Preparing the Sources
=========================

Additional to the software mentioned in README you'll need the
following programs installed on your system:

  a C++11-compatible compiler (e.g. GCC >= 4.9)
  cmake >= 2.8.6

You need the DUNE core libraries in version 2.4. Additionally you need
dune-typetree 2.4 and dune-functions in the version of branch
releases/2.4-compatible from the Git repository
https://gitlab.dune-project.org/staging/dune-functions.git.

In addition to the DUNE libraries, you'll need the following libraries:

  Boost Fusion >= 1.54
  ug
  UMFPACK

Getting started
---------------

If these preliminaries are met, you should run

  dunecontrol all

which will find all installed dune modules as well as all dune modules
(not installed) which sources reside in a subdirectory of the current
directory. Note that if dune is not installed properly you will either
have to add the directory where the dunecontrol script resides (probably
./dune-common/bin) to your path or specify the relative path of the script.

On your project and all uninstalled DUNE source modules found the script
will then call CMake to create the Makefiles. Afterwards the modules will
be build using make all

Most probably you'll have to provide additional information to dunecontrol
(e. g. compilers, configure options) and/or make options.

The most convenient way is to use an options file in this case. This file
defines two variables:

CMAKE_FLAGS      flags passed to cmake
MAKE_FLAGS       flags passed to make

An example options file might look like this:

#use this options to cmake and make if no other options are given
CMAKE_FLAGS=" \
-DCMAKE_CXX_COMPILER=g++-4.9 \
-DCMAKE_CXX_FLAGS='-Wall -pedantic' \
-DCMAKE_INSTALL_PREFIX=/install/path" #Force g++-4.9 and set compiler flags
MAKE_FLAGS=install #Per default run make install instead of simply make

If you save this information into example.opts you can pass the opts file to
dunecontrol via the --opts option, e. g.

  dunecontrol --opts=example.opts all

More info
---------

See

     dunecontrol --help

for further options.


The full build-system is described in the dune-common/doc/buildsystem (Git version) or under share/doc/dune-common/buildsystem if you installed DUNE!

Running example programs
------------------------

[It is assumed that all the following commands are run from the build directory
 and that the build directory is a subdirectory of the dune-dpg root directory.]

To regenerate the convergence plots from the paper, it is advised to compile
the test programs in release mode, to significantly speed up the computations.
The release mode can be configured with

    cmake -DCMAKE_BUILD_TYPE=Release .

Afterwards, we can compile the test programs with

    make

To run the test programs with the right parameters, call

    ../scripts/run_convergence_test.sh

This will take several hours. (you can first adapt this script if you
want to change the grid resolution n=1/H, especially the testcase with
locally refined test search space of level 3 gets very slow for large n)

Finally, the convergence plots can be generated with

    ../scripts/convergence_plots.py

To plot the solution itself in the .vtu format readable by ParaView, run

    src/plot_solution <n>

where <n> is to be replaced by the desired grid resolution. This will write
two .vtu files to the current working directory representing the numerical
solution of the interior and trace variables.
If you have the pvpython interpreter shipped with ParaView, you can also run
the scripts/plot_solution.py to regenerate the solution plot given in the paper.
(This script was run with ParaView 4.2.0. As the Python interface of ParaView
seems to be highly unstable, we cannot guarantee, that the script will run
unmodified on another version of ParaView.)

License
-------

Licensing information for dune-dpg can be found in the accompanying file
COPYING.
