DUNE How to's
DUNE stands for Distributed and Unified Numerics Environment Links to an external site. and provides building blocks for solving partial differential equations.
The software will only install and run under Linux or Mac OS. A collections of useful Linux/Unix (Mac OS) command line commands can be found here Links to an external site..
Windows users should use the Windows Subsystem for Linux Links to an external site. and install Ubuntu 20.04 LTS on it. Once Ubuntu is installed you may want to install necessary packages, a list is found in bootstrap.sh Download bootstrap.sh.
If you decided to use WSL you should also install a X-server (e.g. VcXsrv) in order to connect graphical output from the WSL Ubuntu system to your Windows desktop. Installation instructions for VcXsrv can be found here.
Then proceed with the following instructions.
Prerequisites (can be installed through conda or the system):
- A compiler (g++ >= 7.5.x, clang >= 10)
- cmake >= 3.13.3 (see instruction below)
- pkg-config (see instruction below)
We recommend to install the necessary DUNE packages through pip using the following commands.
Create and activate a new virtual environment to avoid conflicts with other installations. There are two similar ways to install DUNE.
Create a virtual environment using Python's venv module. In a empty folder run the following commands:
python3 -m venv venv
source venv/bin/activate
pip install -U pip
pip install -U matplotlib
pip install -U dune-fem
To run one of the examples below download the files and put them into an empty folder.
Then run
python laplace.py
The first run might takes some time since some JIT (just in time) compilation of
modules is being carried out.
Optionally, we can also use Anaconda Links to an external site. and a conda env, but recently there have been some problems when installing mpi4py which is needed for the course.
conda create -n duneproject
conda activate duneproject
conda install -c anaconda ipython
conda install -c conda-forge matplotlib
conda install -c conda-forge fenics-ufl pkg-config cmake
The last step is to install dune-fem 2.8.0.x which will take some time (~15min)
since the code is compiled from source and multiple DUNE modules are installed.
pip install -U dune-fem
The first run might takes some time since some JIT (just in time) compilation of
modules is being carried out.
Documentation: