Downloading dolfin-adjoint¶
Docker images (all platforms and versions)¶
Docker allows us to build and ship consistent high-performance dolfin-adjoint installations with FEniCS for almost any platform. To get started, follow these 2 steps:
Install Docker. Mac and Windows users should install the Docker Toolbox (this is a simple one-click install) and Linux users should follow these instructions.
Install the FEniCS Docker script:
curl -s https://get.fenicsproject.org | bash
If running on Mac or Windows, make sure you run this and other commands inside the Docker Quickstart Terminal.
Stable version:¶
Once both Docker and the FEniCS Docker script have been installed, you can easily start a FEniCS session with dolfin-adjoint by running the following command:
fenicsproject run quay.io/dolfinadjoint/dolfin-adjoint
A Jupyter notebook instance with a user defined name (here myproject) can be started with:
fenicsproject notebook myproject quay.io/dolfinadjoint/dolfin-adjoint
fenicsproject start myproject
The FEniCS Docker script can also be used to create persistent sessions:
fenicsproject create myproject quay.io/dolfinadjoint/dolfin-adjoint
fenicsproject start myproject
Development version:¶
The development version of dolfin-adjoint and FEniCS is available with:
fenicsproject run quay.io/dolfinadjoint/dev-dolfin-adjoint
To update the development container, run:
fenicsproject pull quay.io/dolfinadjoint/dev-dolfin-adjoint
To see all the options run:
fenicsproject help
For more details and tips on how to work with FEniCS and Docker, see our FEniCS Docker page.
Dependencies¶
Mandatory dependencies:¶
- FEniCS. For installation instructions for FEniCS, see their installation instructions.
- libadjoint. This is a library written in C that manipulates the tape of the forward model to derive the associated adjoint equations.
Optional dependencies:¶
- SLEPc. This is necessary if you want to conduct generalised stability analyses.
- IPOPT and pyipopt: This is the best available open-source optimisation algorithm. Strongly recommended if you wish to solve PDE-constrained optimisation problems. Make sure to compile IPOPT against the Harwell Subroutine Library.
- Moola: A set of optimisation algorithms specifically designed for PDE-constrained optimisation problems. Install with pip install moola. Note: still experimental.
Binary packages (Ubuntu)¶
Binary packages are currently available for Ubuntu users through the launchpad PPA. To install dolfin-adjoint, do
sudo apt-add-repository ppa:libadjoint/ppa
sudo apt-get update
sudo apt-get install python-dolfin-adjoint
which should install the latest stable version on your system. Once that’s done, why not try out the tutorial?
From source¶
The latest stable release of dolfin-adjoint and libadjoint is version 2016.2 which is compatible with FEniCS 2016.2. Download links:
- libadjoint:
git clone -b libadjoint-2016.2.0 https://bitbucket.org/dolfin-adjoint/libadjoint
- dolfin-adjoint:
git clone -b dolfin-adjoint-2016.2.0 https://bitbucket.org/dolfin-adjoint/dolfin-adjoint
The development version is available with the following command:
git clone https://bitbucket.org/dolfin-adjoint/libadjoint
git clone https://bitbucket.org/dolfin-adjoint/dolfin-adjoint
As dolfin-adjoint is a pure Python module, once its dependencies are installed the development version can be used without system-wide installation via
export PYTHONPATH=<path to dolfin-adjoint>:$PYTHONPATH
libadjoint needs to be compiled with:
cd libadjoint
mkdir build; cd build
cmake -DCMAKE_INSTALL_PREFIX=<install directory> ..
make install
Contributions (such as handling new features of FEniCS, or new test cases or examples) are very welcome.
Virtual machine¶
If you’d like to try dolfin-adjoint out without any installation headaches, try out the FENICS VirtualBox virtual machine with FEniCS and dolfin-adjoint pre-installed. Here are the instructions:
- Download and install VirtualBox from https://www.virtualbox.org, or from your operating system.
- Download the virtual machine.
- Start VirtualBox, click on “File -> Import Appliance”, select the virtual machine image and click on “Import”.
- Select the “dolfin-adjoint VM” and click on “Start” to boot the machine.
- For installing new software you need the login credentials:
- Username: fenics
- Password: fenics
Older versions¶
An older version compatible with FEniCS 1.6 can be downloaded with:
git clone -b dolfin-adjoint-1.6 https://bitbucket.org/dolfin-adjoint/dolfin-adjoint
git clone -b libadjoint-1.6 https://bitbucket.org/dolfin-adjoint/libadjoint