diff --git a/breaking-dam-2d/fluid-openfoam/run.sh b/breaking-dam-2d/fluid-openfoam/run.sh index 33f5cdb23..d1c9bfbd5 100755 --- a/breaking-dam-2d/fluid-openfoam/run.sh +++ b/breaking-dam-2d/fluid-openfoam/run.sh @@ -1,10 +1,14 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + cp 0/alpha.water_orig 0/alpha.water blockMesh setFields -touch fluid-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/breaking-dam-2d/solid-calculix/run.sh b/breaking-dam-2d/solid-calculix/run.sh index 0cc701cc5..3a9f49aae 100755 --- a/breaking-dam-2d/solid-calculix/run.sh +++ b/breaking-dam-2d/solid-calculix/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + ccx_preCICE -i flap -precice-participant Solid + +close_log diff --git a/channel-transport-reaction/chemical-fenics/run.sh b/channel-transport-reaction/chemical-fenics/run.sh index 9ee75e87c..63712e999 100755 --- a/channel-transport-reaction/chemical-fenics/run.sh +++ b/channel-transport-reaction/chemical-fenics/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + python3 chemical-reaction-advection-diffusion.py + +close_log diff --git a/channel-transport-reaction/clean-tutorial.sh b/channel-transport-reaction/clean-tutorial.sh new file mode 100755 index 000000000..88f60e8c6 --- /dev/null +++ b/channel-transport-reaction/clean-tutorial.sh @@ -0,0 +1,11 @@ +#!/bin/sh +set -e -u + +# shellcheck disable=SC1091 +. ../tools/cleaning-tools.sh + +clean_tutorial . +clean_precice_logs . +rm -fv ./*.log +rm -fv ./*.vtu + diff --git a/channel-transport-reaction/fluid-fenics/run.sh b/channel-transport-reaction/fluid-fenics/run.sh index 788f40d13..e25136551 100755 --- a/channel-transport-reaction/fluid-fenics/run.sh +++ b/channel-transport-reaction/fluid-fenics/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + python3 fluid.py + +close_log diff --git a/channel-transport/fluid-nutils/run.sh b/channel-transport/fluid-nutils/run.sh index 00b103a23..7094b61c8 100755 --- a/channel-transport/fluid-nutils/run.sh +++ b/channel-transport/fluid-nutils/run.sh @@ -1,7 +1,12 @@ -#!/bin/sh +#!/bin/bash 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 fluid.py + +close_log diff --git a/channel-transport/fluid-openfoam/run.sh b/channel-transport/fluid-openfoam/run.sh index c191b9e48..da82a9ba2 100755 --- a/channel-transport/fluid-openfoam/run.sh +++ b/channel-transport/fluid-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/channel-transport/transport-nutils/run.sh b/channel-transport/transport-nutils/run.sh index c3048dffd..4430e392c 100755 --- a/channel-transport/transport-nutils/run.sh +++ b/channel-transport/transport-nutils/run.sh @@ -1,7 +1,12 @@ -#!/bin/sh +#!/bin/bash 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 transport.py + +close_log diff --git a/elastic-tube-1d/fluid-cpp/clean.sh b/elastic-tube-1d/fluid-cpp/clean.sh index ff2895ffa..f84ab182f 100755 --- a/elastic-tube-1d/fluid-cpp/clean.sh +++ b/elastic-tube-1d/fluid-cpp/clean.sh @@ -5,3 +5,4 @@ set -e -u rm -rvf ./output/*.vtk clean_precice_logs . +clean_case_logs . diff --git a/elastic-tube-1d/fluid-cpp/run.sh b/elastic-tube-1d/fluid-cpp/run.sh index c6be7a9bd..0e005451e 100755 --- a/elastic-tube-1d/fluid-cpp/run.sh +++ b/elastic-tube-1d/fluid-cpp/run.sh @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + if [ ! -d build ]; then mkdir build cmake -S . -B build @@ -8,3 +11,5 @@ if [ ! -d build ]; then fi ./build/FluidSolver ../precice-config.xml + +close_log diff --git a/elastic-tube-1d/fluid-python/clean.sh b/elastic-tube-1d/fluid-python/clean.sh index ff2895ffa..f84ab182f 100755 --- a/elastic-tube-1d/fluid-python/clean.sh +++ b/elastic-tube-1d/fluid-python/clean.sh @@ -5,3 +5,4 @@ set -e -u rm -rvf ./output/*.vtk clean_precice_logs . +clean_case_logs . diff --git a/elastic-tube-1d/fluid-python/run.sh b/elastic-tube-1d/fluid-python/run.sh index 4272d9b77..dcf4c901d 100755 --- a/elastic-tube-1d/fluid-python/run.sh +++ b/elastic-tube-1d/fluid-python/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + python3 ./FluidSolver.py ../precice-config.xml + +close_log diff --git a/elastic-tube-1d/fluid-rust/clean.sh b/elastic-tube-1d/fluid-rust/clean.sh index ff2895ffa..f84ab182f 100755 --- a/elastic-tube-1d/fluid-rust/clean.sh +++ b/elastic-tube-1d/fluid-rust/clean.sh @@ -5,3 +5,4 @@ set -e -u rm -rvf ./output/*.vtk clean_precice_logs . +clean_case_logs . diff --git a/elastic-tube-1d/fluid-rust/run.sh b/elastic-tube-1d/fluid-rust/run.sh index 79a022fa3..9985f982b 100755 --- a/elastic-tube-1d/fluid-rust/run.sh +++ b/elastic-tube-1d/fluid-rust/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + cargo run --release ../precice-config.xml + +close_log diff --git a/elastic-tube-1d/solid-cpp/clean.sh b/elastic-tube-1d/solid-cpp/clean.sh index 7330c8aaa..4c864fb36 100755 --- a/elastic-tube-1d/solid-cpp/clean.sh +++ b/elastic-tube-1d/solid-cpp/clean.sh @@ -4,3 +4,4 @@ set -e -u . ../../tools/cleaning-tools.sh clean_precice_logs . +clean_case_logs . diff --git a/elastic-tube-1d/solid-cpp/run.sh b/elastic-tube-1d/solid-cpp/run.sh index 3b85f004b..fe674287d 100755 --- a/elastic-tube-1d/solid-cpp/run.sh +++ b/elastic-tube-1d/solid-cpp/run.sh @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + if [ ! -d build ]; then mkdir build cmake -S . -B build @@ -8,3 +11,5 @@ if [ ! -d build ]; then fi ./build/SolidSolver ../precice-config.xml + +close_log diff --git a/elastic-tube-1d/solid-python/clean.sh b/elastic-tube-1d/solid-python/clean.sh index 7330c8aaa..4c864fb36 100755 --- a/elastic-tube-1d/solid-python/clean.sh +++ b/elastic-tube-1d/solid-python/clean.sh @@ -4,3 +4,4 @@ set -e -u . ../../tools/cleaning-tools.sh clean_precice_logs . +clean_case_logs . diff --git a/elastic-tube-1d/solid-python/run.sh b/elastic-tube-1d/solid-python/run.sh index ad00c6c38..6e772ed24 100755 --- a/elastic-tube-1d/solid-python/run.sh +++ b/elastic-tube-1d/solid-python/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + python3 ./SolidSolver.py ../precice-config.xml + +close_log diff --git a/elastic-tube-1d/solid-rust/clean.sh b/elastic-tube-1d/solid-rust/clean.sh index 7330c8aaa..4c864fb36 100755 --- a/elastic-tube-1d/solid-rust/clean.sh +++ b/elastic-tube-1d/solid-rust/clean.sh @@ -4,3 +4,4 @@ set -e -u . ../../tools/cleaning-tools.sh clean_precice_logs . +clean_case_logs . diff --git a/elastic-tube-1d/solid-rust/run.sh b/elastic-tube-1d/solid-rust/run.sh index d9103ab27..85bee03f5 100755 --- a/elastic-tube-1d/solid-rust/run.sh +++ b/elastic-tube-1d/solid-rust/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + cargo run --release ../precice-config.xml + +close_log diff --git a/elastic-tube-3d/fluid-openfoam/run.sh b/elastic-tube-3d/fluid-openfoam/run.sh index c305d6d9b..9d072bcda 100755 --- a/elastic-tube-3d/fluid-openfoam/run.sh +++ b/elastic-tube-3d/fluid-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + cp -r constant/polyMesh.orig constant/polyMesh -touch fluid-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/elastic-tube-3d/solid-calculix/run.sh b/elastic-tube-3d/solid-calculix/run.sh index 5ebdaf5b2..6e8b5a83f 100755 --- a/elastic-tube-3d/solid-calculix/run.sh +++ b/elastic-tube-3d/solid-calculix/run.sh @@ -1,6 +1,11 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + export OMP_NUM_THREADS=1 export CCX_NPROC_EQUATION_SOLVER=1 ccx_preCICE -i tube -precice-participant Solid + +close_log diff --git a/elastic-tube-3d/solid-fenics/run.sh b/elastic-tube-3d/solid-fenics/run.sh index 15315c67d..2c9d2da09 100755 --- a/elastic-tube-3d/solid-fenics/run.sh +++ b/elastic-tube-3d/solid-fenics/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e -u python3 solid.py diff --git a/flow-around-controlled-moving-cylinder/controller-fmi/clean.sh b/flow-around-controlled-moving-cylinder/controller-fmi/clean.sh index f7f371eab..d4e26a453 100755 --- a/flow-around-controlled-moving-cylinder/controller-fmi/clean.sh +++ b/flow-around-controlled-moving-cylinder/controller-fmi/clean.sh @@ -3,5 +3,4 @@ set -e -u . ../../tools/cleaning-tools.sh -rm -rfv ./output/ -clean_precice_logs . +clean_fmi . diff --git a/flow-around-controlled-moving-cylinder/controller-fmi/run.sh b/flow-around-controlled-moving-cylinder/controller-fmi/run.sh index 0b55398ac..46a4f217d 100755 --- a/flow-around-controlled-moving-cylinder/controller-fmi/run.sh +++ b/flow-around-controlled-moving-cylinder/controller-fmi/run.sh @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + if [ ! -f PIDcontroller.fmu ]; then cd fmu rm -rf build @@ -13,3 +16,5 @@ if [ ! -f PIDcontroller.fmu ]; then fi fmiprecice ./fmi-settings.json ./precice-settings.json + +close_log diff --git a/flow-around-controlled-moving-cylinder/fluid-openfoam/run.sh b/flow-around-controlled-moving-cylinder/fluid-openfoam/run.sh index 797f27984..e2a8415a0 100755 --- a/flow-around-controlled-moving-cylinder/fluid-openfoam/run.sh +++ b/flow-around-controlled-moving-cylinder/fluid-openfoam/run.sh @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh transformPoints -scale '(0.0016 0.0016 1)' transformPoints -translate '(0.0 0.0 -0.05)' @@ -8,7 +11,7 @@ transformPoints -translate '(0.0 0.0 -0.05)' rm -rf 0 cp -r 0.orig 0 -touch fluid-openfoam.foam - ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/flow-around-controlled-moving-cylinder/solid-python/clean.sh b/flow-around-controlled-moving-cylinder/solid-python/clean.sh index fa3b754f1..9e559af3b 100755 --- a/flow-around-controlled-moving-cylinder/solid-python/clean.sh +++ b/flow-around-controlled-moving-cylinder/solid-python/clean.sh @@ -1,4 +1,6 @@ #!/bin/sh . ../../tools/cleaning-tools.sh + clean_precice_logs . +clean_case_logs . diff --git a/flow-around-controlled-moving-cylinder/solid-python/run.sh b/flow-around-controlled-moving-cylinder/solid-python/run.sh index dbf7a6708..678a825eb 100755 --- a/flow-around-controlled-moving-cylinder/solid-python/run.sh +++ b/flow-around-controlled-moving-cylinder/solid-python/run.sh @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 python3 solid.py ../precice-config.xml +close_log diff --git a/flow-over-heated-plate-nearest-projection/fluid-openfoam/run.sh b/flow-over-heated-plate-nearest-projection/fluid-openfoam/run.sh index c191b9e48..da82a9ba2 100755 --- a/flow-over-heated-plate-nearest-projection/fluid-openfoam/run.sh +++ b/flow-over-heated-plate-nearest-projection/fluid-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/flow-over-heated-plate-nearest-projection/solid-openfoam/run.sh b/flow-over-heated-plate-nearest-projection/solid-openfoam/run.sh index 57e9395ee..da82a9ba2 100755 --- a/flow-over-heated-plate-nearest-projection/solid-openfoam/run.sh +++ b/flow-over-heated-plate-nearest-projection/solid-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch solid-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/flow-over-heated-plate-partitioned-flow/fluid1-openfoam/run.sh b/flow-over-heated-plate-partitioned-flow/fluid1-openfoam/run.sh index 8c4083b4a..da82a9ba2 100755 --- a/flow-over-heated-plate-partitioned-flow/fluid1-openfoam/run.sh +++ b/flow-over-heated-plate-partitioned-flow/fluid1-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid1-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/flow-over-heated-plate-partitioned-flow/fluid2-openfoam/run.sh b/flow-over-heated-plate-partitioned-flow/fluid2-openfoam/run.sh index 59f7967e7..da82a9ba2 100755 --- a/flow-over-heated-plate-partitioned-flow/fluid2-openfoam/run.sh +++ b/flow-over-heated-plate-partitioned-flow/fluid2-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid2-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/flow-over-heated-plate-partitioned-flow/solid-openfoam/run.sh b/flow-over-heated-plate-partitioned-flow/solid-openfoam/run.sh index 57e9395ee..da82a9ba2 100755 --- a/flow-over-heated-plate-partitioned-flow/solid-openfoam/run.sh +++ b/flow-over-heated-plate-partitioned-flow/solid-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch solid-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/flow-over-heated-plate-steady-state/fluid-openfoam/run.sh b/flow-over-heated-plate-steady-state/fluid-openfoam/run.sh index c191b9e48..da82a9ba2 100755 --- a/flow-over-heated-plate-steady-state/fluid-openfoam/run.sh +++ b/flow-over-heated-plate-steady-state/fluid-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/flow-over-heated-plate-steady-state/solid-codeaster/run.sh b/flow-over-heated-plate-steady-state/solid-codeaster/run.sh index 0af4b021f..e3075712b 100755 --- a/flow-over-heated-plate-steady-state/solid-codeaster/run.sh +++ b/flow-over-heated-plate-steady-state/solid-codeaster/run.sh @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + echo "Warning: this case requires a manual preparation step for code_aster." echo "You also need to set an absolute path as exchange-directory in precice-config.xml." echo "See the tutorial and code_aster adapter documentation pages for more:" @@ -10,3 +13,5 @@ echo "" export TUTORIAL_ROOT="${PWD}" export PRECICE_PARTICIPANT=Solid as_run --run solid.export + +close_log diff --git a/flow-over-heated-plate-two-meshes/fluid-openfoam/run.sh b/flow-over-heated-plate-two-meshes/fluid-openfoam/run.sh index c191b9e48..da82a9ba2 100755 --- a/flow-over-heated-plate-two-meshes/fluid-openfoam/run.sh +++ b/flow-over-heated-plate-two-meshes/fluid-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/flow-over-heated-plate-two-meshes/solid-calculix/run.sh b/flow-over-heated-plate-two-meshes/solid-calculix/run.sh index 8935f96af..460b914bd 100755 --- a/flow-over-heated-plate-two-meshes/solid-calculix/run.sh +++ b/flow-over-heated-plate-two-meshes/solid-calculix/run.sh @@ -1,5 +1,10 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + python3 ./generate_mesh.py > all.msh ccx_preCICE -i solid -precice-participant Solid + +close_log diff --git a/flow-over-heated-plate/fluid-openfoam/run.sh b/flow-over-heated-plate/fluid-openfoam/run.sh index c191b9e48..da82a9ba2 100755 --- a/flow-over-heated-plate/fluid-openfoam/run.sh +++ b/flow-over-heated-plate/fluid-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/flow-over-heated-plate/solid-dunefem/run.sh b/flow-over-heated-plate/solid-dunefem/run.sh index 8678a56d1..125686c9e 100755 --- a/flow-over-heated-plate/solid-dunefem/run.sh +++ b/flow-over-heated-plate/solid-dunefem/run.sh @@ -1,7 +1,12 @@ #!/bin/bash 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 + +close_log diff --git a/flow-over-heated-plate/solid-fenics/run.sh b/flow-over-heated-plate/solid-fenics/run.sh index 15315c67d..6d5da4496 100755 --- a/flow-over-heated-plate/solid-fenics/run.sh +++ b/flow-over-heated-plate/solid-fenics/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + python3 solid.py + +close_log diff --git a/flow-over-heated-plate/solid-nutils/run.sh b/flow-over-heated-plate/solid-nutils/run.sh index 8678a56d1..125686c9e 100755 --- a/flow-over-heated-plate/solid-nutils/run.sh +++ b/flow-over-heated-plate/solid-nutils/run.sh @@ -1,7 +1,12 @@ #!/bin/bash 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 + +close_log diff --git a/flow-over-heated-plate/solid-openfoam/run.sh b/flow-over-heated-plate/solid-openfoam/run.sh index 57e9395ee..da82a9ba2 100755 --- a/flow-over-heated-plate/solid-openfoam/run.sh +++ b/flow-over-heated-plate/solid-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch solid-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/heat-exchanger-simplified/fluid-bottom-openfoam/run.sh b/heat-exchanger-simplified/fluid-bottom-openfoam/run.sh index 5ecab7517..da82a9ba2 100755 --- a/heat-exchanger-simplified/fluid-bottom-openfoam/run.sh +++ b/heat-exchanger-simplified/fluid-bottom-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid-bottom-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/heat-exchanger-simplified/fluid-top-openfoam/run.sh b/heat-exchanger-simplified/fluid-top-openfoam/run.sh index 005bf5371..da82a9ba2 100755 --- a/heat-exchanger-simplified/fluid-top-openfoam/run.sh +++ b/heat-exchanger-simplified/fluid-top-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid-top-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/heat-exchanger-simplified/solid-calculix/run.sh b/heat-exchanger-simplified/solid-calculix/run.sh index 8935f96af..460b914bd 100755 --- a/heat-exchanger-simplified/solid-calculix/run.sh +++ b/heat-exchanger-simplified/solid-calculix/run.sh @@ -1,5 +1,10 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + python3 ./generate_mesh.py > all.msh ccx_preCICE -i solid -precice-participant Solid + +close_log diff --git a/heat-exchanger/fluid-inner-openfoam/run.sh b/heat-exchanger/fluid-inner-openfoam/run.sh index 6f176ba93..71a1313ae 100755 --- a/heat-exchanger/fluid-inner-openfoam/run.sh +++ b/heat-exchanger/fluid-inner-openfoam/run.sh @@ -1,7 +1,10 @@ -#!/bin/sh +#!/bin/bash set -e -u -touch fluid-inner-openfoam.foam +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/heat-exchanger/fluid-outer-openfoam/run.sh b/heat-exchanger/fluid-outer-openfoam/run.sh index 8816441f2..71a1313ae 100755 --- a/heat-exchanger/fluid-outer-openfoam/run.sh +++ b/heat-exchanger/fluid-outer-openfoam/run.sh @@ -1,7 +1,10 @@ -#!/bin/sh +#!/bin/bash set -e -u -touch fluid-outer-openfoam.foam +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/heat-exchanger/solid-calculix/run.sh b/heat-exchanger/solid-calculix/run.sh index 33d6d65c3..f1f5b3aef 100755 --- a/heat-exchanger/solid-calculix/run.sh +++ b/heat-exchanger/solid-calculix/run.sh @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + if [ ! -f all.msh ]; then echo "Mesh files not found. Use the Download_meshes script to download them." exit @@ -9,3 +12,5 @@ fi export OMP_NUM_THREADS=1 export CCX_NPROC_EQUATION_SOLVER=1 ccx_preCICE -i solid -precice-participant Solid + +close_log diff --git a/multiple-perpendicular-flaps/fluid-openfoam/run.sh b/multiple-perpendicular-flaps/fluid-openfoam/run.sh index c191b9e48..da82a9ba2 100755 --- a/multiple-perpendicular-flaps/fluid-openfoam/run.sh +++ b/multiple-perpendicular-flaps/fluid-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/oscillator-overlap/mass-left-python/clean.sh b/oscillator-overlap/mass-left-python/clean.sh index c7e3552ac..91d01fde7 100755 --- a/oscillator-overlap/mass-left-python/clean.sh +++ b/oscillator-overlap/mass-left-python/clean.sh @@ -6,3 +6,4 @@ set -e -u rm -rfv ./output/ clean_precice_logs . +clean_case_logs . diff --git a/oscillator-overlap/mass-left-python/run.sh b/oscillator-overlap/mass-left-python/run.sh index 2784cfeba..d2e5f9515 100755 --- a/oscillator-overlap/mass-left-python/run.sh +++ b/oscillator-overlap/mass-left-python/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u -python3 ../solver-python/oscillator.py Mass-Left \ No newline at end of file +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + +python3 ../solver-python/oscillator.py Mass-Left + +close_log diff --git a/oscillator-overlap/mass-right-python/clean.sh b/oscillator-overlap/mass-right-python/clean.sh index c7e3552ac..91d01fde7 100755 --- a/oscillator-overlap/mass-right-python/clean.sh +++ b/oscillator-overlap/mass-right-python/clean.sh @@ -6,3 +6,4 @@ set -e -u rm -rfv ./output/ clean_precice_logs . +clean_case_logs . diff --git a/oscillator-overlap/mass-right-python/run.sh b/oscillator-overlap/mass-right-python/run.sh index 775d6a83e..4bd290c63 100755 --- a/oscillator-overlap/mass-right-python/run.sh +++ b/oscillator-overlap/mass-right-python/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u -python3 ../solver-python/oscillator.py Mass-Right \ No newline at end of file +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + +python3 ../solver-python/oscillator.py Mass-Right + +close_log diff --git a/oscillator/fmi/clean.sh b/oscillator/fmi/clean.sh index c7e3552ac..d4e26a453 100755 --- a/oscillator/fmi/clean.sh +++ b/oscillator/fmi/clean.sh @@ -3,6 +3,4 @@ set -e -u . ../../tools/cleaning-tools.sh -rm -rfv ./output/ - -clean_precice_logs . +clean_fmi . diff --git a/oscillator/fmi/run.sh b/oscillator/fmi/run.sh index 3cc384bb9..7928ee03f 100755 --- a/oscillator/fmi/run.sh +++ b/oscillator/fmi/run.sh @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + usage() { echo "Usage: cmd [-l] [-r]" 1>&2; exit 1; } # Check if no input argument was provided @@ -38,3 +41,5 @@ while getopts ":lr" opt; do ;; esac done + +close_log diff --git a/oscillator/python/clean.sh b/oscillator/python/clean.sh index c7e3552ac..91d01fde7 100755 --- a/oscillator/python/clean.sh +++ b/oscillator/python/clean.sh @@ -6,3 +6,4 @@ set -e -u rm -rfv ./output/ clean_precice_logs . +clean_case_logs . diff --git a/oscillator/python/run.sh b/oscillator/python/run.sh index f20c841ec..fdc19ba4b 100755 --- a/oscillator/python/run.sh +++ b/oscillator/python/run.sh @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + usage() { echo "Usage: cmd [-l] [-r]" 1>&2; exit 1; } # Check if no input argument was provided @@ -21,4 +24,6 @@ while getopts ":lr" opt; do usage ;; esac -done \ No newline at end of file +done + +close_log diff --git a/partitioned-backwards-facing-step/fluid1-openfoam/run.sh b/partitioned-backwards-facing-step/fluid1-openfoam/run.sh index 8c4083b4a..da82a9ba2 100755 --- a/partitioned-backwards-facing-step/fluid1-openfoam/run.sh +++ b/partitioned-backwards-facing-step/fluid1-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid1-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/partitioned-backwards-facing-step/fluid2-openfoam/run.sh b/partitioned-backwards-facing-step/fluid2-openfoam/run.sh index 59f7967e7..da82a9ba2 100755 --- a/partitioned-backwards-facing-step/fluid2-openfoam/run.sh +++ b/partitioned-backwards-facing-step/fluid2-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid2-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/partitioned-elastic-beam/dirichlet-calculix/run.sh b/partitioned-elastic-beam/dirichlet-calculix/run.sh index 4e020fcd1..a7266841a 100755 --- a/partitioned-elastic-beam/dirichlet-calculix/run.sh +++ b/partitioned-elastic-beam/dirichlet-calculix/run.sh @@ -1,6 +1,11 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + export OMP_NUM_THREADS=1 export CCX_NPROC_EQUATION_SOLVER=1 ccx_preCICE -i beam1 -precice-participant Calculix1 + +close_log diff --git a/partitioned-elastic-beam/neumann-calculix/run.sh b/partitioned-elastic-beam/neumann-calculix/run.sh index e1730a420..b8dfea3d6 100755 --- a/partitioned-elastic-beam/neumann-calculix/run.sh +++ b/partitioned-elastic-beam/neumann-calculix/run.sh @@ -1,6 +1,11 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + export OMP_NUM_THREADS=1 export CCX_NPROC_EQUATION_SOLVER=1 ccx_preCICE -i beam2 -precice-participant Calculix2 + +close_log diff --git a/partitioned-heat-conduction-complex/dirichlet-fenics/run.sh b/partitioned-heat-conduction-complex/dirichlet-fenics/run.sh index 24dba5e2b..e4c1a798c 100755 --- a/partitioned-heat-conduction-complex/dirichlet-fenics/run.sh +++ b/partitioned-heat-conduction-complex/dirichlet-fenics/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u -python3 ../solver-fenics/heat.py -d -i complex \ No newline at end of file +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + +python3 ../solver-fenics/heat.py -d -i complex + +close_log diff --git a/partitioned-heat-conduction-complex/neumann-fenics/run.sh b/partitioned-heat-conduction-complex/neumann-fenics/run.sh index bc4e1d14e..4f0ae3402 100755 --- a/partitioned-heat-conduction-complex/neumann-fenics/run.sh +++ b/partitioned-heat-conduction-complex/neumann-fenics/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u -python3 ../solver-fenics/heat.py -n -i complex \ No newline at end of file +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + +python3 ../solver-fenics/heat.py -n -i complex + +close_log diff --git a/partitioned-heat-conduction-direct/nutils/run.sh b/partitioned-heat-conduction-direct/nutils/run.sh index 9c146a51c..ae66a8256 100755 --- a/partitioned-heat-conduction-direct/nutils/run.sh +++ b/partitioned-heat-conduction-direct/nutils/run.sh @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + usage() { echo "Usage: cmd [-d] [-n]" 1>&2; exit 1; } # Check if no input argument was provided @@ -27,3 +30,5 @@ while getopts ":dn" opt; do ;; esac done + +close_log diff --git a/partitioned-heat-conduction-overlap/left-fenics/run.sh b/partitioned-heat-conduction-overlap/left-fenics/run.sh index 266300e4b..df525cc51 100755 --- a/partitioned-heat-conduction-overlap/left-fenics/run.sh +++ b/partitioned-heat-conduction-overlap/left-fenics/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u -python3 ../solver-fenics/heat.py Left \ No newline at end of file +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + +python3 ../solver-fenics/heat.py Left + +close_log diff --git a/partitioned-heat-conduction-overlap/right-fenics/run.sh b/partitioned-heat-conduction-overlap/right-fenics/run.sh index 0e46fb5df..ae72b4d1b 100755 --- a/partitioned-heat-conduction-overlap/right-fenics/run.sh +++ b/partitioned-heat-conduction-overlap/right-fenics/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u -python3 ../solver-fenics/heat.py Right \ No newline at end of file +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + +python3 ../solver-fenics/heat.py Right + +close_log diff --git a/partitioned-heat-conduction/dirichlet-fenics/run.sh b/partitioned-heat-conduction/dirichlet-fenics/run.sh index 3fd32e580..874a00a5a 100755 --- a/partitioned-heat-conduction/dirichlet-fenics/run.sh +++ b/partitioned-heat-conduction/dirichlet-fenics/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u -python3 ../solver-fenics/heat.py Dirichlet \ No newline at end of file +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + +python3 ../solver-fenics/heat.py Dirichlet + +close_log diff --git a/partitioned-heat-conduction/dirichlet-openfoam/run.sh b/partitioned-heat-conduction/dirichlet-openfoam/run.sh index d9334f454..e75dacd3d 100755 --- a/partitioned-heat-conduction/dirichlet-openfoam/run.sh +++ b/partitioned-heat-conduction/dirichlet-openfoam/run.sh @@ -1,9 +1,13 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch openfoam-dirichlet.foam ./setInitialField.sh ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/partitioned-heat-conduction/neumann-fenics/run.sh b/partitioned-heat-conduction/neumann-fenics/run.sh index 7c3fba9c1..8c02791c1 100755 --- a/partitioned-heat-conduction/neumann-fenics/run.sh +++ b/partitioned-heat-conduction/neumann-fenics/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u -python3 ../solver-fenics/heat.py Neumann \ No newline at end of file +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + +python3 ../solver-fenics/heat.py Neumann + +close_log diff --git a/partitioned-heat-conduction/neumann-openfoam/run.sh b/partitioned-heat-conduction/neumann-openfoam/run.sh index 78b68a942..e75dacd3d 100755 --- a/partitioned-heat-conduction/neumann-openfoam/run.sh +++ b/partitioned-heat-conduction/neumann-openfoam/run.sh @@ -1,9 +1,13 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch openfoam-neumann.foam ./setInitialField.sh ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/partitioned-heat-conduction/nutils/run.sh b/partitioned-heat-conduction/nutils/run.sh index 21341a572..11bcd5318 100755 --- a/partitioned-heat-conduction/nutils/run.sh +++ b/partitioned-heat-conduction/nutils/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e -u usage() { echo "Usage: cmd [-d] [-n]" 1>&2; exit 1; } diff --git a/partitioned-pipe-two-phase/fluid1-openfoam/run.sh b/partitioned-pipe-two-phase/fluid1-openfoam/run.sh index d8230a576..63adb50c4 100755 --- a/partitioned-pipe-two-phase/fluid1-openfoam/run.sh +++ b/partitioned-pipe-two-phase/fluid1-openfoam/run.sh @@ -1,10 +1,14 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh cp -r 0.orig 0 setFields -touch fluid1.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/partitioned-pipe-two-phase/fluid2-openfoam/run.sh b/partitioned-pipe-two-phase/fluid2-openfoam/run.sh index 3f32494e4..63adb50c4 100755 --- a/partitioned-pipe-two-phase/fluid2-openfoam/run.sh +++ b/partitioned-pipe-two-phase/fluid2-openfoam/run.sh @@ -1,10 +1,14 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh cp -r 0.orig 0 setFields -touch fluid2.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/partitioned-pipe-two-phase/monolithic/run.sh b/partitioned-pipe-two-phase/monolithic/run.sh index 979c9147c..63adb50c4 100755 --- a/partitioned-pipe-two-phase/monolithic/run.sh +++ b/partitioned-pipe-two-phase/monolithic/run.sh @@ -1,10 +1,14 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh cp -r 0.orig 0 setFields -touch monolithic.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/run.sh b/partitioned-pipe/fluid1-openfoam-pimplefoam/run.sh index 9d3846e5d..198f58108 100755 --- a/partitioned-pipe/fluid1-openfoam-pimplefoam/run.sh +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/run.sh @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + use_skewed=false for arg in "$@" @@ -16,9 +19,9 @@ else blockMesh fi -touch fluid1-openfoam-pimplefoam.foam - ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs -postProcess -func "flowRatePatch(name=inlet)" -latestTime -noZero \ No newline at end of file +postProcess -func "flowRatePatch(name=inlet)" -latestTime -noZero + +close_log diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/run.sh b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/run.sh index 76e94cbc8..da82a9ba2 100755 --- a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/run.sh +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid1-openfoam-sonicliquidfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/partitioned-pipe/fluid2-openfoam-pimplefoam/run.sh b/partitioned-pipe/fluid2-openfoam-pimplefoam/run.sh index 254c3f68c..198f58108 100755 --- a/partitioned-pipe/fluid2-openfoam-pimplefoam/run.sh +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/run.sh @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + use_skewed=false for arg in "$@" @@ -16,9 +19,9 @@ else blockMesh fi -touch fluid2-openfoam-pimplefoam.foam - ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs -postProcess -func "flowRatePatch(name=inlet)" -latestTime -noZero \ No newline at end of file +postProcess -func "flowRatePatch(name=inlet)" -latestTime -noZero + +close_log diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/run.sh b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/run.sh index 5a24175c5..da82a9ba2 100755 --- a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/run.sh +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid2-openfoam-sonicliquidfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/perpendicular-flap/fluid-nutils/run.sh b/perpendicular-flap/fluid-nutils/run.sh index 00b103a23..7094b61c8 100755 --- a/perpendicular-flap/fluid-nutils/run.sh +++ b/perpendicular-flap/fluid-nutils/run.sh @@ -1,7 +1,12 @@ -#!/bin/sh +#!/bin/bash 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 fluid.py + +close_log diff --git a/perpendicular-flap/fluid-openfoam/run.sh b/perpendicular-flap/fluid-openfoam/run.sh index c191b9e48..da82a9ba2 100755 --- a/perpendicular-flap/fluid-openfoam/run.sh +++ b/perpendicular-flap/fluid-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/perpendicular-flap/fluid-su2/run.sh b/perpendicular-flap/fluid-su2/run.sh index a827818b5..529a74f75 100755 --- a/perpendicular-flap/fluid-su2/run.sh +++ b/perpendicular-flap/fluid-su2/run.sh @@ -1,8 +1,13 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + if [ "${1:-}" = "-parallel" ]; then mpirun -n 2 SU2_CFD euler_config_coupled.cfg else SU2_CFD euler_config_coupled.cfg fi + +close_log diff --git a/perpendicular-flap/solid-calculix/run.sh b/perpendicular-flap/solid-calculix/run.sh index 8c5a876fa..1954b6584 100755 --- a/perpendicular-flap/solid-calculix/run.sh +++ b/perpendicular-flap/solid-calculix/run.sh @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + usage() { echo "Usage: run.sh [-modal]" 1>&2; exit 1; } # There must be either 0 arguments or 1, which is modal. @@ -16,4 +19,6 @@ else ccx_preCICE -i frequency mv frequency.eig flap_modal.eig ccx_preCICE -i flap_modal -precice-participant Solid -fi \ No newline at end of file +fi + +close_log diff --git a/perpendicular-flap/solid-dune/run.sh b/perpendicular-flap/solid-dune/run.sh index bbe2d648c..7cf8e187a 100755 --- a/perpendicular-flap/solid-dune/run.sh +++ b/perpendicular-flap/solid-dune/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + ./dune-perpendicular-flap + +close_log diff --git a/perpendicular-flap/solid-fenics/run.sh b/perpendicular-flap/solid-fenics/run.sh index 15315c67d..6d5da4496 100755 --- a/perpendicular-flap/solid-fenics/run.sh +++ b/perpendicular-flap/solid-fenics/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + python3 solid.py + +close_log diff --git a/perpendicular-flap/solid-nutils/run.sh b/perpendicular-flap/solid-nutils/run.sh index b57faa9f2..43cc739cd 100755 --- a/perpendicular-flap/solid-nutils/run.sh +++ b/perpendicular-flap/solid-nutils/run.sh @@ -1,7 +1,12 @@ -#!/bin/sh +#!/bin/bash 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 richoutput=no + +close_log diff --git a/perpendicular-flap/solid-openfoam/run.sh b/perpendicular-flap/solid-openfoam/run.sh index d56f9c8d6..7996753e3 100755 --- a/perpendicular-flap/solid-openfoam/run.sh +++ b/perpendicular-flap/solid-openfoam/run.sh @@ -1,10 +1,14 @@ #!/bin/bash +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch solid-openfoam.foam # Compile boundary condition (cd solidDisplacementFoamForce && wmake libso) ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/perpendicular-flap/solid-solids4foam/run.sh b/perpendicular-flap/solid-solids4foam/run.sh index 90f973a25..4f2b797ab 100755 --- a/perpendicular-flap/solid-solids4foam/run.sh +++ b/perpendicular-flap/solid-solids4foam/run.sh @@ -1,7 +1,11 @@ #!/bin/bash +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch solid-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/quickstart/fluid-openfoam/run.sh b/quickstart/fluid-openfoam/run.sh index c191b9e48..40cd648cf 100755 --- a/quickstart/fluid-openfoam/run.sh +++ b/quickstart/fluid-openfoam/run.sh @@ -1,8 +1,13 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid-openfoam.foam ../../tools/run-openfoam.sh "$@" + . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/quickstart/solid-cpp/clean.sh b/quickstart/solid-cpp/clean.sh index a0ed77ed3..c05807870 100755 --- a/quickstart/solid-cpp/clean.sh +++ b/quickstart/solid-cpp/clean.sh @@ -5,3 +5,4 @@ set -e -u rm -rfv coupling-meshes clean_precice_logs . +clean_case_logs . diff --git a/quickstart/solid-cpp/run.sh b/quickstart/solid-cpp/run.sh index 60b4fd3eb..c764a8f73 100755 --- a/quickstart/solid-cpp/run.sh +++ b/quickstart/solid-cpp/run.sh @@ -1,9 +1,14 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + solver=./rigid_body_solver if [ -f "${solver}" ]; then ${solver} else echo "Unable to locate the executable ${solver}. Have a look at the README for building instructions." fi + +close_log diff --git a/tools/cleaning-tools.sh b/tools/cleaning-tools.sh index 7038b2219..3cea7742b 100755 --- a/tools/cleaning-tools.sh +++ b/tools/cleaning-tools.sh @@ -44,6 +44,16 @@ clean_precice_logs() { ) } +clean_case_logs() { + ( + set -e -u + cd "$1" + echo "- Cleaning up general case logs in $(pwd)" + CASENAME="$(readlink -f "$0" | xargs dirname | xargs basename)" + rm -fv "./$CASENAME.log" + ) +} + clean_calculix() { ( set -e -u @@ -54,6 +64,7 @@ clean_calculix() { rm -fv ./*.eig rm -fv ./*.vtk clean_precice_logs . + clean_case_logs . ) } @@ -65,6 +76,7 @@ clean_codeaster() { rm -fv ./*.mess ./*.resu ./*.rmed rm -rfv ./REPE_OUT/* clean_precice_logs . + clean_case_logs . ) } @@ -75,6 +87,7 @@ clean_dealii() { echo "- Cleaning up deal.II case in $(pwd)" rm -rfv ./dealii-output/ clean_precice_logs . + clean_case_logs . ) } @@ -85,6 +98,7 @@ clean_fenics() { echo "- Cleaning up FEniCS case in $(pwd)" rm -rfv ./output/ clean_precice_logs . + clean_case_logs . ) } @@ -95,6 +109,7 @@ clean_nutils() { echo "- Cleaning up Nutils case in $(pwd)" rm -fv ./*.vtk clean_precice_logs . + clean_case_logs . ) } @@ -110,6 +125,7 @@ clean_openfoam() { rm -rfv 0/uniform/functionObjects/functionObjectProperties history fi clean_precice_logs . + clean_case_logs . ) } @@ -120,6 +136,7 @@ clean_su2() { echo "- Cleaning up SU2 case in $(pwd)" rm -fv ./restart_flow_*.dat forces_breakdown.dat ./surface_flow_*.csv ./flow_*.vtk ./history_*.vtk clean_precice_logs . + clean_case_logs . ) } @@ -143,17 +160,29 @@ clean_dune() { rm -fv ./*.vtu rm -rfv ./output/ clean_precice_logs . + clean_case_logs . ) } clean_dumux() { ( set -e -u - cd "$1" - echo "- Cleaning up DuMuX case in $(pwd)" - rm -fv ./*.vtu - rm -fv ./*.pvd - clean_precice_logs . + cd "$1" + echo "- Cleaning up DuMuX case in $(pwd)" + rm -fv ./*.vtu + rm -fv ./*.pvd + clean_precice_logs . + clean_case_logs . ) +} +clean_fmi() { + ( + set -e -u + cd "$1" + echo "- Cleaning up FMI case in $(pwd)" + rm -rfv ./output/ + clean_precice_logs . + clean_case_logs . + ) } diff --git a/tools/log.sh b/tools/log.sh new file mode 100644 index 000000000..76cd533d1 --- /dev/null +++ b/tools/log.sh @@ -0,0 +1,18 @@ +#!/bin/bash +set -e -u + +CASENAME="$(pwd | xargs basename)" +LOGFILE="$CASENAME.log" +export LOGFILE + +STARTDATE="$(date --rfc-email)" +STARTTIME="$(date +%s)" +echo "Started on: $STARTDATE" | tee "$CASENAME.log" 2>&1 + +close_log() { + echo "Started on: $STARTDATE" | tee --append "$LOGFILE" 2>&1 + ENDDATE="$(date --rfc-email)" + ENDTIME="$(date +%s)" + echo "Finished on: $ENDDATE" | tee --append "$LOGFILE" 2>&1 + echo "Duration: $((ENDTIME-STARTTIME)) seconds (wall-clock time, including time waiting for participants)" | tee --append "$LOGFILE" 2>&1 +} diff --git a/tools/run-dealii.sh b/tools/run-dealii.sh index 318bb5143..64148aa6f 100755 --- a/tools/run-dealii.sh +++ b/tools/run-dealii.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e -u EXE="" diff --git a/tools/run-openfoam.sh b/tools/run-openfoam.sh index e0667aa16..e3bf2c920 100755 --- a/tools/run-openfoam.sh +++ b/tools/run-openfoam.sh @@ -1,6 +1,10 @@ #!/bin/sh set -e # Not setting -u as it gets triggered by the OpenFOAM RunFunctions +# Prepare an (intentionally empty) .foam file for the ParaView OpenFOAM reader +CASENAME="$(pwd | xargs basename)" +touch "$CASENAME.foam" + # OpenFOAM run functions: getApplication, getNumberOfProcessors # shellcheck disable=SC1090 # This is an OpenFOAM file which we don't need to check . "${WM_PROJECT_DIR}/bin/tools/RunFunctions" diff --git a/turek-hron-fsi3/fluid-openfoam/run.sh b/turek-hron-fsi3/fluid-openfoam/run.sh index c191b9e48..da82a9ba2 100755 --- a/turek-hron-fsi3/fluid-openfoam/run.sh +++ b/turek-hron-fsi3/fluid-openfoam/run.sh @@ -1,8 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh -touch fluid-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/two-scale-heat-conduction/macro-dumux/run.sh b/two-scale-heat-conduction/macro-dumux/run.sh index 7b3d98112..920352b8d 100755 --- a/two-scale-heat-conduction/macro-dumux/run.sh +++ b/two-scale-heat-conduction/macro-dumux/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + ./macro_dumux params.input + +close_log diff --git a/two-scale-heat-conduction/macro-nutils/run.sh b/two-scale-heat-conduction/macro-nutils/run.sh index fa2bfba16..5ae6ac050 100755 --- a/two-scale-heat-conduction/macro-nutils/run.sh +++ b/two-scale-heat-conduction/macro-nutils/run.sh @@ -1,7 +1,12 @@ -#!/bin/sh +#!/bin/bash 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 macro.py richoutput=no + +close_log diff --git a/two-scale-heat-conduction/micro-dumux/run.sh b/two-scale-heat-conduction/micro-dumux/run.sh index f07dce500..7ce4c9a0b 100755 --- a/two-scale-heat-conduction/micro-dumux/run.sh +++ b/two-scale-heat-conduction/micro-dumux/run.sh @@ -1,12 +1,15 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + usage() { echo "Usage: cmd [-s] [-p n]" 1>&2; exit 1; } # Check if no input argument was provided if [ -z "$*" ] ; then - echo "No input argument provided. Micro Manager is launched in serial" - python3 run_micro_manager.py params.input + echo "No input argument provided. Micro Manager is launched in serial" + python3 run_micro_manager.py params.input fi while getopts ":sp" opt; do @@ -22,3 +25,5 @@ while getopts ":sp" opt; do ;; esac done + +close_log diff --git a/two-scale-heat-conduction/micro-nutils/run.sh b/two-scale-heat-conduction/micro-nutils/run.sh index 317881929..f4b16f398 100755 --- a/two-scale-heat-conduction/micro-nutils/run.sh +++ b/two-scale-heat-conduction/micro-nutils/run.sh @@ -1,6 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + usage() { echo "Usage: cmd [-s] [-p n]" 1>&2; exit 1; } python3 -m venv .venv @@ -9,8 +12,8 @@ pip install -r requirements.txt # Check if no input argument was provided if [ -z "$*" ] ; then - echo "No input argument provided. Micro Manager is launched in serial" - python3 run_micro_manager.py + echo "No input argument provided. Micro Manager is launched in serial" + python3 run-micro-problems.py fi while getopts ":sp" opt; do @@ -26,3 +29,5 @@ while getopts ":sp" opt; do ;; esac done + +close_log diff --git a/volume-coupled-diffusion/drain-fenics/run.sh b/volume-coupled-diffusion/drain-fenics/run.sh index 3ae91af6b..48f2832ad 100755 --- a/volume-coupled-diffusion/drain-fenics/run.sh +++ b/volume-coupled-diffusion/drain-fenics/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u -python3 ../solver-fenics/volume-coupled-diffusion.py --drain \ No newline at end of file +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + +python3 ../solver-fenics/volume-coupled-diffusion.py --drain + +close_log diff --git a/volume-coupled-diffusion/source-fenics/run.sh b/volume-coupled-diffusion/source-fenics/run.sh index 1bdbe5662..4dbf42539 100755 --- a/volume-coupled-diffusion/source-fenics/run.sh +++ b/volume-coupled-diffusion/source-fenics/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u -python3 ../solver-fenics/volume-coupled-diffusion.py --source \ No newline at end of file +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + +python3 ../solver-fenics/volume-coupled-diffusion.py --source + +close_log diff --git a/volume-coupled-flow/fluid-openfoam/run.sh b/volume-coupled-flow/fluid-openfoam/run.sh index 3418d12d1..75b56f415 100755 --- a/volume-coupled-flow/fluid-openfoam/run.sh +++ b/volume-coupled-flow/fluid-openfoam/run.sh @@ -1,9 +1,13 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + blockMesh topoSet -touch fluid-openfoam.foam ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +close_log diff --git a/volume-coupled-flow/source-nutils/run.sh b/volume-coupled-flow/source-nutils/run.sh index 3ef84763d..716fe373b 100755 --- a/volume-coupled-flow/source-nutils/run.sh +++ b/volume-coupled-flow/source-nutils/run.sh @@ -1,4 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u +. ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 + python3 source.py + +close_log