Install using Anaconda

Let us create a new environment called fenics and install under this.

conda create -n fenics -c conda-forge fenics mshr

You may also want to install some other packages

conda install -n fenics -c conda-forge ipython notebook matplotlib scipy

Now activate the environment and do your Fenics work

source activate fenics

After you are done working with Fenics

source deactivate

Show list of installed packages in this environment

conda list -n fenics

Update the packages in this environment

conda update -n fenics -c conda-forge --all

NOTE: Fenics installed via Anaconda does not provide full functionality of Fenics, and Docker images are the best option for this.

Installing using Docker

First install Docker; this is easy on a Mac and needs some configuration on Linux, see here. After this, start Docker and install the fenics script

curl -s https://get.fenicsproject.org | bash

Then install a Fenics image

fenicsproject pull

Note that this will install the latest image of Fenics. You are now ready to work with Fenics. Go into some directory where you want to do your work and do

fenicsproject run

To update the Fenics version at any time, just do fenicsproject pull. Many things like plot windows will not work in Docker, so you may want to use the Conda option to install Fenics.

Installing an older version using Docker

To install an older version using Docker

docker pull quay.io/fenicsproject/stable:2017.2.0


fenicsproject pull stable:2017.2.0

Now, run this version like this

docker run -ti -p -v $(pwd):/home/fenics/shared \
       -w /home/fenics/shared quay.io/fenicsproject/stable:2017.2.0


fenicsproject run stable:2017.2.0

Install dolfinx using docker

Install latest version

docker pull dolfinx/real

Run in docker

docker run -ti -p -v $(pwd):/home/fenics/shared \
       -w /home/fenics/shared dolfinx/real