Skip to content
Snippets Groups Projects
Commit ea846967 authored by David Seus's avatar David Seus
Browse files

Initial Commit

parents
No related branches found
No related tags found
No related merge requests found
# gitignore file
# this file lists files not to be tracked by git.
# keine Kommentare in die gleiche Zeile, sonst wird die Zeile ignoriert
# LaTeX files not to be tracked
*.aux
*.bbl
*.blg
*.log
*.backup
*.bak
*.kilepr
*.toc
*.dvi
*.tdo
*.figlist
*.bcf
*.auxlock
*.dpth
*.pdf
#Beamer
*.acn
*.glo
*.nav
*.out
*.snm
*.syg
*.vrb
*.brf
# Ignoriere temp files von gaengigen Texteditoren
*~
# MATLAB Numerische Experimente
*.mat
# Archive
*.tar
*.gz
*.tar.gz
*.zip
# Ignoriere files vom Typ
*.pdf
*.ps
*.doc
*.docx
*.odt
*.ods
*.xml
*.svg
*.fig
*.md5
# Ignoriere Bilder und Graphiken sowie Videos und Musik
#*.png
#*.jpg
#*.jpeg
#*.eps
*.svg
*.pgf
#*.gif
#*.avi
#*.mp4
#*.mp3
#*.xcf
# always consider files containing source code regardless of their name
!*.cc
!*.hh
!*.c
!*.h
!*.sh
!*.py
# Directories
# Using FeMuX in Docker
## Build the docker image:
docker build -t femux .
## Run docker container with graphical display, share folder `pwd`:
docker run -it --env HOST_UID=$(id -u $USER) --env HOST_GID=$(id -g $USER) --env
DISPLAY=unix$DISPLAY --device /dev/dri --volume /tmp/.X11-unix:/tmp/.X11-unix:rw --volume
$(pwd):/home/fenics/shared --name femux femux /bin/bash
If you want the container do be automatically deleted after exiting add `--rm` option.
If you have trouble with internet connection inside the container use
--dns=YOUR_DNS_SERVER
## Step into the container:
docker start femux & docker exec -ti -u fenics femux /bin/bash -l
## Install NSAC and dumux-fenics:
./install_femux.sh
## Usefull docker commands:
List all docker container
docker ps -a
Remove container
docker rm $container
Remove all stopped container
docker container prune
List all images
docker images
Remove image
docker rmi $image
# Troubleshooting:
**Problem**
1. I can't install packages via `apt-get install` inside the container
**Solution**
1. If the package is not found first `apt-get update` and then try again. If there is no connection
check your dns settings.
# Navier-Stokes-Allen-Cahn Framework
## Installation for anaconda.
### Tested with [minconda3 v4.3.31](https://conda.io/miniconda.html)
--------------------------------------------------------------------
```
conda create -n NSAC -c mikaem/label/docker-conda-gcc hdf5-parallel
source activate NSAC
conda install -c mikaem/label/docker-conda-gcc h5py-parallel
conda install -c mikaem/label/docker-conda-gcc fenics
conda install -c mikaem/label/docker-conda-gcc mshr
pip install -r requirements.txt
```
[fenicstools](https://github.com/mikaem/fenicstools) for postprocessing
```
git clone https://github.com/mikaem/fenicstools.git fenicstools
python fenicstools/setup.py install;
```
--------------------------------------------------------------------
## Installation for [Docker](https://www.docker.com/).
Install Docker following https://docs.docker.com/engine/getstarted/step_one/
Pull the latest fenics Docker image
```
docker pull quay.io/fenicsproject/stable:latest;
```
Run Docker with the dns option for the uni-network
```
docker run --dns=129.69.252.252 -ti -v $(pwd):/home/fenics/shared --name NSAC
quay.io/fenicsproject/stable:latest;
echo "export PYTHONPATH=/home/fenics/shared/" >> fenics.env.conf
source fenics.env.conf
```
Clone this git repo and install dependencies
```
git clone https://gitlab.mathematik.uni-stuttgart.de/ostrowls/NSAC.git shared/NSAC
pip3 install --user -r NSAC/requirements.txt;
```
Install fenicstools for postprocessing (might not be possible without sudo)
```
git clone https://github.com/mikaem/fenicstools.git fenicstools;
cd fenicstools;
sudo python3 setup.py install;
cd ..
rm -rvf fenicstools;
```
Start/stop the Container with
```
docker start/stop NSAC
```
After starting enter the container with
```
docker exec -ti -u fenics LDD-scheme /bin/bash -l
```
Exit the container with
```
exit
```
docker run --dns=129.69.252.252 -it --env HOST_UID=$(id -u $USER) --env HOST_GID=$(id -g $USER) --env DISPLAY=unix$DISPLAY --device /dev/dri --volume /tmp/.X11-unix:/tmp/.X11-unix:rw --volume $(pwd):/home/fenics/shared --name LDD-TPR quay.io/fenicsproject/stable:latest /bin/bash
# Numerical experiments for LDD-TPR
## Manual on using latest fenix image in Docker
Pull the latest fenics Docker image
```
docker pull quay.io/fenicsproject/stable:latest;
## Create docker container named LDD-TPR with graphical display, share folder `pwd`:
docker run --dns=129.69.252.252 -it --env HOST_UID=$(id -u $USER) --env HOST_GID=$(id -g $USER) --env DISPLAY=unix$DISPLAY --device /dev/dri --volume /tmp/.X11-unix:/tmp/.X11-unix:rw --volume $(pwd):/home/fenics/shared --name LDD-TPR quay.io/fenicsproject/stable:latest /bin/bash
If you want the container do be automatically deleted after exiting add `--rm` option.
If you have trouble with internet connection inside the container use
--dns=YOUR_DNS_SERVER
## Start LDD-TPR container and step into the container:
docker start LDD-TPR & docker exec -ti -u fenics LDD-TPR /bin/bash -l
## Usefull docker commands:
List all docker container
docker ps -a
Remove container
docker rm $container
Remove all stopped container
docker container prune
List all images
docker images
Remove image
docker rmi $image
# Troubleshooting:
**Problem**
1. I can't install packages via `apt-get install` inside the container
2. I cannot create files or folders (no write permissions)
**Solution**
1. If the package is not found first `apt-get update` and then try again. If there is no connection
check your dns settings.
2. In the container, execute once the script `Rechtesetup/setpermissions.sh` to gain write access in `/home/fenics/shared`
cd /home/fenics/shared/Rechtesetup & sudo ./setpermissions.sh
#!/bin/bash
# The user can pass the user and group id by passing
# --env HOST_UID=$(id -u $USER) --env HOST_GID=$(id -g $USER)
# with the UID on the host to the container. Should work for Linux, Mac and Windows.
# Allows to manage the writes for shared volumes.
if [ "$HOST_UID" ]; then
usermod -u $HOST_UID fenics
fi
if [ "$HOST_GID" ]; then
groupmod -g $HOST_GID fenics
fi
# Make sure that everything in /dumux is accessible by the dumux user
# sed "1d" removes first line which is the folder itself
# exclude the shared folder using grep. This folder should be accessible by setting the UID/GID.
# chown transfers ownership to group dumux user dumux
# the OR true trick avoids the script exiting due to use of set -e
# find /dumux -maxdepth 1 | sed "1d" | grep -v "/dumux/shared" | xargs chown -R dumux:dumux 2> /dev/null || true
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment