diff --git a/woodSim_Container/Containerfile b/woodSim_Container/Containerfile new file mode 100644 index 0000000000000000000000000000000000000000..d10fa35383462a3f98d0280ada8613b58c598710 --- /dev/null +++ b/woodSim_Container/Containerfile @@ -0,0 +1,92 @@ +FROM ubuntu:22.04 +LABEL maintainer="klaus.boehnlein@tu-dresden.de" + +ARG DEBIAN_FRONTEND=noninteractive + +RUN apt-get update && apt-get install -y ssh rsh-client && apt-get install -y libibverbs-dev ibverbs-utils && apt-get install -y \ + gcc \ + g++ \ + make \ + doxygen \ + slurm-client \ + wget \ + build-essential \ + cmake \ + coinor-libipopt-dev \ + libdune-common-dev \ + libdune-grid-dev \ + libdune-istl-dev \ + libdune-localfunctions-dev \ + libdune-typetree-dev \ + libdune-uggrid-dev \ + gdb \ + gfortran \ + git \ + libadolc-dev \ + libmetis-dev \ + libopenblas-base \ + libparmetis-dev \ + libsuitesparse-dev \ + libsuperlu-dev \ + libsuperlu-dist-dev \ + libtinyxml2-dev \ + ninja-build \ + pkg-config \ + python2.7 \ + python2.7-dev \ + python3 \ + python3-dev \ + python3-pip \ + python3-venv \ + python3-prettytable\ + python3-numpy \ + python3-matplotlib \ + python3-seaborn \ + python3-tabulate \ + valgrind \ + vim \ + && apt-get autoremove && apt-get clean + + +WORKDIR /dune + + +RUN \ + git clone https://gitlab.dune-project.org/core/dune-common.git \ + && git clone https://gitlab.dune-project.org/core/dune-geometry.git \ + && git clone https://gitlab.dune-project.org/core/dune-grid.git \ + && git clone https://gitlab.dune-project.org/core/dune-istl.git \ + && git clone https://gitlab.dune-project.org/core/dune-localfunctions.git \ + && git clone https://gitlab.dune-project.org/staging/dune-functions.git \ + && git clone https://gitlab.dune-project.org/staging/dune-uggrid.git \ + && git clone https://gitlab.dune-project.org/staging/dune-typetree.git \ + && git clone https://git.imp.fu-berlin.de/agnumpde/dune-matrix-vector.git \ + && git clone https://git.imp.fu-berlin.de/agnumpde/dune-fufem.git \ + && git clone https://git.imp.fu-berlin.de/agnumpde/dune-solvers.git \ + && git clone https://gitlab.mn.tu-dresden.de/iwr/dune-gmsh4.git \ + && git clone https://gitlab.mn.tu-dresden.de/s7603593/dune-microstructure.git + +# For the sake of reproducibility: +# Set HEAD to particular commits wherever we are not using release branches. +RUN cd dune-common && git checkout releases/2.9 +RUN cd dune-geometry && git checkout releases/2.9 +RUN cd dune-grid && git checkout releases/2.9 +RUN cd dune-istl && git checkout releases/2.9 +RUN cd dune-localfunctions && git checkout releases/2.9 +RUN cd dune-functions && git checkout releases/2.9 +RUN cd dune-uggrid && git checkout releases/2.9 +RUN cd dune-typetree && git checkout releases/2.9 +RUN cd dune-matrix-vector && git checkout releases/2.9 +RUN cd dune-fufem && git checkout releases/2.9 +RUN cd dune-solvers && git checkout releases/2.9 +RUN cd dune-gmsh4 && git checkout releases/2.9 +RUN cd dune-microstructure && git checkout 9298cbd07a99c23f55e245bae19199eee34aa289 + +# Build the non-packaged modules from source +COPY dune-sequential.opts /dune/ +RUN dunecontrol --opts=dune-sequential.opts all + + +# ENTRYPOINT ["/bin/bash", "--login", "--rcfile", "/dune/dune-startup", "-i"] + +# LABEL run podman run --interactive --tty --rm IMAGE diff --git a/woodSim_Container/Simulation-Readme.md b/woodSim_Container/Simulation-Readme.md new file mode 100644 index 0000000000000000000000000000000000000000..b95639097ec2e2fdd3d7157630cfecacaf415533 --- /dev/null +++ b/woodSim_Container/Simulation-Readme.md @@ -0,0 +1,26 @@ +# In order to run the simulations, an installation of docker is required (see https://docs.docker.com/engine/install/ ). +# The simulations as well as the creation of figures is done in the following steps: + +@RUN THE SIMULATIONS + +# 1. Build the docker Container image (named 'woodsim_image') from 'Containerfile': + +docker build --no-cache=true -t woodsim_image -f Containerfile . + +# 2. Start the computation of Correctors and effective quantities. +# create container woodsim_container from the image 'woodsim_image' and run the command 'python3 ...' +# *input arguments: 1: Container-Flag(True if script is used inside container) 2: first experiment number 3: last experiment number. +# e.g. "1 0 3" ~ computations inside the container from experiment 0 to experiment 3 + +docker run --name woodsim_container woodsim_image python3 /dune/dune-microstructure/experiment/compWood/runWoodSimulations.py 1 0 3 + + +@CREATE THE FIGURES + +# 1. Copy files/results (/compWood - folder) from the container to a $LOCALPATH on the Host machine: +docker cp woodsim_container:/dune/dune-microstructure/experiment/compWood $LOCALPATH + +# 2. Run python-script 'createFigures.py' to generate the paper figures. +($LOCALPATH) python3 createFigures.py + + diff --git a/woodSim_Container/dune-sequential.opts b/woodSim_Container/dune-sequential.opts new file mode 100755 index 0000000000000000000000000000000000000000..6fac68c497dd16366e5ab9de8b2e3b12ca1496e1 --- /dev/null +++ b/woodSim_Container/dune-sequential.opts @@ -0,0 +1,2 @@ +# set flags for CMake: +CMAKE_FLAGS="-DCMAKE_CXX_FLAGS='-g -fdiagnostics-color=always -Wall -fmax-errors=2 -DHAVE_CSTDDEF' -DCMAKE_DISABLE_FIND_PACKAGE_MPI=TRUE -DUG_ENABLE_PARALLEL=false -DCMAKE_BUILD_TYPE=Release" diff --git a/woodSim_Container/runSimulations.sh b/woodSim_Container/runSimulations.sh new file mode 100755 index 0000000000000000000000000000000000000000..8ddaebea07475eaf1f0258145991a4d3cfeebbcb --- /dev/null +++ b/woodSim_Container/runSimulations.sh @@ -0,0 +1,24 @@ +# build with "chmod +x runSimulations.sh" +# run via "./runSimulations.sh" + +# Define your local path for simulation results and figures +echo "Define output path on your host machine: " +# LOCALPATH='/home/klaus/Desktop/test' +read LOCALPATH + +docker build --no-cache=true -t woodsim_image -f Containerfile . + +docker rm woodsim_container + +image_id=$(docker images --quiet | head -1) + +echo "image ID used: $image_id" + +docker run --name woodsim_container $image_id python3 /dune/dune-microstructure/experiment/compWood/runWoodSimulations.py 1 0 3 + +docker cp woodsim_container:/dune/dune-microstructure/experiment/compWood $LOCALPATH + +cd $LOCALPATH + +python3 $LOCALPATH/compWood/createFigures.py +