-
Notifications
You must be signed in to change notification settings - Fork 89
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'develop' into update_dfn_comparison_examples
Conflicts: examples/papers/dfn_comparison/example_1_data.py examples/papers/dfn_comparison/example_1_vem.py examples/papers/dfn_comparison/example_2_1_tpfa.py examples/papers/dfn_comparison/example_2_1_vem.py examples/papers/dfn_comparison/example_2_1_vem_coarse.py src/porepy/fracs/non_conforming.py src/porepy/numerics/fv/mpfa.py
- Loading branch information
Showing
178 changed files
with
12,036 additions
and
4,365 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
# Docker Advanced | ||
|
||
To facilitate the devoloping, using the text editor,version control and other tools already installed on your computers, | ||
it is possible to share files from the host into the container: | ||
|
||
```bash | ||
> docker run -ti -v $(pwd):/home/porepy/shared pmgbergen/porepylib:py27 | ||
``` | ||
To allow the X11 forwarding in the container, on Linux system just run: | ||
|
||
```bash | ||
> docker run -ti --rm -e DISPLAY=$DISPLAY -v /tmp/.X11-unix:/tmp/.X11-unix -v $(pwd):/home/porepy/shared pmgbergen/porepylib:py27 | ||
``` | ||
It is also available a docker container based on python 3.6, just running: | ||
```bash | ||
> docker run -ti docker.io/pmgbergen/porepylib:py36 | ||
``` | ||
For Windows system, you need to install Cygwin/X version and running the command in Cygwin terminal. While for mac system, you need to install xquartz. | ||
|
||
# For Developing/ enhance Docker | ||
If you would like to compile Docker for developing porpose. You could associate this github repo with docker cloud service for deployment. Alternatively, on you own machine on terminal (Linux) or on Docker terminal (Mac/Win) you just run: | ||
```bash | ||
> cd dockerfiles/py36 && docker build . --tag porepy:develop | ||
``` | ||
The tag of your container will be "porepy" and the version "develop". | ||
# Q&A | ||
To clean the possible cache created by docker you just run: | ||
```bash | ||
> docker stop $(docker ps -a -q) && docker rm $(docker ps -a -q)" | ||
``` | ||
This command will stop all running container and remove them from your cache. When you exit from the container you need carelly to write exit in terminal in place of close by brute force the terminal. | ||
The following command allow you delete all orphan image that you have create. | ||
```bash | ||
> docker rmi -f $(docker images | grep "<none>" | awk "{print \$3}")" | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
FROM phusion/baseimage:0.9.22 | ||
MAINTAINER dbaroli <davide.baroli@uni.lu> | ||
# Get Ubuntu updates | ||
USER root | ||
RUN apt-get update && \ | ||
apt-get upgrade -y -o Dpkg::Options::="--force-confold" && \ | ||
apt-get -y install locales sudo && \ | ||
echo "C.UTF-8 UTF-8" > /etc/locale.gen && \ | ||
locale-gen && \ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
# Set locale environment | ||
ENV LC_ALL=C.UTF-8 \ | ||
LANG=C.UTF-8 \ | ||
LANGUAGE=C.UTF-8 | ||
|
||
COPY set-home-permission.sh /etc/my_init.d/set-home-permission.sh | ||
RUN useradd -m -s /bin/bash -G sudo,docker_env porepy && \ | ||
echo "porepy:docker" | chpasswd && \ | ||
echo "porepy ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \ | ||
touch /etc/service/syslog-forwarder/down && \ | ||
echo "cat /home/porepy/WELCOME" >> /home/porepy/.bashrc && \ | ||
chmod +x /etc/my_init.d/set-home-permission.sh && \ | ||
ldconfig | ||
RUN echo "/usr/local/lib/python3/dist-packages" >> /usr/local/lib/python3.5/dist-packages/debian-ubuntu-sitepath-fix.pth | ||
RUN touch /etc/service/syslog-forwarder/down | ||
|
||
USER porepy | ||
ENV POREPY_HOME /home/porepy | ||
RUN touch $POREPY_HOME/.sudo_as_admin_successful && \ | ||
mkdir $POREPY_HOME/shared | ||
VOLUME /home/porepy/shared | ||
|
||
# Print something nice on entry. | ||
COPY WELCOME $POREPY_HOME/WELCOME | ||
|
||
WORKDIR /home/porepy | ||
USER root | ||
ENTRYPOINT ["sudo","/sbin/my_init","--quiet","--","sudo","-u","porepy","/bin/bash","-l","-c"] | ||
CMD ["/bin/bash","-i"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# porepy project base image | ||
|
||
You are seeing this message because the Dockerfile you | ||
are using did not add its own WELCOME message to the container. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
#!/bin/bash | ||
# User can pass e.g. --env HOST_UID=1003 so that UID in the container matches | ||
# with the UID on the host. This is useful for Linux users, Mac and Windows | ||
# already do transparent mapping of shared volumes. | ||
if [ "$HOST_UID" ]; then | ||
usermod -u $HOST_UID porepy | ||
fi | ||
if [ "$HOST_GID" ]; then | ||
groupmod -g $HOST_GID porepy | ||
fi | ||
# This makes sure that all files in /home/porepy are accessible by the user | ||
# fenics. We exclude the folder ~/shared to reduce IO out to the host. Docker | ||
# for Mac, Docker for Windows and the UID/GID trick above should mean that file | ||
# permissions work seamlessly now. | ||
find /home/porepy -maxdepth 1 | sed "1d" | grep -v "/home/porepy/shared" | xargs chown -R porepy:porepy 2> /dev/null || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
FROM docker.io/pmgbergen/porepylib:base | ||
MAINTAINER dbaroli <davide.baroli@uni.lu> | ||
|
||
USER root | ||
|
||
RUN apt-get -qq update && \ | ||
apt-get -y --with-new-pkgs \ | ||
-o Dpkg::Options::="--force-confold" upgrade && \ | ||
apt-get -y install curl && \ | ||
curl -s https://packagecloud.io/install/repositories/github/git-lfs/script.deb.sh | bash && \ | ||
apt-get update -y; apt-get install -y --force-yes --fix-missing --no-install-recommends curl git git-lfs unzip tree subversion vim cmake bison g++ gfortran openmpi-bin pkg-config wget \ | ||
libpcre3-dev bison flex swig libglu1-mesa libxcursor-dev libxft-dev libxinerama-dev libmed1v5 libpng12-0 liboce-foundation10 liboce-modeling10 pyqt5-dev-tools bash-completion libxt6 &&\ | ||
git lfs install && \ | ||
apt-get clean && \ | ||
git lfs install && \ | ||
ln -s /usr/lib/x86_64-linux-gnu/libGLU.so.1 /usr/lib/libGLU.so.1 &&\ | ||
ln -s /usr/lib/x86_64-linux-gnu/libSM.so.6 /usr/lib/libSM.so.6 && \ | ||
ln -s /usr/lib/x86_64-linux-gnu/libICE.so.6 /usr/lib/libICE.so.6 && \ | ||
ln -s /usr/lib/x86_64-linux-gnu/libX11.so.6 /usr/lib/libX11.so.6 && \ | ||
ln -s /usr/lib/x86_64-linux-gnu/libXext.so.6 /usr/lib/libXext.so.6 && \ | ||
ln -s /usr/lib/x86_64-linux-gnu/libXt.so.6 /usr/lib/libXt.so.6 && \ | ||
ln -s /usr/lib/x86_64-linux-gnu/mesa/libGL.so.1 /usr/lib/libGL.so.1 &&\ | ||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* | ||
|
||
|
||
WORKDIR /tmp | ||
|
||
ENV GMSH_VERSION 2.11.0 | ||
RUN wget http://gmsh.info/bin/Linux/gmsh-${GMSH_VERSION}-Linux64.tgz &&\ | ||
tar xf gmsh-${GMSH_VERSION}-Linux64.tgz && \ | ||
cp gmsh-${GMSH_VERSION}-Linux/bin/gmsh /usr/local/bin/gmsh && \ | ||
rm -rf /tmp/* | ||
|
||
RUN cd /tmp && \ | ||
wget https://repo.continuum.io/miniconda/Miniconda-latest-Linux-x86_64.sh -O conda.sh && \ | ||
chmod +x conda.sh && \ | ||
bash conda.sh -b -p /home/porepy/.conda && \ | ||
rm /tmp/* | ||
|
||
RUN id porepy | ||
RUN chown -R porepy:porepy /home | ||
|
||
USER porepy | ||
|
||
ENV PATH=/home/porepy/.conda/bin:$PATH | ||
|
||
|
||
RUN echo "PATH=/home/porepy/.conda/bin:$PATH" >> ~/.profile && \ | ||
/bin/bash -c -l "source ~/.profile" | ||
|
||
RUN hash -r && \ | ||
conda config --set always_yes yes --set changeps1 no && \ | ||
conda update -q conda && \ | ||
conda info -a && \ | ||
conda create --yes -n porepy python="2.7" | ||
RUN /bin/bash -c -l "source activate porepy" | ||
ENV PATH /home/porepy/.conda/envs/porepy/bin:$PATH | ||
ENV CONDA_DEFAULT_ENV porepy | ||
ENV CONDA_PREFIX /home/porepy/.conda/envs/porepy | ||
|
||
|
||
RUN conda install --yes numpy scipy matplotlib pip nose sip &&\ | ||
conda install -c https://conda.anaconda.org/clinicalgraphics vtk &&\ | ||
pip install setuptools && \ | ||
pip install enum34 && \ | ||
pip install numpy-stl && \ | ||
pip install coveralls && \ | ||
pip install coverage &&\ | ||
pip install numba cython &&\ | ||
pip install jupyter ipython pdbpp | ||
|
||
|
||
WORKDIR $POREPY_HOME | ||
RUN mkdir -p $POREPY_HOME/.config/matplotlib | ||
COPY matplotlibsrc $POROPY_HOME/.config/matplotlib/matplotlibrc | ||
|
||
|
||
COPY dependencies $POROPY_HOME/.dependencies | ||
RUN pip install --no-cache-dir -r $POROPY_HOME/.dependencies | ||
RUN /bin/bash -c -l "echo 'source activate porepy'>>~/.profile" && \ | ||
/bin/bash -c -l "echo 'PYTHONPATH=/home/porepy/conda/envs/porepy/lib/python2.7/site-packages:$PYTHONPATH'>>~/.profile" | ||
COPY install $POREPY_HOME | ||
RUN sudo chmod +x install | ||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
meshio == 1.10 | ||
networkx == 1.10 | ||
numpy >= 1.10 | ||
scipy >= 0.17 | ||
sympy >= 1.0 | ||
matplotlib >= 1.0 | ||
pymetis >= 2016.2;platform_system=="Linux" | ||
cython >= 0.23;platform_system=="Linux" | ||
pytest >= 3.0.0 | ||
pytest-cov | ||
pytest-runner >= 2.0 | ||
coverage | ||
coveralls | ||
six |
Oops, something went wrong.