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)

4
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/) and the [DUNE-PDELab](https://dune-project.org/modules/dune-pdelab/) module. 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.
5 6 7

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

8
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](http://www.iup.uni-heidelberg.de/), supervised by [Kurt Roth](http://ts.iup.uni-heidelberg.de/people/prof-dr-kurt-roth/), in collaboration with [Ole Klein](https://conan.iwr.uni-heidelberg.de/people/oklein/) and the [Scientific Computing Group](https://conan.iwr.uni-heidelberg.de/) of [IWR Heidelberg](https://typo.iwr.uni-heidelberg.de/home/). 
9 10 11 12


# Installation Instructions

13

Dion Haefner's avatar
Dion Haefner committed
14
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.
15

Dion Haefner's avatar
Dion Haefner committed
16
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.
17

18
## Docker Installation - Simple Setup
19

20 21 22 23
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

Lukas Riedel's avatar
Lukas Riedel committed
24
    docker build -f docker/dorie.dockerfile -t dorie .
25 26 27

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

Dion Haefner's avatar
Dion Haefner committed
34

35
## Manual Installation
36

Dion Häfner's avatar
Dion Häfner committed
37 38 39
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!
40 41

### Dependencies
Lukas Riedel's avatar
Lukas Riedel committed
42 43 44 45 46
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.

The specified versions are the _supported_ ones, where compatibility is ensured
by CI tests.
47 48 49

| Software | Version/Branch | Comments |
| ---------| -------------- | -------- |
Lukas Riedel's avatar
Lukas Riedel committed
50 51
| CMake | 3.10.2 |
| GCC | 7.3 | Alternatively: LLVM Clang >=6
52 53
| git |
| pkg-config |
Lukas Riedel's avatar
Lukas Riedel committed
54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| HDF5 | 1.10 | with MPI support
| FFTW3 | 3.3.7 | with MPI support
| Python | 3.6 |
| pip | 3.6 |
| MPI | | Tested with OpenMPI 2.1.1
| SuperLU | 5.2 |
| [dune-common](https://gitlab.dune-project.org/core/dune-common) | releases/2.6
| [dune-geometry](https://gitlab.dune-project.org/core/dune-geometry) | releases/2.6
| [dune-grid](https://gitlab.dune-project.org/core/dune-grid) | releases/2.6
| [dune-uggrid](https://gitlab.dune-project.org/staging/dune-uggrid) | releases/2.6
| [dune-istl](https://gitlab.dune-project.org/core/dune-istl) | releases/2.6
| [dune-localfunctions](https://gitlab.dune-project.org/core/dune-localfunctions) | releases/2.6
| [dune-functions](https://gitlab.dune-project.org/staging/dune-functions) | releases/2.6
| [dune-typetree](https://gitlab.dune-project.org/staging/dune-typetree) | releases/2.6
| [dune-pdelab](https://gitlab.dune-project.org/pdelab/dune-pdelab) | releases/2.6
69
| [dune-randomfield](https://gitlab.dune-project.org/oklein/dune-randomfield) | master
Lukas Riedel's avatar
Lukas Riedel committed
70 71 72 73 74


### Optional Packages
| Software | Version/Branch | Comments |
| ---------| -------------- | -------- |
75
| [dune-testtools](https://gitlab.dune-project.org/quality/dune-testtools) | master | Handles system tests
Lukas Riedel's avatar
Lukas Riedel committed
76
| [doxygen](http://www.stack.nl/~dimitri/doxygen/) | 1.8.13 | Builds documentation
Lukas Riedel's avatar
Lukas Riedel committed
77 78
| [METIS](http://glaros.dtc.umn.edu/gkhome/views/metis) | 5 | For parallel runs
| [ParMETIS](http://glaros.dtc.umn.edu/gkhome/views/metis) | 4 | For parallel runs
79 80


81
### Step-by-step Instructions
Lukas Riedel's avatar
Lukas Riedel committed
82
These instructions are suitable for a clean **Ubuntu** or **macOS** 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.
83

84 85
If you installed [Anaconda](https://conda.io/docs/user-guide/install/download.html) on your machine, you don't need to install Python or Pip. Simply skip these packages when using the package managers for installing the software. However, notice the warnings when compiling DORiE below!

Lukas Riedel's avatar
Lukas Riedel committed
86
1. **macOS** users need to start by installing the Apple Command Line Tools by executing
87 88

        xcode-select --install
Dion Haefner's avatar
Dion Haefner committed
89

Lukas Riedel's avatar
Lukas Riedel committed
90
2. Install third party packages:
Lukas Riedel's avatar
Lukas Riedel committed
91
    
92
    **Ubuntu:**
Dion Haefner's avatar
Dion Haefner committed
93
    
Dion Haefner's avatar
Dion Haefner committed
94
        apt update 
Lukas Riedel's avatar
Lukas Riedel committed
95
        apt install cmake doxygen gcc g++ gfortran \
Dion Haefner's avatar
Dion Haefner committed
96 97
                    git libatlas-base-dev libfftw3-dev libfftw3-mpi-dev \
                    libfreetype6-dev libhdf5-mpi-dev libopenmpi-dev libpng-dev \
98
                    libsuperlu-dev libxft-dev python3-dev python3-pip
99

Lukas Riedel's avatar
Lukas Riedel committed
100
    **macOS:**
101 102

        brew update
Lukas Riedel's avatar
Lukas Riedel committed
103
        brew install cmake doxygen gcc libpng open-mpi \
104
                    pkg-config python3 superlu
105 106 107
        brew install hdf5 --with-mpi
        brew install fftw --with-mpi

Lukas Riedel's avatar
Lukas Riedel committed
108
3. The parallel linear solver of DORiE can make use of the ParMETIS package. If you want to run DORiE in parallel on multiple processes, additionally install METIS and ParMETIS:
Lukas Riedel's avatar
Lukas Riedel committed
109 110 111

    **Ubuntu:**

112
        apt install libmetis-dev libparmetis-dev
Lukas Riedel's avatar
Lukas Riedel committed
113

Lukas Riedel's avatar
Lukas Riedel committed
114
    **macOS:** _Support is dropped because ParMETIS is currently unavailable from Homebrew._
Lukas Riedel's avatar
Lukas Riedel committed
115 116 117

    **Parallel runs without these two packages are possible but not supported!**

118 119 120
4. Clone the DUNE modules and DORiE into a suitable folder on your machine. Use `git checkout` to switch to the correct branches (see above). Enter the parent folder, and call

        CMAKE_FLAGS="-DDUNE_PYTHON_VIRTUALENV_SETUP=True -DDUNE_PYTHON_ALLOW_GET_PIP=True" ./dune-common/bin/dunecontrol all
121

122
    to build all DUNE modules. Additionally, you can add `MAKE_FLAGS="-j X"` before the call to `dunecontrol` to compile on `X` processes in parallel.
123

124
    If you installed software into paths not appended to your `PATH` variable, you will have to add `CMAKE_FLAGS` to the call to make sure that CMake finds all packages. Alternatively, you can add a custom options file. See the [DUNE Installation Instructions](https://dune-project.org/doc/installation/) for details. CMake will throw an error if required packages are not found.
125 126

    **Warning:** Anacoda supplies its own version of HDF5 which is typically found first by CMake. If you have Anaconda installed on your machine, add
127

128
        HDF5_ROOT=/usr/local
129

130
    to the `CMAKE_FLAGS` in the call to `dunecontrol` above.
Dion Haefner's avatar
Dion Haefner committed
131
 
Lukas Riedel's avatar
Lukas Riedel committed
132
5. After a successful build you can call the `dorie` wrapper located in `dorie/build-cmake/bin` from anywhere on your machine, but it is more handy to add this location to your search path. You can add the directory to your `PATH` variable by calling
133

Lukas Riedel's avatar
Lukas Riedel committed
134
        PATH=<path/to/>dorie/build-cmake/bin:$PATH
135

Lukas Riedel's avatar
Lukas Riedel committed
136 137 138
    However, this will only last for your current terminal session. Another option is to add this path permanently in your shell configuration file.

    **Installing DUNE and DORiE via `make install` into your usual work environment is strongly discouraged!**
139

140 141 142 143 144 145 146 147 148
### Experimental Features
The local operator implementing Richards equation's discretization supports
multiple scheme settings. Setting these via the config file is disabled by
default. You can enable this feature by reconfiguring DORiE with the CMake flag
`-DEXPERIMENTAL_DG_FEATURES=On`, and rebuilding it.

The configuration settings in the section `[dg.experimental]` will then override
the default settings.

149

150 151 152
## 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
153 154 155 156

* [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.

157
# Usage
Dion Haefner's avatar
Dion Haefner committed
158

159
## Documentation
Dion Haefner's avatar
Dion Haefner committed
160

161
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
162

163
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
164

Dion Haefner's avatar
Dion Haefner committed
165
    dunecontrol --only=dorie make doc
Dion Haefner's avatar
Dion Haefner committed
166

Lukas Riedel's avatar
Lukas Riedel committed
167 168 169 170
or navigate to the `dorie/build-cmake` directory and call

    make doc

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

173
## Run, DORiE, Run!
Lukas Riedel's avatar
Lukas Riedel committed
174
If you made the DORiE wrapper directory available through your `PATH` variable, you can call it by simply executing
175 176

    dorie <command>
177

Lukas Riedel's avatar
Lukas Riedel committed
178 179 180
You can always find the wrapper in the `dorie/build-cmake/bin` folder of your installation and call it directly with

    <path/to/>dorie/build-cmake/bin/dorie <command>
181

182
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
183 184 185

    dorie create

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

188 189
Tweak the paramters to your liking and then call

190 191 192 193
    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

194
    dorie run <inifile>
Dion Haefner's avatar
Dion Haefner committed
195

196
to execute the main program.
Dion Haefner's avatar
Dion Haefner committed
197

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

Dion Häfner's avatar
Dion Häfner committed
200
    dorie --help
Dion Haefner's avatar
Dion Haefner committed
201

202 203
or

Dion Häfner's avatar
Dion Häfner committed
204
    dorie <command> --help
205

Lukas Riedel's avatar
Lukas Riedel committed
206 207 208 209 210 211 212 213 214

## Start an interactive Docker session

In case you built DORiE using `docker build` 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`.

215
## Troubleshooting
Dion Haefner's avatar
Dion Haefner committed
216 217
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`.

218
If the problem persists, take a look at the [List of Known Bugs](https://ts-gitlab.iup.uni-heidelberg.de/dorie/dorie/issues), or create an issue yourself. For problems related to the installation, refer to the sections below.
Dion Haefner's avatar
Dion Haefner committed
219

220
### Debugging
Dion Haefner's avatar
Dion Haefner committed
221
DORiE can be built with debugging flags via CMake. To do so, run
222

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

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

Dion Haefner's avatar
Dion Haefner committed
227
**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.
228

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

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

233 234 235 236 237
#### 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
238
The debugger `gdb` is pre-installed in the Docker container.
239

240 241 242 243 244 245 246 247 248
### Running System Tests
DORiE includes system tests for comparing its results the ones of ODE solvers or
former versions of itself. They ensure that DORiE is running correctly and
producing the expected results. If you installed DORiE, you have to make sure
that all test executables are built by calling

    dunecontrol --only=dorie make build_tests

You then execute the system tests with
Dion Haefner's avatar
Dion Haefner committed
249

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

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

254
### Further Help
255
[Open an issue](https://ts-gitlab.iup.uni-heidelberg.de/dorie/dorie/issues/new), or write to the [DORiE developer mailing list](mailto:dorieteam@iup.uni-heidelberg.de).