Skip to content

Commit a67bad1

Browse files
Add missing requirements.txt and venvs for Python tutorials (#563)
* Add requirements.txt files. * Update run.sh files. --------- Co-authored-by: Benjamin Rodenberg <[email protected]>
1 parent 62e2e18 commit a67bad1

File tree

38 files changed

+175
-24
lines changed

38 files changed

+175
-24
lines changed
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
numpy >1, <2
2+
fenicsprecice~=2.0
3+
4+
# Assuming FEniCS from ppa:fenics-packages/fenics was installed https://fenicsproject.org/download/archive/
5+
# Use --system-site-packages in venv
6+
fenics-dijitso==2019.2.0.dev0
7+
fenics-dolfin==2019.2.0.13.dev0
8+
fenics-ffc==2019.2.0.dev0
9+
fenics-fiat==2019.2.0.dev0
10+
fenics-ufl-legacy==2022.3.0
11+

channel-transport-reaction/chemical-fenics/run.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ set -e -u
44
. ../../tools/log.sh
55
exec > >(tee --append "$LOGFILE") 2>&1
66

7+
python3 -m venv --system-site-package .venv
8+
. .venv/bin/activate
9+
pip install -r requirements.txt
10+
711
python3 chemical-reaction-advection-diffusion.py
812

9-
close_log
13+
close_log
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
numpy >1, <2
2+
fenicsprecice~=2.0
3+
4+
# Assuming FEniCS from ppa:fenics-packages/fenics was installed https://fenicsproject.org/download/archive/
5+
# Use --system-site-packages in venv
6+
fenics-dijitso==2019.2.0.dev0
7+
fenics-dolfin==2019.2.0.13.dev0
8+
fenics-ffc==2019.2.0.dev0
9+
fenics-fiat==2019.2.0.dev0
10+
fenics-ufl-legacy==2022.3.0

channel-transport-reaction/fluid-fenics/run.sh

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,11 @@ set -e -u
44
. ../../tools/log.sh
55
exec > >(tee --append "$LOGFILE") 2>&1
66

7+
python3 -m venv --system-site-package .venv
8+
. .venv/bin/activate
9+
pip install -r requirements.txt
10+
11+
712
python3 fluid.py
813

914
close_log
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
matplotlib
22
numpy >1, <2
3-
pyprecice~=3.0
3+
pyprecice~=3.0
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
fenicsprecice~=2.0
2+
numpy >1, <2
3+
4+
# Assuming FEniCS from ppa:fenics-packages/fenics was installed https://fenicsproject.org/download/archive/
5+
# Use --system-site-packages in venv
6+
fenics-dijitso==2019.2.0.dev0
7+
fenics-dolfin==2019.2.0.13.dev0
8+
fenics-ffc==2019.2.0.dev0
9+
fenics-fiat==2019.2.0.dev0
10+
fenics-ufl-legacy==2022.3.0

elastic-tube-3d/solid-fenics/run.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
11
#!/usr/bin/env bash
22
set -e -u
33

4+
. ../../tools/log.sh
5+
exec > >(tee --append "$LOGFILE") 2>&1
6+
7+
python3 -m venv --system-site-package .venv
8+
. .venv/bin/activate
9+
pip install -r requirements.txt
10+
411
python3 solid.py
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fmiprecice

flow-around-controlled-moving-cylinder/controller-fmi/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ if [ ! -f PIDcontroller.fmu ]; then
1515
cd ../../
1616
fi
1717

18+
python3 -m venv .venv
19+
. .venv/bin/activate
20+
pip install -r requirements.txt
21+
1822
fmiprecice ./fmi-settings.json ./precice-settings.json
1923

2024
close_log
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
pyprecice~=3.0
2+
numpy >1, <2

flow-around-controlled-moving-cylinder/solid-python/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ set -e -u
44
. ../../tools/log.sh
55
exec > >(tee --append "$LOGFILE") 2>&1
66

7+
python3 -m venv .venv
8+
. .venv/bin/activate
9+
pip install -r requirements.txt
10+
711
python3 solid.py ../precice-config.xml
812

913
close_log
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
fenicsprecice~=2.0
2+
numpy >1, <2
3+
4+
# Assuming FEniCS from ppa:fenics-packages/fenics was installed https://fenicsproject.org/download/archive/
5+
# Use --system-site-packages in venv
6+
fenics-dijitso==2019.2.0.dev0
7+
fenics-dolfin==2019.2.0.13.dev0
8+
fenics-ffc==2019.2.0.dev0
9+
fenics-fiat==2019.2.0.dev0
10+
fenics-ufl-legacy==2022.3.0

flow-over-heated-plate/solid-fenics/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ set -e -u
44
. ../../tools/log.sh
55
exec > >(tee --append "$LOGFILE") 2>&1
66

7+
python3 -m venv --system-site-packages .venv
8+
. .venv/bin/activate
9+
pip install -r requirements.txt
10+
711
python3 solid.py
812

913
close_log
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env bash
22
set -e -u
33

4-
python3 -m venv .venv
5-
. .venv/bin/activate
6-
pip install -r requirements.txt
7-
84
. ../../tools/log.sh
95
exec > >(tee --append "$LOGFILE") 2>&1
106

7+
python3 -m venv .venv
8+
. .venv/bin/activate
9+
pip install -r ../solver-python/requirements.txt
10+
1111
python3 ../solver-python/oscillator.py Mass-Left
1212

1313
close_log
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env bash
22
set -e -u
33

4-
python3 -m venv .venv
5-
. .venv/bin/activate
6-
pip install -r requirements.txt
7-
84
. ../../tools/log.sh
95
exec > >(tee --append "$LOGFILE") 2>&1
106

7+
python3 -m venv .venv
8+
. .venv/bin/activate
9+
pip install -r ../solver-python/requirements.txt
10+
1111
python3 ../solver-python/oscillator.py Mass-Right
1212

1313
close_log
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fmiprecice

oscillator/mass-left-fmi/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ if [ ! -f ../solver-fmi/Oscillator.fmu ]; then
1616
cd ../../../mass-left-fmi
1717
fi
1818

19+
python3 -m venv .venv
20+
. .venv/bin/activate
21+
pip install -r requirements.txt
22+
1923
fmiprecice fmi-settings.json precice-settings.json
2024
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
2125

oscillator/mass-left-python/requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

oscillator/mass-left-python/run.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env bash
22
set -e -u
33

4-
python3 -m venv .venv
5-
. .venv/bin/activate
6-
pip install -r requirements.txt
7-
84
. ../../tools/log.sh
95
exec > >(tee --append "$LOGFILE") 2>&1
106

7+
python3 -m venv .venv
8+
. .venv/bin/activate
9+
pip install -r ../solver-python/requirements.txt
10+
1111
python3 ../solver-python/oscillator.py Mass-Left
1212

1313
close_log
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fmiprecice

oscillator/mass-right-fmi/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ if [ ! -f ../solver-fmi/Oscillator.fmu ]; then
1616
cd ../../../mass-right-fmi
1717
fi
1818

19+
python3 -m venv .venv
20+
. .venv/bin/activate
21+
pip install -r requirements.txt
22+
1923
fmiprecice fmi-settings.json precice-settings.json
2024
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
2125

oscillator/mass-right-python/requirements.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

oscillator/mass-right-python/run.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#!/usr/bin/env bash
22
set -e -u
33

4-
python3 -m venv .venv
5-
. .venv/bin/activate
6-
pip install -r requirements.txt
7-
84
. ../../tools/log.sh
95
exec > >(tee --append "$LOGFILE") 2>&1
106

7+
python3 -m venv .venv
8+
. .venv/bin/activate
9+
pip install -r ../solver-python/requirements.txt
10+
1111
python3 ../solver-python/oscillator.py Mass-Right
1212

1313
close_log
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
fmiprecice

partitioned-heat-conduction-complex/dirichlet-fenics/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ set -e -u
44
. ../../tools/log.sh
55
exec > >(tee --append "$LOGFILE") 2>&1
66

7+
python3 -m venv --system-site-packages .venv
8+
. .venv/bin/activate
9+
pip install -r ../solver-fenics/requirements.txt
10+
711
python3 ../solver-fenics/heat.py -d -i complex
812

913
close_log

partitioned-heat-conduction-complex/neumann-fenics/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ set -e -u
44
. ../../tools/log.sh
55
exec > >(tee --append "$LOGFILE") 2>&1
66

7+
python3 -m venv --system-site-packages .venv
8+
. .venv/bin/activate
9+
pip install -r ../solver-fenics/requirements.txt
10+
711
python3 ../solver-fenics/heat.py -n -i complex
812

913
close_log
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
fenicsprecice~=2.0
2+
numpy >1, <2
3+
sympy
4+
5+
# Assuming FEniCS from ppa:fenics-packages/fenics was installed https://fenicsproject.org/download/archive/
6+
# Use --system-site-packages in venv
7+
fenics-dijitso==2019.2.0.dev0
8+
fenics-dolfin==2019.2.0.13.dev0
9+
fenics-ffc==2019.2.0.dev0
10+
fenics-fiat==2019.2.0.dev0
11+
fenics-ufl-legacy==2022.3.0

partitioned-heat-conduction-overlap/left-fenics/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ set -e -u
44
. ../../tools/log.sh
55
exec > >(tee --append "$LOGFILE") 2>&1
66

7+
python3 -m venv --system-site-packages .venv
8+
. .venv/bin/activate
9+
pip install -r ../solver-fenics/requirements.txt
10+
711
python3 ../solver-fenics/heat.py Left
812

913
close_log

partitioned-heat-conduction-overlap/right-fenics/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ set -e -u
44
. ../../tools/log.sh
55
exec > >(tee --append "$LOGFILE") 2>&1
66

7+
python3 -m venv --system-site-packages .venv
8+
. .venv/bin/activate
9+
pip install -r ../solver-fenics/requirements.txt
10+
711
python3 ../solver-fenics/heat.py Right
812

913
close_log
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
fenicsprecice~=2.0
2+
numpy >1, <2
3+
4+
# Assuming FEniCS from ppa:fenics-packages/fenics was installed https://fenicsproject.org/download/archive/
5+
# Use --system-site-packages in venv
6+
fenics-dijitso==2019.2.0.dev0
7+
fenics-dolfin==2019.2.0.13.dev0
8+
fenics-ffc==2019.2.0.dev0
9+
fenics-fiat==2019.2.0.dev0
10+
fenics-ufl-legacy==2022.3.0

partitioned-heat-conduction/neumann-fenics/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ pip install -r ../solver-fenics/requirements.txt
88
. ../../tools/log.sh
99
exec > >(tee --append "$LOGFILE") 2>&1
1010

11+
python3 -m venv --system-site-packages .venv
12+
. .venv/bin/activate
13+
pip install -r ../solver-fenics/requirements.txt
14+
1115
python3 ../solver-fenics/heat.py Neumann
1216

1317
close_log
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
fenicsprecice~=2.0
2+
numpy >1, <2
3+
matplotlib
4+
5+
# Assuming FEniCS from ppa:fenics-packages/fenics was installed https://fenicsproject.org/download/archive/
6+
# Use --system-site-packages in venv
7+
fenics-dijitso==2019.2.0.dev0
8+
fenics-dolfin==2019.2.0.13.dev0
9+
fenics-ffc==2019.2.0.dev0
10+
fenics-fiat==2019.2.0.dev0
11+
fenics-ufl-legacy==2022.3.0

perpendicular-flap/solid-fenics/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ set -e -u
44
. ../../tools/log.sh
55
exec > >(tee --append "$LOGFILE") 2>&1
66

7+
python3 -m venv --system-site-packages .venv
8+
. .venv/bin/activate
9+
pip install -r requirements.txt
10+
711
python3 solid.py
812

913
close_log

volume-coupled-diffusion/drain-fenics/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ set -e -u
44
. ../../tools/log.sh
55
exec > >(tee --append "$LOGFILE") 2>&1
66

7+
python3 -m venv --system-site-packages .venv
8+
. .venv/bin/activate
9+
pip install -r ../solver-fenics/requirements.txt
10+
711
python3 ../solver-fenics/volume-coupled-diffusion.py --drain
812

913
close_log
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
fenicsprecice~=2.0
2+
numpy >1, <2
3+
4+
# Assuming FEniCS from ppa:fenics-packages/fenics was installed https://fenicsproject.org/download/archive/
5+
# Use --system-site-packages in venv
6+
fenics-dijitso==2019.2.0.dev0
7+
fenics-dolfin==2019.2.0.13.dev0
8+
fenics-ffc==2019.2.0.dev0
9+
fenics-fiat==2019.2.0.dev0
10+
fenics-ufl-legacy==2022.3.0

volume-coupled-diffusion/source-fenics/run.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ set -e -u
44
. ../../tools/log.sh
55
exec > >(tee --append "$LOGFILE") 2>&1
66

7+
python3 -m venv --system-site-packages .venv
8+
. .venv/bin/activate
9+
pip install -r ../solver-fenics/requirements.txt
10+
711
python3 ../solver-fenics/volume-coupled-diffusion.py --source
812

913
close_log

0 commit comments

Comments
 (0)