Installing dolfin-adjoint¶
Note: If you are looking to install the (deprecated) dolfin-adjoint/libadjoint library, visit the dolfin-adjoint/libadjoint webpage.
What is the difference between dolfin-adjoint/dolfin-adjoint and dolfin-adjoint/libadjoint?
Docker images (all platforms)¶
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.
If running on Mac or Windows, make sure you run the following commands inside the Docker Quickstart Terminal.
dolfin-adjoint with FEniCS:¶
You can run dolfin-adjoint with the pre-built images at:
ghcr.io/dolfin-adjoint/dolfin-adjoint
First the FEniCS Docker script:
docker run -ti -v $(pwd):/root/shared --name=name_of_container ghcr.io/dolfin-adjoint/dolfin-adjoint
which can then be restarted at an later instance with:
docker container start -i name_of_container
To update the image call:
docker pull ghcr.io/dolfin-adjoint/dolfin-adjoint
and create a new docker container.
PIP (all platforms)¶
Install dolfin-adjoint and its Python dependencies with pip:
python3 -m pip install dolfin-adjoint
Test your installation by running:
python3 -c "import fenics_adjoint"
Optional dependencies:¶
IPOPT and Python bindings (cyipopt): 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.
Optizelle: An Open Source Software Library Designed To Solve General Purpose Nonlinear Optimization Problems.
Source code¶
The source code of dolfin-adjoint is available on https://github.com/dolfin-adjoint/dolfin-adjoint.