Downloading dolfin-adjoint¶
Dependencies¶
Mandatory dependencies:¶
- FEniCS, version 1.6. For installation instructions for FEniCS, see their installation instructions.
- libadjoint, version 1.6. 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.
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
Binary packages¶
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 1.6 which is compatible with FEniCS 1.6. Download links:
- libadjoint:
git clone -b dolfin-adjoint-1.6 https://bitbucket.org/dolfin-adjoint/dolfin-adjoint
- dolfin-adjoint:
git clone -b libadjoint-1.6 https://bitbucket.org/dolfin-adjoint/libadjoint
The development version is available with the following command:
git clone https://bitbucket.org/dolfin-adjoint/dolfin-adjoint
hg clone https://bitbucket.org/dolfin-adjoint/libadjoint
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 ..
make install
Contributions (such as handling new features of FEniCS, or new test cases or examples) are very welcome.
Older versions¶
An older version, that is compatible with FEniCS 1.5 can be downloaded with:
git clone -b dolfin-adjoint-1.5 https://bitbucket.org/dolfin-adjoint/dolfin-adjoint
git clone -b libadjoint-1.5 https://bitbucket.org/dolfin-adjoint/libadjoint