Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions changelog-entries/680.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Added the `PRECICE_TUTORIALS_NO_VENV` environment variable to skip the setup of a Python venv in the run.sh scripts of Python-related tutorials [#680](https://github.com/precice/tutorials/pull/680)
9 changes: 6 additions & 3 deletions channel-transport-reaction/chemical-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ 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 && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv --system-site-package .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

python3 chemical-reaction-advection-diffusion.py

Expand Down
10 changes: 6 additions & 4 deletions channel-transport-reaction/fluid-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ 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 && pip freeze > pip-installed-packages.log

if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv --system-site-package .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

python3 fluid.py

Expand Down
10 changes: 7 additions & 3 deletions channel-transport/fluid-nutils/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

python3 fluid.py

close_log
10 changes: 7 additions & 3 deletions channel-transport/transport-nutils/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,13 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

python3 transport.py "$@"

close_log
9 changes: 6 additions & 3 deletions elastic-tube-1d/fluid-python/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

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

Expand Down
9 changes: 6 additions & 3 deletions elastic-tube-1d/solid-python/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

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

Expand Down
9 changes: 6 additions & 3 deletions elastic-tube-3d/solid-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +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 && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv --system-site-package .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

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

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

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

Expand Down
9 changes: 6 additions & 3 deletions flow-around-controlled-moving-cylinder/solid-python/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

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

Expand Down
9 changes: 6 additions & 3 deletions flow-over-heated-plate/fluid-su2/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ 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 && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv --system-site-package .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

SU2_preCICE_CHT.py -f laminar_config_unsteady.cfg -r --parallel

Expand Down
9 changes: 6 additions & 3 deletions flow-over-heated-plate/solid-dunefem/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi
python3 solid.py

close_log
9 changes: 6 additions & 3 deletions flow-over-heated-plate/solid-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ 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 && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv --system-site-package .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

python3 solid.py

Expand Down
9 changes: 6 additions & 3 deletions flow-over-heated-plate/solid-nutils/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi
python3 solid.py

close_log
9 changes: 6 additions & 3 deletions oscillator/mass-left-fmi/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ if [ ! -f ../solver-fmi/Oscillator.fmu ]; then
cd ../../../mass-left-fmi
fi

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

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
9 changes: 6 additions & 3 deletions oscillator/mass-right-fmi/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@ if [ ! -f ../solver-fmi/Oscillator.fmu ]; then
cd ../../../mass-right-fmi
fi

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

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
9 changes: 6 additions & 3 deletions partitioned-heat-conduction-complex/dirichlet-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ 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 ../solver-fenics/requirements.txt
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv --system-site-packages .venv
. .venv/bin/activate
pip install -r ../solver-fenics/requirements.txt
fi

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

Expand Down
9 changes: 6 additions & 3 deletions partitioned-heat-conduction-complex/neumann-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ 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 ../solver-fenics/requirements.txt
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv --system-site-packages .venv
. .venv/bin/activate
pip install -r ../solver-fenics/requirements.txt
fi

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

Expand Down
9 changes: 6 additions & 3 deletions partitioned-heat-conduction-direct/dirichlet-nutils/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

rm -rf Dirichlet-*.vtk
NUTILS_RICHOUTPUT=no python3 heat.py
Expand Down
9 changes: 6 additions & 3 deletions partitioned-heat-conduction-direct/neumann-nutils/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

rm -rf Neumann-*.vtk
NUTILS_RICHOUTPUT=no python3 heat.py
Expand Down
9 changes: 6 additions & 3 deletions partitioned-heat-conduction-overlap/left-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ 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 ../solver-fenics/requirements.txt
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv --system-site-packages .venv
. .venv/bin/activate
pip install -r ../solver-fenics/requirements.txt
fi

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

Expand Down
9 changes: 6 additions & 3 deletions partitioned-heat-conduction-overlap/right-fenics/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ 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 ../solver-fenics/requirements.txt
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv --system-site-packages .venv
. .venv/bin/activate
pip install -r ../solver-fenics/requirements.txt
fi

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

Expand Down
9 changes: 6 additions & 3 deletions partitioned-heat-conduction/dirichlet-fenics/run.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
#!/usr/bin/env bash
set -e -u

python3 -m venv --system-site-packages .venv
. .venv/bin/activate
pip install -r ../solver-fenics/requirements.txt
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv --system-site-packages .venv
. .venv/bin/activate
pip install -r ../solver-fenics/requirements.txt
fi

. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1
Expand Down
9 changes: 6 additions & 3 deletions partitioned-heat-conduction/dirichlet-nutils/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ set -e -u
. ../../tools/log.sh
exec > >(tee --append "$LOGFILE") 2>&1

python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv .venv
. .venv/bin/activate
pip install -r requirements.txt && pip freeze > pip-installed-packages.log
fi

rm -rf Dirichlet-*.vtk
NUTILS_RICHOUTPUT=no python3 heat.py
Expand Down
13 changes: 6 additions & 7 deletions partitioned-heat-conduction/neumann-fenics/run.sh
Original file line number Diff line number Diff line change
@@ -1,16 +1,15 @@
#!/usr/bin/env bash
set -e -u

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

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

python3 -m venv --system-site-packages .venv
. .venv/bin/activate
pip install -r ../solver-fenics/requirements.txt
if [ -z "${PRECICE_TUTORIALS_NO_VENV:-}" ]
then
python3 -m venv --system-site-packages .venv
. .venv/bin/activate
pip install -r ../solver-fenics/requirements.txt
fi

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

Expand Down
Loading