kunstrasenspringer / precice_st Goto Github PK
View Code? Open in Web Editor NEWDesign und Implementation of system tests for the distributed multi-physics simulation package precCICE
Design und Implementation of system tests for the distributed multi-physics simulation package precCICE
Hey!
I had a brief look at the comparison scripts (such as compare_of-of.py).
I think it would be good to avoid calling system tools through Python wherever possible, as doing so decreases the portability (and in some cases, also the safety).
With this issue, I just want to draw your attention on Python packages such as difflib for computing deltas and re for regular expressions. I think they are also much easier to use!
Dear @kunstrasenspringer,
Trying to debug your problem mentioned in precice/tutorials#3, I noticed that defining the OpenFOAM environment inside a Docker container is not as trivial as in a normal installation.
First of all, keep in mind that every Docker step creates a new intermediate container, which is then deleted, together with its local environment. Therefore, sourcing the /opt/openfoam-dev/etc/bashrc
file inside a dedicated RUN
command is actually not changing anything. That's why you need to source it every time before running any OpenFOAM command.
Moreover, I noticed that even in this case, some paths, such as the FOAM_RUN
are not set correctly, because the USER
variable is not defined in this minimal environment. You can check the environment using env
. One approach could be to use ENV USER=alice
to add this manually in the environment, however there are probably better solutions for this. Maybe you can just invoke docker run
in a better way to solve this.
On Dockerhub you can find many Dockerfiles for OpenFOAM, you may find a better approach there.
Here is a minimum working example, based on your Dockerfile.of-ccx
:
FROM kunstrasenspringer/precice:latest
USER root
RUN apt-get update && apt-get install -y \
software-properties-common \
wget \
apt-transport-https \
libyaml-cpp-dev \
bzip2 \
libbz2-dev \
cmake \
automake \
autoconf \
autotools-dev \
libarpack2-dev
# Install openfoam
RUN add-apt-repository "http://dl.openfoam.org/ubuntu dev"
RUN sh -c "wget -O - http://dl.openfoam.org/gpg.key | apt-key add -"
RUN add-apt-repository http://dl.openfoam.org/ubuntu && apt update
RUN apt-get -y install openfoam-dev --no-install-recommends
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
USER alice
WORKDIR /home/alice
RUN source /opt/openfoam-dev/etc/bashrc
ENV USER=alice
ENTRYPOINT source /opt/openfoam-dev/etc/bashrc && env
Also, please check if wmake creates the FOAM_USER_LIBBIN
if it does not already exist. If not, please open an issue on the OpenFOAM adapter and I will improve this later.
Good luck!
(by the way, I am not sure why you overwrite the shell binary, you may want to check this again)
Shouldn't be much effort, probably mainly wrapping parens around the print statements.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.