README.md 13.5 KB
Newer Older
Dion Haefner's avatar
Dion Haefner committed
1 2 3
# Welcome to DORiE!
(__D__UNE-__O__perated __Ri__chards equation solving __E__nvironment)

Dion Häfner's avatar
Dion Häfner committed
4
![build status](http://shangrila.iup.uni-heidelberg.de:30000/dorie/dorie-new/badges/master/build.svg)
Dion Haefner's avatar
Dion Haefner committed
5

Dion Haefner's avatar
Dion Haefner committed
6
DORiE is a software suite for solving Richard's Equation. The core feature is a C++ PDE-solver powered by [DUNE](https://dune-project.org/). It implements a Discontinous Galerkin (DG) discretization scheme on structured rectangular / cubic and unstructured simplex grids in two and three spatial dimensions, and makes use of advanced features like adaptive grid refinement.
7 8 9

The suite encapsulates a documentation and various tools for program setup, program testing, and output analysis, which are mostly written in Python.

Lukas Riedel's avatar
Lukas Riedel committed
10
DORiE is developed and maintained by the [DORiE Developers](mailto:dorieteam@iup.uni-heidelberg.de) of the [TS-CCEES](http://ts.iup.uni-heidelberg.de/) research group at IUP Heidelberg, supervised by [Kurt Roth](http://ts.iup.uni-heidelberg.de/people/prof-dr-kurt-roth/), in collaboration with [Ole Klein](https://conan2.iwr.uni-heidelberg.de/people/oklein/) and the [Scientific Computing Group](https://conan2.iwr.uni-heidelberg.de/) of IWR Heidelberg. 
11 12 13 14


# Installation Instructions

Dion Haefner's avatar
Dion Haefner committed
15
DORiE is a [DUNE](https://dune-project.org/) module and requires several other DUNE modules as well as third party software packages. Installation can be handled manually on your local machine, but for inexperienced users it is recommended to use the deployment software [Docker](https://www.docker.com/) instead.
16

Dion Haefner's avatar
Dion Haefner committed
17
In any case, DORiE is configured, built, and installed via the [DUNE Buildsystem](https://dune-project.org/doc/installation/), using the `dunecontrol` script to handle DUNE-internal dependencies.
18

19 20 21 22 23 24 25 26 27
## Docker Installation - Simple Setup
This setup is intended for users who simply want to start computations with DORiE.

Install Docker on your machine. Then, use `git clone` to download the DORiE repository into a suitable directory on your machine. Enter the directory, and call

    docker build -t dorie .

Docker will use a prepared image from Dockerhub and install DORiE into it. You can now call DORiE via the Docker deamon from any directory `dir` on your machine:

Dion Häfner's avatar
Dion Häfner committed
28
    docker run -i -t -v <dir>:/sim dorie <command>
29 30 31

The `-v` option tells docker to mount the directory into the container work directory (`sim`).

Dion Häfner's avatar
Dion Häfner committed
32
In the section 'Usage' you will find a list of possible commands. Note that input and output files can only be placed in the `<dir>` directory or subdirectories thereof. You must use relative paths in the DORiE configuration files.
33 34

## Docker Installation - Interactive Setup
Dion Häfner's avatar
Dion Häfner committed
35
This setup is intended for advanced users. You will gain access to the DORiE module outside the container, and be able to make changes to the source code.
36 37

We have prepared a [DORiE DUNE Environment Image on Dockerhub](https://hub.docker.com/r/dorie/dune-env/), which is a modified image of the Ubuntu OS that has all dependencies readily installed. The current version is 2.4 (referencing the DUNE module version 2.4).
38
Run a new container from this image by calling
39 40 41

    docker run -i -t dorie/dune-env:2.4 /bin/bash

Dion Haefner's avatar
Dion Haefner committed
42
Docker will automatically download the image if necessary. Use the `-v` option of the `run` command to mount a local directory into the container:
43 44 45

    -v <hostdir/dorie>:/opt/dune/dorie

46
This way, you can access the content of the (still empty) folder of the virtual machine from your local `<hostdir>/dorie` directory. *Mounting directories is not possible after your container has been started!*
47

Dion Haefner's avatar
Dion Haefner committed
48
Next, use `git clone` to download the DORiE repository into the shared folder. Enter the container, and execute
49 50 51

    dunecontrol --only=dorie all

52 53 54
to build DORiE. Lastly, install the DORiE binaries by calling

    dunecontrol --only=dorie make install
55

56
### Update DUNE
57 58 59 60
The DUNE modules in the repository might be outdated. You can update to the newest versions by calling

    dunecontrol update

61
Then compile and install all modules again by executing
62

63
    dunecontrol all && dunecontrol make install
64

Dion Haefner's avatar
Dion Haefner committed
65

66
## Manual Installation
Dion Häfner's avatar
Dion Häfner committed
67 68 69
Installing all packages manually can be quite an effort, but useful for developers who want to have easy access to the source files or users who prefer to run DORiE without the Docker overhead. 

Whenever possible, dependencies should be installed using a package manager, like [APT](https://wiki.ubuntuusers.de/APT/) on Ubuntu or [Homebrew](http://brew.sh/) on Mac. Manual installation on a Windows environment is strongly discouraged!
70 71

### Dependencies
Dion Haefner's avatar
Dion Haefner committed
72
Depending on your system configuration, there will be more packages necessary to install DORiE on your machine. See the step-by-step manual for further details.
73 74 75

| Software | Version/Branch | Comments |
| ---------| -------------- | -------- |
Dion Haefner's avatar
Dion Haefner committed
76
| CMake | >= 2.8.12 |
77 78 79
| GCC | >= 5 |
| git |
| pkg-config |
Dion Haefner's avatar
Dion Haefner committed
80 81 82 83 84 85 86 87
| HDF5 | | with MPI support
| FFTW3 | | with MPI support
| Python | 2.7 or 3.x |
| pip | 2.7 or 3.x |
| MPI | | Tested with OpenMPI and Mpich
| SuperLU | 4.3 or 5.x |
| VirtualEnv | | Install via `pip` |
| [UG](https://gitlab.dune-project.org/ug/ug) | 3.12.1 | Follow the [IWR Installation Instructions](http://www.iwr.uni-heidelberg.de/frame/iwrwikiequipment/software/ug)
88 89 90 91 92 93 94 95 96 97
| [dune-common](https://gitlab.dune-project.org/core/dune-common) | releases/2.4
| [dune-geometry](https://gitlab.dune-project.org/core/dune-geometry) | releases/2.4
| [dune-grid](https://gitlab.dune-project.org/core/dune-grid) | releases/2.4
| [dune-istl](https://gitlab.dune-project.org/core/dune-istl) | releases/2.4
| [dune-localfunctions](https://gitlab.dune-project.org/core/dune-localfunctions) | releases/2.4
| [dune-typetree](https://gitlab.dune-project.org/pdelab/dune-typetree) | releases/2.4
| [dune-pdelab](https://gitlab.dune-project.org/pdelab/dune-pdelab) | releases/2.4
| [dune-python](https://gitlab.dune-project.org/quality/dune-python) | releases/2.4
| [dune-testtools](https://gitlab.dune-project.org/quality/dune-testtools) | releases/2.4

Dion Haefner's avatar
Dion Haefner committed
98
If you also want to build the documentation, you will additionally need to install Doxygen, Sphinx and Breathe.
99

100
### Step-by-step Instructions
Dion Häfner's avatar
Dion Häfner committed
101
These instructions are suitable for a clean **Ubuntu** or **Mac OS X** setup. The main difference between the two systems is the package manager. Debian-based systems have the APT manager already built in. On Mac, we recommend installing [Homebrew](http://brew.sh/). If you prefer to use [MacPorts](https://www.macports.org/), you need to check if some of the packages require different installation options than displayed here. 
Dion Haefner's avatar
Dion Haefner committed
102 103

1. Install third party packages:
Lukas Riedel's avatar
Lukas Riedel committed
104
    
105
    **Ubuntu:**
Dion Haefner's avatar
Dion Haefner committed
106
    
Dion Haefner's avatar
Dion Haefner committed
107
        apt update 
Dion Haefner's avatar
Dion Haefner committed
108
        apt install autoconf bison cmake flex gcc-5 g++-5 gfortran-5 \
Dion Haefner's avatar
Dion Haefner committed
109 110
                    git libatlas-base-dev libfftw3-dev libfftw3-mpi-dev \
                    libfreetype6-dev libhdf5-mpi-dev libopenmpi-dev libpng-dev \
Dion Haefner's avatar
Dion Haefner committed
111 112
                    libsuperlu-dev libxft-dev python-dev python-pip python-sphinx \
                    python-breathe doxygen
113

114 115 116 117
    **Mac OS X:**

        brew update
        brew install automake cmake doxygen gcc libtool libpng open-mpi \
118
                    pkg-config superlu
119 120 121
        brew install hdf5 --with-mpi
        brew install fftw --with-mpi

122
    Install the PyPi package manager pip by downloading the [get_pip.py](https://bootstrap.pypa.io/get-pip.py) script and calling
123

Lukas Riedel's avatar
Lukas Riedel committed
124
        sudo -H python get_pip.py
125

126
2. Install the necessary Python packages using `pip`:
127 128

    **Ubuntu:**
129
        
Dion Haefner's avatar
Dion Haefner committed
130
        python -m pip install virtualenv
131

132 133
    **Mac OS X:**

134
        sudo -H python -m pip install virtualenv sphinx==1.3.6 breathe --ignore-installed
135

136 137 138 139 140 141
3. **Mac OS X** only: 
    1. The Apple Clang compiler shipped with CMake is not suitable for compiling DUNE and UG. Before proceeding, call

            export CC=gcc-6
            export CXX=g++-6

Dion Häfner's avatar
Dion Häfner committed
142
        to enfore the Homebrew'd GCC compiler. Note that this variable export only lasts for your current terminal session. Always make sure that the configuration tool actually finds GCC instead of the Apple Clang.
143

Dion Haefner's avatar
Dion Haefner committed
144
3. Clone the specified version of UG into a suitable folder on your machine. Install it by calling
145 146

        autoreconf -is
Dion Haefner's avatar
Dion Haefner committed
147
        ./configure --enable-parallel --without-x --enable-dune --enable-system-heap
148 149
        make && make install

Dion Haefner's avatar
Dion Haefner committed
150 151 152
4. Clone the DUNE modules and DORiE into a suitable folder on your machine. Make sure that you check out the correct branches (2.4 release branch). Enter the parent folder, and call

        ./dune-common/bin/dunecontrol all
153

Dion Haefner's avatar
Dion Haefner committed
154 155 156
    If you installed software into paths not appended to your `PATH` variable, you will have to add a custom options file to make sure that CMake finds all packages. See the [DUNE Installation Instructions](https://dune-project.org/doc/installation/) for details. CMake will throw an error if required packages are not found.
 
5. To install all DUNE packages into system locations (so you can call `dunecontrol` and `dorie` from anywhere), you can run
157

158
        ./dune-common/bin/dunecontrol make install
159

Dion Haefner's avatar
Dion Haefner committed
160
    This may require `sudo` rights on your machine. If you choose not to do this, make sure to append the location of `dunecontrol` (`dune-common/bin`) and `dorie` (`dorie/build-cmake/bin`) to your search path.
161

162

163 164 165
## Recommended Third-Party Software

The following software packages are cross-platform, so you should be able to find a release that fits your operating system:
Dion Haefner's avatar
Dion Haefner committed
166 167 168 169

* [Gmsh](http://gmsh.info/): An open-source CAD that can be used to create the `.msh` files used by DORiE to define triangular meshes.
* [ParaView](http://www.paraview.org/): A powerful post-processing tool for VTK files. Offers both visualization and data analysis tools.

170
# Usage
Dion Haefner's avatar
Dion Haefner committed
171

172 173 174 175 176 177 178 179
## Start an interactive Docker session

In case you built DORiE using Docker and want to start an interactive session, e.g. to build the documentation or do some debugging, you can do so by specifying a custom entrypoint for the container:

    docker run -i -t --entrypoint=/bin/bash -v <dir>:/sim dorie

This way, an interactive bash session inside the container will be started (instead of directly running DORiE). Note that DUNE and DORiE are located in `/opt/dune`.

180
## Documentation
Dion Haefner's avatar
Dion Haefner committed
181

182
The documentation of the current `master` branch can be found [online](http://dorie-docs.gitballoon.com) (password: `richards`).
Dion Haefner's avatar
Dion Haefner committed
183

184
The documentation can be built after DORiE has been properly configured (i.e., by calling `dunecontrol`). Note that you might have to re-configure DORiE once after installing it, because some dependencies are installed at configure time (e.g. by `dunecontrol --only=dorie configure`). To build the documentation, just run
Dion Haefner's avatar
Dion Haefner committed
185

Dion Haefner's avatar
Dion Haefner committed
186
    dunecontrol --only=dorie make doc
Dion Haefner's avatar
Dion Haefner committed
187

188
The documentation files can now be found in the subfolder `dorie/build-cmake/doc`.
Dion Haefner's avatar
Dion Haefner committed
189

190
## Run, DORiE, Run!
Dion Haefner's avatar
Dion Haefner committed
191
During `make install`, DORiE installs a wrapper to access the functions and executables of DORiE from any location on your device. After a successful installation, you can call the wrapper by simply executing
192 193

    dorie <command>
194

Dion Haefner's avatar
Dion Haefner committed
195
If you did not run `dunecontrol make install`, you can find the wrapper in the `dorie/build-cmake/bin` folder of your installation.
196

197
To start your first simulation run, create a new directory and enter it. Place some exemplary configuration and boundary condition data files in there by calling
198 199 200

    dorie create

201 202
DORiE encapsulates two routines, the Parameter Field Generator (PFG) and the main program routine. Each takes a single `.ini` configuration file as arguments.

203 204
Tweak the paramters to your liking and then call

205 206 207 208
    dorie pfg <inifile>

to create a parameter field file. Make sure that you instruct the main routine to call the file you just created. Then call

209
    dorie run <inifile>
Dion Haefner's avatar
Dion Haefner committed
210

211
to execute the main program.
Dion Haefner's avatar
Dion Haefner committed
212

213
List all available commands and find further help by executing
Dion Haefner's avatar
Dion Haefner committed
214

Dion Häfner's avatar
Dion Häfner committed
215
    dorie --help
Dion Haefner's avatar
Dion Haefner committed
216

217 218
or

Dion Häfner's avatar
Dion Häfner committed
219
    dorie <command> --help
220

221
## Troubleshooting
Dion Haefner's avatar
Dion Haefner committed
222 223 224
CMake heavily caches the results of its configuration process. In case you encounter errors or strange behavior, especially after an update, you should delete the DORiE build folder (called `build-cmake` by default) and re-install DORiE using `dunecontrol`.

If the problem persists, take a look at the [List of Known Bugs](http://shangrila.iup.uni-heidelberg.de:30000/dorie/dorie/issues?assignee_id=&author_id=&label_name=bug&milestone_id=&scope=all&sort=created_desc&state=opened), or create an issue yourself. For problems related to the installation, refer to the sections below.
Dion Haefner's avatar
Dion Haefner committed
225

226
### Debugging
Dion Haefner's avatar
Dion Haefner committed
227
DORiE can be built with debugging flags via CMake. To do so, run
228

Dion Haefner's avatar
Dion Haefner committed
229
    CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Debug" dunecontrol --only=dorie all
230

Dion Haefner's avatar
Dion Haefner committed
231
After building, a debugger can hook into the executables.
232

Dion Haefner's avatar
Dion Haefner committed
233
**Note:** If no `CMAKE_BUILD_TYPE` is specified during re-configuration, the last configuration build type is used. If no CMake files exist, it defaults to `Release`. You will find the actual value displayed in the final output of CMake.
234

Dion Haefner's avatar
Dion Haefner committed
235
To re-create a release build, configure DORiE with the release build type by executing
236

Dion Haefner's avatar
Dion Haefner committed
237
    CMAKE_FLAGS="-DCMAKE_BUILD_TYPE=Release" dunecontrol --only=dorie all
238

239 240 241 242 243
#### Debugging inside Docker
A debugger needs special security privileges usually not provided by the Docker engine. To enable debugging inside Docker, these privileges have to be granted when calling `docker run` by adding the options

    --security-opt seccomp=unconfined

Dion Häfner's avatar
Dion Häfner committed
244
The debugger `gdb` is pre-installed in the Docker container.
245

Dion Haefner's avatar
Dion Haefner committed
246
### DORiE is running, but I suspect that something is wrong
Dion Haefner's avatar
Dion Haefner committed
247
You can execute system tests in order to ensure that DORiE is running correctly and producing the expected results:
Dion Haefner's avatar
Dion Haefner committed
248

Dion Haefner's avatar
Dion Haefner committed
249
    ARGS="--output-on-failure" dunecontrol --only=dorie make test
Dion Haefner's avatar
Dion Haefner committed
250 251 252

You will be informed whether each test has been passed or failed, and you may find additional output in the DORiE build directory.

253
### Further Help
Dion Haefner's avatar
Dion Haefner committed
254
Open an issue, or write to the [DORiE developer mailing list](mailto:dorieteam@iup.uni-heidelberg.de).