Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add missing requirements.txt and venvs for Python tutorials #563

Merged
merged 12 commits into from
Oct 19, 2024
Merged
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
numpy >1, <2
pyprecice~=3.0
scipy
mpi4py < 4
NiklasVin marked this conversation as resolved.
Show resolved Hide resolved
fenicsprecice
NiklasVin marked this conversation as resolved.
Show resolved Hide resolved

6 changes: 5 additions & 1 deletion channel-transport-reaction/chemical-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv --system-site-package .venv
. .venv/bin/activate
pip install -r requirements.txt

python3 chemical-reaction-advection-diffusion.py

close_log
close_log
NiklasVin marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
numpy >1, <2
pyprecice~=3.0
scipy
mpi4py <4
fenicsprecice

NiklasVin marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions channel-transport-reaction/fluid-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv --system-site-package .venv
. .venv/bin/activate
pip install -r requirements.txt


python3 fluid.py

close_log
3 changes: 3 additions & 0 deletions elastic-tube-1d/fluid-python/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
pyprecice~=3.0
numpy
NiklasVin marked this conversation as resolved.
Show resolved Hide resolved
matplotlib
5 changes: 5 additions & 0 deletions elastic-tube-1d/fluid-python/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt


python3 ./FluidSolver.py ../precice-config.xml

close_log
2 changes: 2 additions & 0 deletions elastic-tube-1d/solid-python/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pyprecice~=3.0
numpy
NiklasVin marked this conversation as resolved.
Show resolved Hide resolved
5 changes: 5 additions & 0 deletions elastic-tube-1d/solid-python/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt


python3 ./SolidSolver.py ../precice-config.xml

close_log
4 changes: 4 additions & 0 deletions elastic-tube-3d/solid-fenics/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pyprecice~=3.0
NiklasVin marked this conversation as resolved.
Show resolved Hide resolved
fenicsprecice
numpy
NiklasVin marked this conversation as resolved.
Show resolved Hide resolved
mpi4py <4
NiklasVin marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions elastic-tube-3d/solid-fenics/run.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
#!/usr/bin/env bash
set -e -u

NiklasVin marked this conversation as resolved.
Show resolved Hide resolved
python3 -m venv --system-site-package .venv
. .venv/bin/activate
pip install -r requirements.txt

python3 solid.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fmiprecice
4 changes: 4 additions & 0 deletions flow-around-controlled-moving-cylinder/controller-fmi/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ if [ ! -f PIDcontroller.fmu ]; then
cd ../../
fi

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt

fmiprecice ./fmi-settings.json ./precice-settings.json

close_log
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
pyprecice~=3.0
numpy
NiklasVin marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 4 additions & 0 deletions flow-around-controlled-moving-cylinder/solid-python/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt

python3 solid.py ../precice-config.xml

close_log
4 changes: 4 additions & 0 deletions flow-over-heated-plate/solid-fenics/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pyprecice~=3.0
fenicsprecice
numpy
mpi4py <4
4 changes: 4 additions & 0 deletions flow-over-heated-plate/solid-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv --system-site-packages .venv
. .venv/bin/activate
pip install -r requirements.txt

python3 solid.py

close_log
8 changes: 4 additions & 4 deletions oscillator-overlap/mass-left-python/run.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
set -e -u

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt

. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv ../solver-python/.venv
. ../solver-python/.venv/bin/activate
pip install -r ../solver-python/requirements.txt

python3 ../solver-python/oscillator.py Mass-Left

close_log
8 changes: 4 additions & 4 deletions oscillator-overlap/mass-right-python/run.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
set -e -u

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt

. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv ../solver-python/.venv
. ../solver-python/.venv/bin/activate
pip install -r ../solver-python/requirements.txt

python3 ../solver-python/oscillator.py Mass-Right

close_log
1 change: 1 addition & 0 deletions oscillator/mass-left-fmi/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fmiprecice
4 changes: 4 additions & 0 deletions oscillator/mass-left-fmi/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ if [ ! -f ../solver-fmi/Oscillator.fmu ]; then
cd ../../../mass-left-fmi
fi

python3 -m venv ../sover-fmi/.venv
. ../sover-fmi/.venv/bin/activate
pip install -r requirements.txt

fmiprecice fmi-settings.json precice-settings.json
python3 ../solver-fmi/calculate-error.py ../mass-left-fmi/fmi-settings.json ../mass-left-fmi/precice-settings.json ../mass-right-fmi/fmi-settings.json ../mass-right-fmi/precice-settings.json Mass-Left

Expand Down
8 changes: 4 additions & 4 deletions oscillator/mass-left-python/run.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
set -e -u

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt

. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv ../solver-python/.venv
. ../solver-python/.venv/bin/activate
pip install -r ../solver-python/requirements.txt

python3 ../solver-python/oscillator.py Mass-Left

close_log
1 change: 1 addition & 0 deletions oscillator/mass-right-fmi/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fmiprecice
4 changes: 4 additions & 0 deletions oscillator/mass-right-fmi/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@ if [ ! -f ../solver-fmi/Oscillator.fmu ]; then
cd ../../../mass-right-fmi
fi

python3 -m venv ../sover-fmi/.venv
. ../sover-fmi/.venv/bin/activate
pip install -r requirements.txt

fmiprecice fmi-settings.json precice-settings.json
python3 ../solver-fmi/calculate-error.py ../mass-left-fmi/fmi-settings.json ../mass-left-fmi/precice-settings.json ../mass-right-fmi/fmi-settings.json ../mass-right-fmi/precice-settings.json Mass-Right

Expand Down
8 changes: 4 additions & 4 deletions oscillator/mass-right-python/run.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env bash
set -e -u

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt

. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv ../solver-python/.venv
. ../solver-python/.venv/bin/activate
pip install -r ../solver-python/requirements.txt

python3 ../solver-python/oscillator.py Mass-Right

close_log
1 change: 1 addition & 0 deletions oscillator/solver-fmi/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
fmiprecice
4 changes: 4 additions & 0 deletions partitioned-heat-conduction-complex/dirichlet-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv --system-site-packages ../solver-fenics/.venv
. ../solver-fenics/.venv/bin/activate
pip install -r ../solver-fenics/requirements.txt

python3 ../solver-fenics/heat.py -d -i complex

close_log
4 changes: 4 additions & 0 deletions partitioned-heat-conduction-complex/neumann-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv --system-site-packages ../solver-fenics/.venv
. ../solver-fenics/.venv/bin/activate
pip install -r ../solver-fenics/requirements.txt

python3 ../solver-fenics/heat.py -n -i complex

close_log
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pyprecice~=3.0
fenicsprecice
numpy
sympy
mpi4py <4
4 changes: 4 additions & 0 deletions partitioned-heat-conduction-overlap/left-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv --system-site-packages ../solver-fenics/.venv
. ../solver-fenics/.venv/bin/activate
pip install -r ../solver-fenics/requirements.txt

python3 ../solver-fenics/heat.py Left

close_log
4 changes: 4 additions & 0 deletions partitioned-heat-conduction-overlap/right-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv --system-site-packages ../solver-fenics/.venv
. ../solver-fenics/.venv/bin/activate
pip install -r ../solver-fenics/requirements.txt

python3 ../solver-fenics/heat.py Right

close_log
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
pyprecice~=3.0
fenicsprecice
numpy
mpi4py <4
4 changes: 4 additions & 0 deletions partitioned-heat-conduction/dirichlet-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv --system-site-packages ../solver-fenics/.venv
. ../solver-fenics/.venv/bin/activate
pip install -r ../solver-fenics/requirements.txt

python3 ../solver-fenics/heat.py Dirichlet

close_log
4 changes: 4 additions & 0 deletions partitioned-heat-conduction/neumann-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv --system-site-packages ../solver-fenics/.venv
. ../solver-fenics/.venv/bin/activate
pip install -r ../solver-fenics/requirements.txt

python3 ../solver-fenics/heat.py Neumann

close_log
5 changes: 5 additions & 0 deletions partitioned-heat-conduction/solver-fenics/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pyprecice~=3.0
fenicsprecice
numpy
sympy
mpi4py <4
5 changes: 5 additions & 0 deletions perpendicular-flap/solid-fenics/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
pyprecice~=3.0
fenicsprecice
mpi4py <4
numpy
matplotlib
4 changes: 4 additions & 0 deletions perpendicular-flap/solid-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv --system-site-packages .venv
. .venv/bin/activate
pip install -r requirements.txt

python3 solid.py

close_log
4 changes: 4 additions & 0 deletions volume-coupled-diffusion/drain-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv --system-site-packages ../solver-fenics/.venv
. ../solver-fenics/.venv/bin/activate
pip install -r ../solver-fenics/requirements.txt

python3 ../solver-fenics/volume-coupled-diffusion.py --drain

close_log
4 changes: 4 additions & 0 deletions volume-coupled-diffusion/solver-fenics/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
fenicsprecice
pyprecice~=3.0
mpi4py <4
numpy
4 changes: 4 additions & 0 deletions volume-coupled-diffusion/source-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv --system-site-packages ../solver-fenics/.venv
. ../solver-fenics/.venv/bin/activate
pip install -r ../solver-fenics/requirements.txt

python3 ../solver-fenics/volume-coupled-diffusion.py --source

close_log