Installation
Option 1: With FEniCSx binaries installed
Clone the repository and install the package:
git clone https://github.com/Universite-Gustave-Eiffel/elastodynamicsx.git
cd elastodynamicsx/
pip3 install .
Test by running an a demo:
python3 demo/weq_2D-SH_FullSpace.py
Option 2: Build a dedicated docker image
Because it can still be somewhat tricky to install fenicsx
, the package provides two docker files, for use within a shell (Dockerfile.shell) or within a Jupyter notebook (Dockerfile.lab). Here we show how to build the docker images and how to use them.
Clone the repository and build a docker image called ‘elastolab:latest’:
git clone https://github.com/Universite-Gustave-Eiffel/elastodynamicsx.git
cd elastodynamicsx/
docker build -t elastolab:latest -f Dockerfile.lab .
Run the image and shares the folder from which the command is executed:
docker run --rm -v $(pwd):/root/shared -p 8888:8888 elastolab:latest
# Open the URL printed on screen beginning with http://127.0.0.1:8888/?token...
# The examples are in /root/demo; the shared folder is in /root/shared
Clone the repository and build a docker image called ‘elastodynamicsx:latest’:
git clone https://github.com/Universite-Gustave-Eiffel/elastodynamicsx.git
cd elastodynamicsx/
docker build -t elastodynamicsx:latest -f Dockerfile.shell .
Run the image and shares the folder from which the command is executed:
# Grant access to root to the graphical backend (the username inside the container will be 'root')
# Without this access matplotlib and pyvista won't display
xhost + si:localuser:root
# Create a container that will self destroy on close
docker run -it --rm --ipc=host --net=host --env="DISPLAY" -v $(pwd):/root/shared --volume="$HOME/.Xauthority:/root/.Xauthority:rw" elastodynamicsx:latest bash
###
# At this point we are inside the container
#
# The examples are in /root/demo; the shared folder is in /root/shared
###
# Test
python3 demo/weq_2D-SH_FullSpace.py
Note that the container must be given the right to display graphics. The solution adopted here to avoid MIT-SHM errors due to sharing host display :0 is to disable IPC namespacing with –ipc=host. It is given here, although described as not totally satisfactory because of isolation loss. Other more advanced solutions are also given in there.
Dependencies
Main dependencies:
DOLFINx version: 0.8.0
DOLFINx-MPC. This dependency is optional (periodic BCs).
DOLFINx-MPC version: 0.8.1
numpy
pyvista
andmatplotlib
for 3D/2D plots
tqdm
(progress bar for loops)