From 200a2c81e9383c76b9188566576bece64f04e3ab Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 12 Mar 2024 09:09:40 +0100 Subject: [PATCH 01/17] Add automatic logging in Quickstart --- quickstart/fluid-openfoam/clean.sh | 1 + quickstart/fluid-openfoam/run.sh | 10 ++++++---- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/quickstart/fluid-openfoam/clean.sh b/quickstart/fluid-openfoam/clean.sh index c31d9fc76..fd7d42349 100755 --- a/quickstart/fluid-openfoam/clean.sh +++ b/quickstart/fluid-openfoam/clean.sh @@ -4,3 +4,4 @@ set -e -u . ../../tools/cleaning-tools.sh clean_openfoam . +rm -fv fluid-openfoam.log diff --git a/quickstart/fluid-openfoam/run.sh b/quickstart/fluid-openfoam/run.sh index c191b9e48..1f49b73ed 100755 --- a/quickstart/fluid-openfoam/run.sh +++ b/quickstart/fluid-openfoam/run.sh @@ -1,8 +1,10 @@ #!/bin/sh set -e -u -blockMesh -touch fluid-openfoam.foam +CASENAME=fluid-openfoam -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +blockMesh | tee ${CASENAME}.log 2>&1 +touch ${CASENAME}.foam + +../../tools/run-openfoam.sh "$@" | tee --append ${CASENAME}.log 2>&1 +. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs | tee --append ${CASENAME}.log 2>&1 From 32f7fc3a747069d398d83e73de79e9234632f110 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 12 Mar 2024 18:40:52 +0100 Subject: [PATCH 02/17] Generalize cleaning --- quickstart/fluid-openfoam/clean.sh | 1 - tools/cleaning-tools.sh | 18 ++++++++++++++++++ 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/quickstart/fluid-openfoam/clean.sh b/quickstart/fluid-openfoam/clean.sh index fd7d42349..c31d9fc76 100755 --- a/quickstart/fluid-openfoam/clean.sh +++ b/quickstart/fluid-openfoam/clean.sh @@ -4,4 +4,3 @@ set -e -u . ../../tools/cleaning-tools.sh clean_openfoam . -rm -fv fluid-openfoam.log diff --git a/tools/cleaning-tools.sh b/tools/cleaning-tools.sh index 7038b2219..c215ac488 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,6 +160,7 @@ clean_dune() { rm -fv ./*.vtu rm -rfv ./output/ clean_precice_logs . + clean_case_logs . ) } From 7d86a029a6d576c489ce9c10e8be6244cc45a156 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 12 Mar 2024 18:41:39 +0100 Subject: [PATCH 03/17] Automatically deduce CASENAME --- quickstart/fluid-openfoam/run.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/quickstart/fluid-openfoam/run.sh b/quickstart/fluid-openfoam/run.sh index 1f49b73ed..936a2b528 100755 --- a/quickstart/fluid-openfoam/run.sh +++ b/quickstart/fluid-openfoam/run.sh @@ -1,10 +1,10 @@ #!/bin/sh set -e -u -CASENAME=fluid-openfoam +CASENAME="$(readlink -f "$0" | xargs dirname | xargs basename)" -blockMesh | tee ${CASENAME}.log 2>&1 -touch ${CASENAME}.foam +blockMesh | tee "$CASENAME.log" 2>&1 +touch "$CASENAME.foam" -../../tools/run-openfoam.sh "$@" | tee --append ${CASENAME}.log 2>&1 -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs | tee --append ${CASENAME}.log 2>&1 +../../tools/run-openfoam.sh "$@" | tee --append "$CASENAME.log" 2>&1 +. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs | tee --append "$CASENAME.log" 2>&1 From 52cfd4756fe4c8095d0306b76314d1171df90259 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 12 Mar 2024 18:47:35 +0100 Subject: [PATCH 04/17] Move CASENAME deduction to tools/get-case-name.sh --- quickstart/fluid-openfoam/run.sh | 2 +- tools/get-case-name.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 tools/get-case-name.sh diff --git a/quickstart/fluid-openfoam/run.sh b/quickstart/fluid-openfoam/run.sh index 936a2b528..d84db9b76 100755 --- a/quickstart/fluid-openfoam/run.sh +++ b/quickstart/fluid-openfoam/run.sh @@ -1,7 +1,7 @@ #!/bin/sh set -e -u -CASENAME="$(readlink -f "$0" | xargs dirname | xargs basename)" +. ../../tools/get-case-name.sh blockMesh | tee "$CASENAME.log" 2>&1 touch "$CASENAME.foam" diff --git a/tools/get-case-name.sh b/tools/get-case-name.sh new file mode 100644 index 000000000..4b079cca9 --- /dev/null +++ b/tools/get-case-name.sh @@ -0,0 +1,5 @@ +#!/bin/sh +set -e -u + +CASENAME="$(readlink -f "$0" | xargs dirname | xargs basename)" +export CASENAME From d7312de5090ee5ef3bd117a7b3588f67764912ba Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Tue, 12 Mar 2024 19:09:16 +0100 Subject: [PATCH 05/17] Simplify logging, add date at the begin/end --- quickstart/fluid-openfoam/run.sh | 10 ++++++---- tools/{get-case-name.sh => log.sh} | 6 ++++++ 2 files changed, 12 insertions(+), 4 deletions(-) rename tools/{get-case-name.sh => log.sh} (55%) diff --git a/quickstart/fluid-openfoam/run.sh b/quickstart/fluid-openfoam/run.sh index d84db9b76..be075dfd2 100755 --- a/quickstart/fluid-openfoam/run.sh +++ b/quickstart/fluid-openfoam/run.sh @@ -1,10 +1,12 @@ #!/bin/sh set -e -u -. ../../tools/get-case-name.sh +. ../../tools/log.sh -blockMesh | tee "$CASENAME.log" 2>&1 +log blockMesh touch "$CASENAME.foam" -../../tools/run-openfoam.sh "$@" | tee --append "$CASENAME.log" 2>&1 -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs | tee --append "$CASENAME.log" 2>&1 +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +log date diff --git a/tools/get-case-name.sh b/tools/log.sh similarity index 55% rename from tools/get-case-name.sh rename to tools/log.sh index 4b079cca9..c957f3a00 100644 --- a/tools/get-case-name.sh +++ b/tools/log.sh @@ -3,3 +3,9 @@ set -e -u CASENAME="$(readlink -f "$0" | xargs dirname | xargs basename)" export CASENAME + +date > "$CASENAME.log" + +log() { + "$@" | tee --append "$CASENAME.log" 2>&1 +} From 0c50f48e28539b3276e663bafe3e3a77390e99ca Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Fri, 15 Mar 2024 08:01:38 +0100 Subject: [PATCH 06/17] Add formatted start, end, duration --- quickstart/fluid-openfoam/run.sh | 2 +- tools/log.sh | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/quickstart/fluid-openfoam/run.sh b/quickstart/fluid-openfoam/run.sh index be075dfd2..8f4fb1c36 100755 --- a/quickstart/fluid-openfoam/run.sh +++ b/quickstart/fluid-openfoam/run.sh @@ -9,4 +9,4 @@ touch "$CASENAME.foam" log ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs -log date +close_log diff --git a/tools/log.sh b/tools/log.sh index c957f3a00..7dfb29497 100644 --- a/tools/log.sh +++ b/tools/log.sh @@ -4,8 +4,18 @@ set -e -u CASENAME="$(readlink -f "$0" | xargs dirname | xargs basename)" export CASENAME -date > "$CASENAME.log" +STARTDATE="$(date --rfc-email)" +STARTTIME="$(date +%s)" +echo "Started on: $STARTDATE" | tee "$CASENAME.log" 2>&1 log() { "$@" | tee --append "$CASENAME.log" 2>&1 } + +close_log() { + echo "Started on: $STARTDATE" | tee --append "$CASENAME.log" 2>&1 + ENDDATE="$(date --rfc-email)" + ENDTIME="$(date +%s)" + echo "Finished on: $ENDDATE" | tee --append "$CASENAME.log" 2>&1 + echo "Duration: $((ENDTIME-STARTTIME)) seconds" | tee --append "$CASENAME.log" 2>&1 +} From 7c9ca19e31f922d836e9b55720a28c032fdd0dad Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Sat, 16 Mar 2024 06:53:47 +0100 Subject: [PATCH 07/17] Switch from readlink to pwd, move .foam generation to run-openfoam.sh --- quickstart/fluid-openfoam/run.sh | 1 - tools/log.sh | 2 +- tools/run-openfoam.sh | 4 ++++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/quickstart/fluid-openfoam/run.sh b/quickstart/fluid-openfoam/run.sh index 8f4fb1c36..d0f8685db 100755 --- a/quickstart/fluid-openfoam/run.sh +++ b/quickstart/fluid-openfoam/run.sh @@ -4,7 +4,6 @@ set -e -u . ../../tools/log.sh log blockMesh -touch "$CASENAME.foam" log ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs diff --git a/tools/log.sh b/tools/log.sh index 7dfb29497..3a1c91dfe 100644 --- a/tools/log.sh +++ b/tools/log.sh @@ -1,7 +1,7 @@ #!/bin/sh set -e -u -CASENAME="$(readlink -f "$0" | xargs dirname | xargs basename)" +CASENAME="$(pwd | xargs basename)" export CASENAME STARTDATE="$(date --rfc-email)" 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" From 0cb426e3c9c481655cd5d3fd06d9d4485b3b54d3 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Sat, 16 Mar 2024 06:56:20 +0100 Subject: [PATCH 08/17] Log quickstart/solid-cpp --- quickstart/solid-cpp/run.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/quickstart/solid-cpp/run.sh b/quickstart/solid-cpp/run.sh index 60b4fd3eb..19895306a 100755 --- a/quickstart/solid-cpp/run.sh +++ b/quickstart/solid-cpp/run.sh @@ -1,9 +1,13 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + solver=./rigid_body_solver if [ -f "${solver}" ]; then - ${solver} + log ${solver} else - echo "Unable to locate the executable ${solver}. Have a look at the README for building instructions." + log echo "Unable to locate the executable ${solver}. Have a look at the README for building instructions." fi + +close_log From 99a2fb3985dc0d0c64d6b0786ecd8e3a038e56ca Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Sat, 16 Mar 2024 07:54:03 +0100 Subject: [PATCH 09/17] Add logging to more run scripts --- breaking-dam-2d/fluid-openfoam/run.sh | 15 +++++++++------ breaking-dam-2d/solid-calculix/run.sh | 6 +++++- channel-transport-reaction/chemical-fenics/run.sh | 6 +++++- channel-transport-reaction/clean-tutorial.sh | 11 +++++++++++ channel-transport-reaction/fluid-fenics/run.sh | 6 +++++- channel-transport/fluid-nutils/run.sh | 12 ++++++++---- channel-transport/fluid-openfoam/run.sh | 11 +++++++---- channel-transport/transport-nutils/run.sh | 12 ++++++++---- elastic-tube-1d/fluid-cpp/run.sh | 12 ++++++++---- elastic-tube-1d/fluid-python/run.sh | 6 +++++- elastic-tube-1d/fluid-rust/run.sh | 6 +++++- elastic-tube-1d/solid-cpp/run.sh | 12 ++++++++---- elastic-tube-1d/solid-python/run.sh | 6 +++++- elastic-tube-1d/solid-rust/run.sh | 6 +++++- elastic-tube-3d/fluid-openfoam/run.sh | 11 +++++++---- elastic-tube-3d/solid-calculix/run.sh | 6 +++++- quickstart/fluid-openfoam/run.sh | 3 ++- tools/log.sh | 2 +- 18 files changed, 109 insertions(+), 40 deletions(-) create mode 100755 channel-transport-reaction/clean-tutorial.sh diff --git a/breaking-dam-2d/fluid-openfoam/run.sh b/breaking-dam-2d/fluid-openfoam/run.sh index 33f5cdb23..bb9aebf15 100755 --- a/breaking-dam-2d/fluid-openfoam/run.sh +++ b/breaking-dam-2d/fluid-openfoam/run.sh @@ -1,10 +1,13 @@ #!/bin/sh set -e -u -cp 0/alpha.water_orig 0/alpha.water -blockMesh -setFields -touch fluid-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log cp 0/alpha.water_orig 0/alpha.water +log blockMesh +log setFields + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..a12ac5937 100755 --- a/breaking-dam-2d/solid-calculix/run.sh +++ b/breaking-dam-2d/solid-calculix/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -ccx_preCICE -i flap -precice-participant Solid +. ../../tools/log.sh + +log 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..ab6e02f37 100755 --- a/channel-transport-reaction/chemical-fenics/run.sh +++ b/channel-transport-reaction/chemical-fenics/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -python3 chemical-reaction-advection-diffusion.py +. ../../tools/log.sh + +log 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..b17cd285e 100755 --- a/channel-transport-reaction/fluid-fenics/run.sh +++ b/channel-transport-reaction/fluid-fenics/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -python3 fluid.py +. ../../tools/log.sh + +log python3 fluid.py + +close_log diff --git a/channel-transport/fluid-nutils/run.sh b/channel-transport/fluid-nutils/run.sh index 00b103a23..0e99d59f7 100755 --- a/channel-transport/fluid-nutils/run.sh +++ b/channel-transport/fluid-nutils/run.sh @@ -1,7 +1,11 @@ #!/bin/sh set -e -u -python3 -m venv .venv -. .venv/bin/activate -pip install -r requirements.txt -python3 fluid.py +. ../../tools/log.sh + +log python3 -m venv .venv +log . .venv/bin/activate +log pip install -r requirements.txt +log python3 fluid.py + +close_log diff --git a/channel-transport/fluid-openfoam/run.sh b/channel-transport/fluid-openfoam/run.sh index c191b9e48..864ca8c26 100755 --- a/channel-transport/fluid-openfoam/run.sh +++ b/channel-transport/fluid-openfoam/run.sh @@ -1,8 +1,11 @@ #!/bin/sh set -e -u -blockMesh -touch fluid-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs + +close_log diff --git a/channel-transport/transport-nutils/run.sh b/channel-transport/transport-nutils/run.sh index c3048dffd..26bc8f71f 100755 --- a/channel-transport/transport-nutils/run.sh +++ b/channel-transport/transport-nutils/run.sh @@ -1,7 +1,11 @@ #!/bin/sh set -e -u -python3 -m venv .venv -. .venv/bin/activate -pip install -r requirements.txt -python3 transport.py +. ../../tools/log.sh + +log python3 -m venv .venv +log . .venv/bin/activate +log pip install -r requirements.txt +log python3 transport.py + +close_log diff --git a/elastic-tube-1d/fluid-cpp/run.sh b/elastic-tube-1d/fluid-cpp/run.sh index c6be7a9bd..7906d3981 100755 --- a/elastic-tube-1d/fluid-cpp/run.sh +++ b/elastic-tube-1d/fluid-cpp/run.sh @@ -1,10 +1,14 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + if [ ! -d build ]; then - mkdir build - cmake -S . -B build - cmake --build build + log mkdir build + log cmake -S . -B build + log cmake --build build fi -./build/FluidSolver ../precice-config.xml +log ./build/FluidSolver ../precice-config.xml + +close_log diff --git a/elastic-tube-1d/fluid-python/run.sh b/elastic-tube-1d/fluid-python/run.sh index 4272d9b77..36a1ca22b 100755 --- a/elastic-tube-1d/fluid-python/run.sh +++ b/elastic-tube-1d/fluid-python/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -python3 ./FluidSolver.py ../precice-config.xml +. ../../tools/log.sh + +log python3 ./FluidSolver.py ../precice-config.xml + +close_log diff --git a/elastic-tube-1d/fluid-rust/run.sh b/elastic-tube-1d/fluid-rust/run.sh index 79a022fa3..987cf781c 100755 --- a/elastic-tube-1d/fluid-rust/run.sh +++ b/elastic-tube-1d/fluid-rust/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -cargo run --release ../precice-config.xml +. ../../tools/log.sh + +log cargo run --release ../precice-config.xml + +close_log diff --git a/elastic-tube-1d/solid-cpp/run.sh b/elastic-tube-1d/solid-cpp/run.sh index 3b85f004b..6708de8c8 100755 --- a/elastic-tube-1d/solid-cpp/run.sh +++ b/elastic-tube-1d/solid-cpp/run.sh @@ -1,10 +1,14 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + if [ ! -d build ]; then - mkdir build - cmake -S . -B build - cmake --build build + log mkdir build + log cmake -S . -B build + log cmake --build build fi -./build/SolidSolver ../precice-config.xml +log ./build/SolidSolver ../precice-config.xml + +close_log diff --git a/elastic-tube-1d/solid-python/run.sh b/elastic-tube-1d/solid-python/run.sh index ad00c6c38..0c4e5dd52 100755 --- a/elastic-tube-1d/solid-python/run.sh +++ b/elastic-tube-1d/solid-python/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -python3 ./SolidSolver.py ../precice-config.xml +. ../../tools/log.sh + +log python3 ./SolidSolver.py ../precice-config.xml + +close_log diff --git a/elastic-tube-1d/solid-rust/run.sh b/elastic-tube-1d/solid-rust/run.sh index d9103ab27..49305ddf7 100755 --- a/elastic-tube-1d/solid-rust/run.sh +++ b/elastic-tube-1d/solid-rust/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -cargo run --release ../precice-config.xml +. ../../tools/log.sh + +log 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..5a90867ba 100755 --- a/elastic-tube-3d/fluid-openfoam/run.sh +++ b/elastic-tube-3d/fluid-openfoam/run.sh @@ -1,8 +1,11 @@ #!/bin/sh set -e -u -cp -r constant/polyMesh.orig constant/polyMesh -touch fluid-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log cp -r constant/polyMesh.orig constant/polyMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..2676d0c2a 100755 --- a/elastic-tube-3d/solid-calculix/run.sh +++ b/elastic-tube-3d/solid-calculix/run.sh @@ -1,6 +1,10 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + export OMP_NUM_THREADS=1 export CCX_NPROC_EQUATION_SOLVER=1 -ccx_preCICE -i tube -precice-participant Solid +log ccx_preCICE -i tube -precice-participant Solid + +close_log diff --git a/quickstart/fluid-openfoam/run.sh b/quickstart/fluid-openfoam/run.sh index d0f8685db..e8baeb5e0 100755 --- a/quickstart/fluid-openfoam/run.sh +++ b/quickstart/fluid-openfoam/run.sh @@ -6,6 +6,7 @@ set -e -u log blockMesh log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs close_log diff --git a/tools/log.sh b/tools/log.sh index 3a1c91dfe..8925148d1 100644 --- a/tools/log.sh +++ b/tools/log.sh @@ -17,5 +17,5 @@ close_log() { ENDDATE="$(date --rfc-email)" ENDTIME="$(date +%s)" echo "Finished on: $ENDDATE" | tee --append "$CASENAME.log" 2>&1 - echo "Duration: $((ENDTIME-STARTTIME)) seconds" | tee --append "$CASENAME.log" 2>&1 + echo "Duration: $((ENDTIME-STARTTIME)) seconds (wall-clock time, including time waiting for participants)" | tee --append "$CASENAME.log" 2>&1 } From 22971b5df188358d2d804757016f2f18909890d6 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 08:59:50 +0100 Subject: [PATCH 10/17] Add logging to the rest of the cases --- .../controller-fmi/run.sh | 22 +++++++----- .../fluid-openfoam/run.sh | 18 +++++----- .../solid-python/run.sh | 4 ++- .../fluid-openfoam/run.sh | 11 +++--- .../solid-openfoam/run.sh | 11 +++--- .../fluid1-openfoam/run.sh | 11 +++--- .../fluid2-openfoam/run.sh | 11 +++--- .../solid-openfoam/run.sh | 11 +++--- .../fluid-openfoam/run.sh | 11 +++--- .../solid-codeaster/run.sh | 16 +++++---- .../fluid-openfoam/run.sh | 11 +++--- .../solid-calculix/run.sh | 8 +++-- flow-over-heated-plate/fluid-openfoam/run.sh | 11 +++--- flow-over-heated-plate/solid-dunefem/run.sh | 5 ++- flow-over-heated-plate/solid-fenics/run.sh | 6 +++- flow-over-heated-plate/solid-nutils/run.sh | 12 ++++--- flow-over-heated-plate/solid-openfoam/run.sh | 11 +++--- .../fluid-bottom-openfoam/run.sh | 11 +++--- .../fluid-top-openfoam/run.sh | 11 +++--- .../solid-calculix/run.sh | 8 +++-- heat-exchanger/fluid-inner-openfoam/run.sh | 8 +++-- heat-exchanger/fluid-outer-openfoam/run.sh | 8 +++-- heat-exchanger/solid-calculix/run.sh | 8 +++-- .../fluid-openfoam/run.sh | 11 +++--- oscillator-overlap/mass-left-python/run.sh | 6 +++- oscillator-overlap/mass-right-python/run.sh | 6 +++- oscillator/fmi/run.sh | 34 +++++++++++-------- oscillator/python/run.sh | 14 +++++--- .../fluid1-openfoam/run.sh | 11 +++--- .../fluid2-openfoam/run.sh | 11 +++--- .../dirichlet-calculix/run.sh | 6 +++- .../neumann-calculix/run.sh | 6 +++- .../dirichlet-fenics/run.sh | 6 +++- .../neumann-fenics/run.sh | 6 +++- .../nutils/run.sh | 22 +++++++----- .../left-fenics/run.sh | 6 +++- .../right-fenics/run.sh | 6 +++- .../dirichlet-fenics/run.sh | 6 +++- .../dirichlet-openfoam/run.sh | 14 +++++--- partitioned-heat-conduction/fenicsx/run.sh | 10 ++++-- .../neumann-fenics/run.sh | 6 +++- .../neumann-openfoam/run.sh | 13 ++++--- .../fluid1-openfoam/run.sh | 15 ++++---- .../fluid2-openfoam/run.sh | 15 ++++---- partitioned-pipe-two-phase/monolithic/run.sh | 15 ++++---- .../fluid1-openfoam-pimplefoam/run.sh | 14 ++++---- .../fluid1-openfoam-sonicliquidfoam/run.sh | 11 +++--- .../fluid2-openfoam-pimplefoam/run.sh | 14 ++++---- .../fluid2-openfoam-sonicliquidfoam/run.sh | 11 +++--- perpendicular-flap/fluid-nutils/run.sh | 12 ++++--- perpendicular-flap/fluid-openfoam/run.sh | 11 +++--- perpendicular-flap/fluid-su2/run.sh | 8 +++-- perpendicular-flap/solid-calculix/run.sh | 16 +++++---- perpendicular-flap/solid-dune/run.sh | 6 +++- perpendicular-flap/solid-fenics/run.sh | 6 +++- perpendicular-flap/solid-nutils/run.sh | 12 ++++--- perpendicular-flap/solid-openfoam/run.sh | 13 ++++--- perpendicular-flap/solid-solids4foam/run.sh | 11 +++--- turek-hron-fsi3/fluid-openfoam/run.sh | 11 +++--- two-scale-heat-conduction/macro-dumux/run.sh | 6 +++- two-scale-heat-conduction/macro-nutils/run.sh | 12 ++++--- two-scale-heat-conduction/micro-dumux/run.sh | 14 +++++--- two-scale-heat-conduction/micro-nutils/run.sh | 20 ++++++----- volume-coupled-diffusion/fenics/run.sh | 12 ++++--- volume-coupled-flow/fluid-openfoam/run.sh | 13 ++++--- volume-coupled-flow/source-nutils/run.sh | 6 +++- 66 files changed, 477 insertions(+), 251 deletions(-) diff --git a/flow-around-controlled-moving-cylinder/controller-fmi/run.sh b/flow-around-controlled-moving-cylinder/controller-fmi/run.sh index 0b55398ac..790f73384 100755 --- a/flow-around-controlled-moving-cylinder/controller-fmi/run.sh +++ b/flow-around-controlled-moving-cylinder/controller-fmi/run.sh @@ -1,15 +1,19 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + if [ ! -f PIDcontroller.fmu ]; then - cd fmu - rm -rf build - mkdir build - cd build - cmake -DFMI_TYPE=CS -DFMI_VERSION=3 .. - make - cp ./PIDcontroller.fmu ../.. - cd ../../ + log cd fmu + log rm -rf build + log mkdir build + log cd build + log cmake -DFMI_TYPE=CS -DFMI_VERSION=3 .. + log make + log cp ./PIDcontroller.fmu ../.. + log cd ../../ fi -fmiprecice ./fmi-settings.json ./precice-settings.json +log 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..19ade3233 100755 --- a/flow-around-controlled-moving-cylinder/fluid-openfoam/run.sh +++ b/flow-around-controlled-moving-cylinder/fluid-openfoam/run.sh @@ -1,14 +1,16 @@ #!/bin/sh set -e -u -blockMesh -transformPoints -scale '(0.0016 0.0016 1)' -transformPoints -translate '(0.0 0.0 -0.05)' +. ../../tools/log.sh -rm -rf 0 -cp -r 0.orig 0 +log blockMesh +log transformPoints -scale '(0.0016 0.0016 1)' +log transformPoints -translate '(0.0 0.0 -0.05)' -touch fluid-openfoam.foam +log rm -rf 0 +log cp -r 0.orig 0 -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs + +close_log diff --git a/flow-around-controlled-moving-cylinder/solid-python/run.sh b/flow-around-controlled-moving-cylinder/solid-python/run.sh index dbf7a6708..9494ca643 100755 --- a/flow-around-controlled-moving-cylinder/solid-python/run.sh +++ b/flow-around-controlled-moving-cylinder/solid-python/run.sh @@ -1,6 +1,8 @@ #!/bin/sh set -e -u +. ../../tools/log.sh -python3 solid.py ../precice-config.xml +log 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..864ca8c26 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,11 @@ #!/bin/sh set -e -u -blockMesh -touch fluid-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..864ca8c26 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,11 @@ #!/bin/sh set -e -u -blockMesh -touch solid-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..864ca8c26 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,11 @@ #!/bin/sh set -e -u -blockMesh -touch fluid1-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..864ca8c26 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,11 @@ #!/bin/sh set -e -u -blockMesh -touch fluid2-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..864ca8c26 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,11 @@ #!/bin/sh set -e -u -blockMesh -touch solid-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..864ca8c26 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,11 @@ #!/bin/sh set -e -u -blockMesh -touch fluid-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..c70dcdeef 100755 --- a/flow-over-heated-plate-steady-state/solid-codeaster/run.sh +++ b/flow-over-heated-plate-steady-state/solid-codeaster/run.sh @@ -1,12 +1,16 @@ #!/bin/sh set -e -u -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:" -echo "https://precice.org/adapter-code_aster.html" -echo "" +. ../../tools/log.sh + +log echo "Warning: this case requires a manual preparation step for code_aster." +log echo "You also need to set an absolute path as exchange-directory in precice-config.xml." +log echo "See the tutorial and code_aster adapter documentation pages for more:" +log echo "https://precice.org/adapter-code_aster.html" +log echo "" export TUTORIAL_ROOT="${PWD}" export PRECICE_PARTICIPANT=Solid -as_run --run solid.export +log 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..864ca8c26 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,11 @@ #!/bin/sh set -e -u -blockMesh -touch fluid-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..832e75b61 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,9 @@ #!/bin/sh set -e -u -python3 ./generate_mesh.py > all.msh -ccx_preCICE -i solid -precice-participant Solid +. ../../tools/log.sh + +log python3 ./generate_mesh.py > all.msh +log 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..864ca8c26 100755 --- a/flow-over-heated-plate/fluid-openfoam/run.sh +++ b/flow-over-heated-plate/fluid-openfoam/run.sh @@ -1,8 +1,11 @@ #!/bin/sh set -e -u -blockMesh -touch fluid-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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 21bd5c3b1..536d0dea4 100755 --- a/flow-over-heated-plate/solid-dunefem/run.sh +++ b/flow-over-heated-plate/solid-dunefem/run.sh @@ -1,5 +1,8 @@ #!/bin/bash set -e -u -python3 solid.py +. ../../tools/log.sh +log 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..ad66b6d1b 100755 --- a/flow-over-heated-plate/solid-fenics/run.sh +++ b/flow-over-heated-plate/solid-fenics/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -python3 solid.py +. ../../tools/log.sh + +log 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..f216f8055 100755 --- a/flow-over-heated-plate/solid-nutils/run.sh +++ b/flow-over-heated-plate/solid-nutils/run.sh @@ -1,7 +1,11 @@ #!/bin/bash set -e -u -python3 -m venv .venv -. .venv/bin/activate -pip install -r requirements.txt -python3 solid.py +. ../../tools/log.sh + +log python3 -m venv .venv +log . .venv/bin/activate +log pip install -r requirements.txt +log 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..864ca8c26 100755 --- a/flow-over-heated-plate/solid-openfoam/run.sh +++ b/flow-over-heated-plate/solid-openfoam/run.sh @@ -1,8 +1,11 @@ #!/bin/sh set -e -u -blockMesh -touch solid-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..864ca8c26 100755 --- a/heat-exchanger-simplified/fluid-bottom-openfoam/run.sh +++ b/heat-exchanger-simplified/fluid-bottom-openfoam/run.sh @@ -1,8 +1,11 @@ #!/bin/sh set -e -u -blockMesh -touch fluid-bottom-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..864ca8c26 100755 --- a/heat-exchanger-simplified/fluid-top-openfoam/run.sh +++ b/heat-exchanger-simplified/fluid-top-openfoam/run.sh @@ -1,8 +1,11 @@ #!/bin/sh set -e -u -blockMesh -touch fluid-top-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..832e75b61 100755 --- a/heat-exchanger-simplified/solid-calculix/run.sh +++ b/heat-exchanger-simplified/solid-calculix/run.sh @@ -1,5 +1,9 @@ #!/bin/sh set -e -u -python3 ./generate_mesh.py > all.msh -ccx_preCICE -i solid -precice-participant Solid +. ../../tools/log.sh + +log python3 ./generate_mesh.py > all.msh +log 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..c71009214 100755 --- a/heat-exchanger/fluid-inner-openfoam/run.sh +++ b/heat-exchanger/fluid-inner-openfoam/run.sh @@ -1,7 +1,9 @@ #!/bin/sh set -e -u -touch fluid-inner-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..c71009214 100755 --- a/heat-exchanger/fluid-outer-openfoam/run.sh +++ b/heat-exchanger/fluid-outer-openfoam/run.sh @@ -1,7 +1,9 @@ #!/bin/sh set -e -u -touch fluid-outer-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs + +close_log diff --git a/heat-exchanger/solid-calculix/run.sh b/heat-exchanger/solid-calculix/run.sh index 33d6d65c3..bf264eb69 100755 --- a/heat-exchanger/solid-calculix/run.sh +++ b/heat-exchanger/solid-calculix/run.sh @@ -1,11 +1,15 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + if [ ! -f all.msh ]; then - echo "Mesh files not found. Use the Download_meshes script to download them." + log echo "Mesh files not found. Use the Download_meshes script to download them." exit fi export OMP_NUM_THREADS=1 export CCX_NPROC_EQUATION_SOLVER=1 -ccx_preCICE -i solid -precice-participant Solid +log 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..864ca8c26 100755 --- a/multiple-perpendicular-flaps/fluid-openfoam/run.sh +++ b/multiple-perpendicular-flaps/fluid-openfoam/run.sh @@ -1,8 +1,11 @@ #!/bin/sh set -e -u -blockMesh -touch fluid-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs + +close_log diff --git a/oscillator-overlap/mass-left-python/run.sh b/oscillator-overlap/mass-left-python/run.sh index 2784cfeba..23c30d4e3 100755 --- a/oscillator-overlap/mass-left-python/run.sh +++ b/oscillator-overlap/mass-left-python/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -python3 ../solver-python/oscillator.py Mass-Left \ No newline at end of file +. ../../tools/log.sh + +log python3 ../solver-python/oscillator.py Mass-Left + +close_log diff --git a/oscillator-overlap/mass-right-python/run.sh b/oscillator-overlap/mass-right-python/run.sh index 775d6a83e..fb373fd33 100755 --- a/oscillator-overlap/mass-right-python/run.sh +++ b/oscillator-overlap/mass-right-python/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -python3 ../solver-python/oscillator.py Mass-Right \ No newline at end of file +. ../../tools/log.sh + +log python3 ../solver-python/oscillator.py Mass-Right + +close_log diff --git a/oscillator/fmi/run.sh b/oscillator/fmi/run.sh index 3cc384bb9..d2945f76f 100755 --- a/oscillator/fmi/run.sh +++ b/oscillator/fmi/run.sh @@ -1,40 +1,44 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + usage() { echo "Usage: cmd [-l] [-r]" 1>&2; exit 1; } # Check if no input argument was provided if [ -z "$*" ] ; then - usage + log usage fi if [ ! -f Oscillator.fmu ]; then - cd fmu - rm -rf build - mkdir build - cd build - # Both FMI_VERSION=3 and FMI_VERSION=2 are supported - cmake -DFMI_TYPE=CS -DFMI_VERSION=3 .. - make - cp ./Oscillator.fmu ../.. - cd ../../ + log cd fmu + log rm -rf build + log mkdir build + log cd build + log # Both FMI_VERSION=3 and FMI_VERSION=2 are supported + log cmake -DFMI_TYPE=CS -DFMI_VERSION=3 .. + log make + log cp ./Oscillator.fmu ../.. + log cd ../../ fi # Select appropriate case while getopts ":lr" opt; do case ${opt} in l) - fmiprecice ./MassLeft/fmi-settings.json MassLeft/precice-settings.json - python3 calculate-error.py MassLeft/fmi-settings.json MassLeft/precice-settings.json MassRight/fmi-settings.json MassRight/precice-settings.json Mass-Left + log fmiprecice ./MassLeft/fmi-settings.json MassLeft/precice-settings.json + log python3 calculate-error.py MassLeft/fmi-settings.json MassLeft/precice-settings.json MassRight/fmi-settings.json MassRight/precice-settings.json Mass-Left ;; r) - fmiprecice MassRight/fmi-settings.json MassRight/precice-settings.json - python3 calculate-error.py MassLeft/fmi-settings.json MassLeft/precice-settings.json MassRight/fmi-settings.json MassRight/precice-settings.json Mass-Right + log fmiprecice MassRight/fmi-settings.json MassRight/precice-settings.json + log python3 calculate-error.py MassLeft/fmi-settings.json MassLeft/precice-settings.json MassRight/fmi-settings.json MassRight/precice-settings.json Mass-Right ;; *) - usage + log usage ;; esac done + +close_log diff --git a/oscillator/python/run.sh b/oscillator/python/run.sh index f20c841ec..131c7e55e 100755 --- a/oscillator/python/run.sh +++ b/oscillator/python/run.sh @@ -1,24 +1,28 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + usage() { echo "Usage: cmd [-l] [-r]" 1>&2; exit 1; } # Check if no input argument was provided if [ -z "$*" ] ; then - usage + log usage fi # Select appropriate case while getopts ":lr" opt; do case ${opt} in l) - python3 oscillator.py Mass-Left + log python3 oscillator.py Mass-Left ;; r) - python3 oscillator.py Mass-Right + log python3 oscillator.py Mass-Right ;; *) - usage + log 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..864ca8c26 100755 --- a/partitioned-backwards-facing-step/fluid1-openfoam/run.sh +++ b/partitioned-backwards-facing-step/fluid1-openfoam/run.sh @@ -1,8 +1,11 @@ #!/bin/sh set -e -u -blockMesh -touch fluid1-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..864ca8c26 100755 --- a/partitioned-backwards-facing-step/fluid2-openfoam/run.sh +++ b/partitioned-backwards-facing-step/fluid2-openfoam/run.sh @@ -1,8 +1,11 @@ #!/bin/sh set -e -u -blockMesh -touch fluid2-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..c825396f1 100755 --- a/partitioned-elastic-beam/dirichlet-calculix/run.sh +++ b/partitioned-elastic-beam/dirichlet-calculix/run.sh @@ -1,6 +1,10 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + export OMP_NUM_THREADS=1 export CCX_NPROC_EQUATION_SOLVER=1 -ccx_preCICE -i beam1 -precice-participant Calculix1 +log 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..2c7a6b96c 100755 --- a/partitioned-elastic-beam/neumann-calculix/run.sh +++ b/partitioned-elastic-beam/neumann-calculix/run.sh @@ -1,6 +1,10 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + export OMP_NUM_THREADS=1 export CCX_NPROC_EQUATION_SOLVER=1 -ccx_preCICE -i beam2 -precice-participant Calculix2 +log 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..a9100a6db 100755 --- a/partitioned-heat-conduction-complex/dirichlet-fenics/run.sh +++ b/partitioned-heat-conduction-complex/dirichlet-fenics/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -python3 ../solver-fenics/heat.py -d -i complex \ No newline at end of file +. ../../tools/log.sh + +log 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..c8c7bb9a0 100755 --- a/partitioned-heat-conduction-complex/neumann-fenics/run.sh +++ b/partitioned-heat-conduction-complex/neumann-fenics/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -python3 ../solver-fenics/heat.py -n -i complex \ No newline at end of file +. ../../tools/log.sh + +log 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..f81ed0d1c 100755 --- a/partitioned-heat-conduction-direct/nutils/run.sh +++ b/partitioned-heat-conduction-direct/nutils/run.sh @@ -1,29 +1,33 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + usage() { echo "Usage: cmd [-d] [-n]" 1>&2; exit 1; } # Check if no input argument was provided if [ -z "$*" ] ; then - usage + log usage fi -python3 -m venv .venv -. .venv/bin/activate -pip install -r requirements.txt +log python3 -m venv .venv +log . .venv/bin/activate +log pip install -r requirements.txt while getopts ":dn" opt; do case ${opt} in d) - rm -rf Dirichlet-*.vtk - NUTILS_RICHOUTPUT=no python3 heat.py --side=Dirichlet + log rm -rf Dirichlet-*.vtk + log NUTILS_RICHOUTPUT=no python3 heat.py --side=Dirichlet ;; n) - rm -rf Neumann-*.vtk - NUTILS_RICHOUTPUT=no python3 heat.py --side=Neumann + log rm -rf Neumann-*.vtk + log NUTILS_RICHOUTPUT=no python3 heat.py --side=Neumann ;; *) - usage + log usage ;; 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..af69be292 100755 --- a/partitioned-heat-conduction-overlap/left-fenics/run.sh +++ b/partitioned-heat-conduction-overlap/left-fenics/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -python3 ../solver-fenics/heat.py Left \ No newline at end of file +. ../../tools/log.sh + +log 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..fc635bc2a 100755 --- a/partitioned-heat-conduction-overlap/right-fenics/run.sh +++ b/partitioned-heat-conduction-overlap/right-fenics/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -python3 ../solver-fenics/heat.py Right \ No newline at end of file +. ../../tools/log.sh + +log 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..5fa306a84 100755 --- a/partitioned-heat-conduction/dirichlet-fenics/run.sh +++ b/partitioned-heat-conduction/dirichlet-fenics/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -python3 ../solver-fenics/heat.py Dirichlet \ No newline at end of file +. ../../tools/log.sh + +log 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..7baacfb2c 100755 --- a/partitioned-heat-conduction/dirichlet-openfoam/run.sh +++ b/partitioned-heat-conduction/dirichlet-openfoam/run.sh @@ -1,9 +1,13 @@ #!/bin/sh set -e -u -blockMesh -touch openfoam-dirichlet.foam -./setInitialField.sh +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs + +log blockMesh +log ./setInitialField.sh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs + +close_log diff --git a/partitioned-heat-conduction/fenicsx/run.sh b/partitioned-heat-conduction/fenicsx/run.sh index e31f07a10..1737dc040 100755 --- a/partitioned-heat-conduction/fenicsx/run.sh +++ b/partitioned-heat-conduction/fenicsx/run.sh @@ -1,16 +1,20 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + while getopts ":dn" opt; do case ${opt} in d) - python3 heat.py -d --error-tol 10e-3 + log python3 heat.py -d --error-tol 10e-3 ;; n) - python3 heat.py -n --error-tol 10e-3 + log python3 heat.py -n --error-tol 10e-3 ;; \?) - echo "Usage: cmd [-d] [-n]" + log echo "Usage: cmd [-d] [-n]" ;; esac done + +close_log diff --git a/partitioned-heat-conduction/neumann-fenics/run.sh b/partitioned-heat-conduction/neumann-fenics/run.sh index 7c3fba9c1..4d8da96f6 100755 --- a/partitioned-heat-conduction/neumann-fenics/run.sh +++ b/partitioned-heat-conduction/neumann-fenics/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -python3 ../solver-fenics/heat.py Neumann \ No newline at end of file +. ../../tools/log.sh + +log 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..7f360be5c 100755 --- a/partitioned-heat-conduction/neumann-openfoam/run.sh +++ b/partitioned-heat-conduction/neumann-openfoam/run.sh @@ -1,9 +1,12 @@ #!/bin/sh set -e -u -blockMesh -touch openfoam-neumann.foam -./setInitialField.sh +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh +log ./setInitialField.sh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs + +close_log diff --git a/partitioned-pipe-two-phase/fluid1-openfoam/run.sh b/partitioned-pipe-two-phase/fluid1-openfoam/run.sh index d8230a576..dd6219e85 100755 --- a/partitioned-pipe-two-phase/fluid1-openfoam/run.sh +++ b/partitioned-pipe-two-phase/fluid1-openfoam/run.sh @@ -1,10 +1,13 @@ #!/bin/sh set -e -u -blockMesh -cp -r 0.orig 0 -setFields -touch fluid1.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh +log cp -r 0.orig 0 +log setFields + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..dd6219e85 100755 --- a/partitioned-pipe-two-phase/fluid2-openfoam/run.sh +++ b/partitioned-pipe-two-phase/fluid2-openfoam/run.sh @@ -1,10 +1,13 @@ #!/bin/sh set -e -u -blockMesh -cp -r 0.orig 0 -setFields -touch fluid2.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh +log cp -r 0.orig 0 +log setFields + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..dd6219e85 100755 --- a/partitioned-pipe-two-phase/monolithic/run.sh +++ b/partitioned-pipe-two-phase/monolithic/run.sh @@ -1,10 +1,13 @@ #!/bin/sh set -e -u -blockMesh -cp -r 0.orig 0 -setFields -touch monolithic.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh +log cp -r 0.orig 0 +log setFields + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..a804c9a78 100755 --- a/partitioned-pipe/fluid1-openfoam-pimplefoam/run.sh +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/run.sh @@ -1,6 +1,8 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + use_skewed=false for arg in "$@" @@ -11,14 +13,14 @@ do done if [ "$use_skewed" = true ]; then - blockMesh -dict system/blockMeshDictSkewed + log blockMesh -dict system/blockMeshDictSkewed else - blockMesh + log blockMesh fi -touch fluid1-openfoam-pimplefoam.foam +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log postProcess -func "flowRatePatch(name=inlet)" -latestTime -noZero -postProcess -func "flowRatePatch(name=inlet)" -latestTime -noZero \ No newline at end of file +close_log diff --git a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/run.sh b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/run.sh index 76e94cbc8..864ca8c26 100755 --- a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/run.sh +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/run.sh @@ -1,8 +1,11 @@ #!/bin/sh set -e -u -blockMesh -touch fluid1-openfoam-sonicliquidfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..a804c9a78 100755 --- a/partitioned-pipe/fluid2-openfoam-pimplefoam/run.sh +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/run.sh @@ -1,6 +1,8 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + use_skewed=false for arg in "$@" @@ -11,14 +13,14 @@ do done if [ "$use_skewed" = true ]; then - blockMesh -dict system/blockMeshDictSkewed + log blockMesh -dict system/blockMeshDictSkewed else - blockMesh + log blockMesh fi -touch fluid2-openfoam-pimplefoam.foam +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log postProcess -func "flowRatePatch(name=inlet)" -latestTime -noZero -postProcess -func "flowRatePatch(name=inlet)" -latestTime -noZero \ No newline at end of file +close_log diff --git a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/run.sh b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/run.sh index 5a24175c5..864ca8c26 100755 --- a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/run.sh +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/run.sh @@ -1,8 +1,11 @@ #!/bin/sh set -e -u -blockMesh -touch fluid2-openfoam-sonicliquidfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs + +close_log diff --git a/perpendicular-flap/fluid-nutils/run.sh b/perpendicular-flap/fluid-nutils/run.sh index 00b103a23..0e99d59f7 100755 --- a/perpendicular-flap/fluid-nutils/run.sh +++ b/perpendicular-flap/fluid-nutils/run.sh @@ -1,7 +1,11 @@ #!/bin/sh set -e -u -python3 -m venv .venv -. .venv/bin/activate -pip install -r requirements.txt -python3 fluid.py +. ../../tools/log.sh + +log python3 -m venv .venv +log . .venv/bin/activate +log pip install -r requirements.txt +log python3 fluid.py + +close_log diff --git a/perpendicular-flap/fluid-openfoam/run.sh b/perpendicular-flap/fluid-openfoam/run.sh index c191b9e48..864ca8c26 100755 --- a/perpendicular-flap/fluid-openfoam/run.sh +++ b/perpendicular-flap/fluid-openfoam/run.sh @@ -1,8 +1,11 @@ #!/bin/sh set -e -u -blockMesh -touch fluid-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs + +close_log diff --git a/perpendicular-flap/fluid-su2/run.sh b/perpendicular-flap/fluid-su2/run.sh index a827818b5..c3e6900f8 100755 --- a/perpendicular-flap/fluid-su2/run.sh +++ b/perpendicular-flap/fluid-su2/run.sh @@ -1,8 +1,12 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + if [ "${1:-}" = "-parallel" ]; then - mpirun -n 2 SU2_CFD euler_config_coupled.cfg + log mpirun -n 2 SU2_CFD euler_config_coupled.cfg else - SU2_CFD euler_config_coupled.cfg + log 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..74f14a9d7 100755 --- a/perpendicular-flap/solid-calculix/run.sh +++ b/perpendicular-flap/solid-calculix/run.sh @@ -1,19 +1,23 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + usage() { echo "Usage: run.sh [-modal]" 1>&2; exit 1; } # There must be either 0 arguments or 1, which is modal. # Send an error otherwise if [ $# -ge 2 ] || { [ $# -eq 1 ] && [ "$1" != "-modal" ]; }; then - usage + log usage fi # No arg => regular simulation. Otherwise, it's modal if [ $# -eq 0 ]; then - ccx_preCICE -i flap -precice-participant Solid + log ccx_preCICE -i flap -precice-participant Solid 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 + log ccx_preCICE -i frequency + log mv frequency.eig flap_modal.eig + log ccx_preCICE -i flap_modal -precice-participant Solid +fi + +close_log diff --git a/perpendicular-flap/solid-dune/run.sh b/perpendicular-flap/solid-dune/run.sh index bbe2d648c..c46407ade 100755 --- a/perpendicular-flap/solid-dune/run.sh +++ b/perpendicular-flap/solid-dune/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -./dune-perpendicular-flap +. ../../tools/log.sh + +log ./dune-perpendicular-flap + +close_log diff --git a/perpendicular-flap/solid-fenics/run.sh b/perpendicular-flap/solid-fenics/run.sh index 15315c67d..ad66b6d1b 100755 --- a/perpendicular-flap/solid-fenics/run.sh +++ b/perpendicular-flap/solid-fenics/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -python3 solid.py +. ../../tools/log.sh + +log python3 solid.py + +close_log diff --git a/perpendicular-flap/solid-nutils/run.sh b/perpendicular-flap/solid-nutils/run.sh index b57faa9f2..73285978f 100755 --- a/perpendicular-flap/solid-nutils/run.sh +++ b/perpendicular-flap/solid-nutils/run.sh @@ -1,7 +1,11 @@ #!/bin/sh set -e -u -python3 -m venv .venv -. .venv/bin/activate -pip install -r requirements.txt -python3 solid.py richoutput=no +. ../../tools/log.sh + +log python3 -m venv .venv +log . .venv/bin/activate +log pip install -r requirements.txt +log 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..c971873e2 100755 --- a/perpendicular-flap/solid-openfoam/run.sh +++ b/perpendicular-flap/solid-openfoam/run.sh @@ -1,10 +1,13 @@ #!/bin/bash -blockMesh -touch solid-openfoam.foam +. ../../tools/log.sh + +log blockMesh # Compile boundary condition -(cd solidDisplacementFoamForce && wmake libso) +(cd solidDisplacementFoamForce && log wmake libso) + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs -../../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..aba5de63d 100755 --- a/perpendicular-flap/solid-solids4foam/run.sh +++ b/perpendicular-flap/solid-solids4foam/run.sh @@ -1,7 +1,10 @@ #!/bin/bash -blockMesh -touch solid-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs + +close_log diff --git a/turek-hron-fsi3/fluid-openfoam/run.sh b/turek-hron-fsi3/fluid-openfoam/run.sh index c191b9e48..864ca8c26 100755 --- a/turek-hron-fsi3/fluid-openfoam/run.sh +++ b/turek-hron-fsi3/fluid-openfoam/run.sh @@ -1,8 +1,11 @@ #!/bin/sh set -e -u -blockMesh -touch fluid-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..22671307e 100755 --- a/two-scale-heat-conduction/macro-dumux/run.sh +++ b/two-scale-heat-conduction/macro-dumux/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -./macro_dumux params.input +. ../../tools/log.sh + +log ./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..c37669008 100755 --- a/two-scale-heat-conduction/macro-nutils/run.sh +++ b/two-scale-heat-conduction/macro-nutils/run.sh @@ -1,7 +1,11 @@ #!/bin/sh set -e -u -python3 -m venv .venv -. .venv/bin/activate -pip install -r requirements.txt -python3 macro.py richoutput=no +. ../../tools/log.sh + +log python3 -m venv .venv +log . .venv/bin/activate +log pip install -r requirements.txt +log 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..32412d570 100755 --- a/two-scale-heat-conduction/micro-dumux/run.sh +++ b/two-scale-heat-conduction/micro-dumux/run.sh @@ -1,24 +1,28 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + 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 + log echo "No input argument provided. Micro Manager is launched in serial" + log python3 run_micro_manager.py params.input fi while getopts ":sp" opt; do case ${opt} in s) - python3 run_micro_manager.py params.input + log python3 run_micro_manager.py params.input ;; p) - mpiexec -n "$2" python3 run_micro_manager.py params.input + log mpiexec -n "$2" python3 run_micro_manager.py params.input ;; *) - usage + log usage ;; 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 8edbe9445..b406d306e 100755 --- a/two-scale-heat-conduction/micro-nutils/run.sh +++ b/two-scale-heat-conduction/micro-nutils/run.sh @@ -1,28 +1,32 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + usage() { echo "Usage: cmd [-s] [-p n]" 1>&2; exit 1; } -python3 -m venv .venv -. .venv/bin/activate -pip install -r requirements.txt +log python3 -m venv .venv +log . .venv/bin/activate +log 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-problems.py + log echo "No input argument provided. Micro Manager is launched in serial" + log python3 run-micro-problems.py fi while getopts ":sp" opt; do case ${opt} in s) - python3 run-micro-problems.py + log python3 run-micro-problems.py ;; p) - mpiexec -n "$2" python3 run-micro-problems.py + log mpiexec -n "$2" python3 run-micro-problems.py ;; *) - usage + log usage ;; esac done + +close_log diff --git a/volume-coupled-diffusion/fenics/run.sh b/volume-coupled-diffusion/fenics/run.sh index d15dd2163..98cc73f65 100755 --- a/volume-coupled-diffusion/fenics/run.sh +++ b/volume-coupled-diffusion/fenics/run.sh @@ -1,24 +1,28 @@ #!/bin/sh set -e -u +. ../../tools/log.sh + usage() { echo "Usage: cmd [-s] [-d]" 1>&2; exit 1; } # Check if no input argument was provided if [ -z "$*" ] ; then - usage + log usage fi # Select appropriate case while getopts ":sd" opt; do case ${opt} in s) - python3 volume-coupled-diffusion.py --source + log python3 volume-coupled-diffusion.py --source ;; d) - python3 volume-coupled-diffusion.py --drain + log python3 volume-coupled-diffusion.py --drain ;; *) - usage + log usage ;; esac done + +close_log diff --git a/volume-coupled-flow/fluid-openfoam/run.sh b/volume-coupled-flow/fluid-openfoam/run.sh index 3418d12d1..4c61a814c 100755 --- a/volume-coupled-flow/fluid-openfoam/run.sh +++ b/volume-coupled-flow/fluid-openfoam/run.sh @@ -1,9 +1,12 @@ #!/bin/sh set -e -u -blockMesh -topoSet -touch fluid-openfoam.foam +. ../../tools/log.sh -../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs +log blockMesh +log topoSet + +log ../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && log 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..39c1fb74b 100755 --- a/volume-coupled-flow/source-nutils/run.sh +++ b/volume-coupled-flow/source-nutils/run.sh @@ -1,4 +1,8 @@ #!/bin/sh set -e -u -python3 source.py +. ../../tools/log.sh + +log python3 source.py + +close_log From 6a36e5ebf62f9e2d581a4067edd8c2cc2ce13436 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 09:05:44 +0100 Subject: [PATCH 11/17] two-scale-heat-conduction: tabs to spaces --- two-scale-heat-conduction/micro-dumux/run.sh | 2 +- two-scale-heat-conduction/micro-nutils/run.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/two-scale-heat-conduction/micro-dumux/run.sh b/two-scale-heat-conduction/micro-dumux/run.sh index 32412d570..48ffd12bd 100755 --- a/two-scale-heat-conduction/micro-dumux/run.sh +++ b/two-scale-heat-conduction/micro-dumux/run.sh @@ -8,7 +8,7 @@ usage() { echo "Usage: cmd [-s] [-p n]" 1>&2; exit 1; } # Check if no input argument was provided if [ -z "$*" ] ; then log echo "No input argument provided. Micro Manager is launched in serial" - log python3 run_micro_manager.py params.input + log python3 run_micro_manager.py params.input fi while getopts ":sp" opt; do diff --git a/two-scale-heat-conduction/micro-nutils/run.sh b/two-scale-heat-conduction/micro-nutils/run.sh index b406d306e..d3ab76305 100755 --- a/two-scale-heat-conduction/micro-nutils/run.sh +++ b/two-scale-heat-conduction/micro-nutils/run.sh @@ -12,7 +12,7 @@ log pip install -r requirements.txt # Check if no input argument was provided if [ -z "$*" ] ; then log echo "No input argument provided. Micro Manager is launched in serial" - log python3 run-micro-problems.py + log python3 run-micro-problems.py fi while getopts ":sp" opt; do From bf3d7d056a0f6b2e4dc50929310f40988c4b1782 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 15:36:37 +0100 Subject: [PATCH 12/17] Add clean_case_logs to raw clean.sh scripts --- elastic-tube-1d/fluid-cpp/clean.sh | 1 + elastic-tube-1d/fluid-python/clean.sh | 1 + elastic-tube-1d/fluid-rust/clean.sh | 1 + elastic-tube-1d/solid-cpp/clean.sh | 1 + elastic-tube-1d/solid-python/clean.sh | 1 + elastic-tube-1d/solid-rust/clean.sh | 1 + .../controller-fmi/clean.sh | 3 +-- .../solid-python/clean.sh | 2 ++ oscillator-overlap/mass-left-python/clean.sh | 1 + oscillator-overlap/mass-right-python/clean.sh | 1 + oscillator/fmi/clean.sh | 4 +--- oscillator/python/clean.sh | 1 + quickstart/solid-cpp/clean.sh | 1 + tools/cleaning-tools.sh | 21 ++++++++++++++----- 14 files changed, 30 insertions(+), 10 deletions(-) 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-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-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/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-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-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/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/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/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-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/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/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/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/tools/cleaning-tools.sh b/tools/cleaning-tools.sh index c215ac488..3cea7742b 100755 --- a/tools/cleaning-tools.sh +++ b/tools/cleaning-tools.sh @@ -167,11 +167,22 @@ clean_dune() { 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 . + ) } From aa2faa7e73416777551a9df66c16e338be27e454 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 15:37:24 +0100 Subject: [PATCH 13/17] Update flow-around-controlled-moving-cylinder/controller-fmi/run.sh Co-authored-by: Benjamin Uekermann --- .../controller-fmi/run.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flow-around-controlled-moving-cylinder/controller-fmi/run.sh b/flow-around-controlled-moving-cylinder/controller-fmi/run.sh index 790f73384..cb63130f8 100755 --- a/flow-around-controlled-moving-cylinder/controller-fmi/run.sh +++ b/flow-around-controlled-moving-cylinder/controller-fmi/run.sh @@ -4,14 +4,14 @@ set -e -u . ../../tools/log.sh if [ ! -f PIDcontroller.fmu ]; then - log cd fmu - log rm -rf build - log mkdir build - log cd build + cd fmu + rm -rf build + mkdir build + cd build log cmake -DFMI_TYPE=CS -DFMI_VERSION=3 .. log make - log cp ./PIDcontroller.fmu ../.. - log cd ../../ + cp ./PIDcontroller.fmu ../.. + cd ../../ fi log fmiprecice ./fmi-settings.json ./precice-settings.json From b622692e9052888ed6eec5d5cf10056b0f3a098f Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 15:37:33 +0100 Subject: [PATCH 14/17] Update oscillator/fmi/run.sh Co-authored-by: Benjamin Uekermann --- oscillator/fmi/run.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/oscillator/fmi/run.sh b/oscillator/fmi/run.sh index d2945f76f..a12a334d5 100755 --- a/oscillator/fmi/run.sh +++ b/oscillator/fmi/run.sh @@ -11,15 +11,15 @@ if [ -z "$*" ] ; then fi if [ ! -f Oscillator.fmu ]; then - log cd fmu - log rm -rf build - log mkdir build - log cd build - log # Both FMI_VERSION=3 and FMI_VERSION=2 are supported + cd fmu + rm -rf build + mkdir build + cd build + # Both FMI_VERSION=3 and FMI_VERSION=2 are supported log cmake -DFMI_TYPE=CS -DFMI_VERSION=3 .. log make - log cp ./Oscillator.fmu ../.. - log cd ../../ + cp ./Oscillator.fmu ../.. + cd ../../ fi # Select appropriate case From 8306727bf558b5830d8909c91fab6cdfaac58cd3 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 15:40:32 +0100 Subject: [PATCH 15/17] Remove log from cd, cp, mv, rm, mkdir --- breaking-dam-2d/fluid-openfoam/run.sh | 2 +- elastic-tube-1d/fluid-cpp/run.sh | 2 +- elastic-tube-1d/solid-cpp/run.sh | 2 +- elastic-tube-3d/fluid-openfoam/run.sh | 2 +- flow-around-controlled-moving-cylinder/fluid-openfoam/run.sh | 4 ++-- partitioned-heat-conduction-direct/nutils/run.sh | 4 ++-- partitioned-pipe-two-phase/fluid1-openfoam/run.sh | 2 +- partitioned-pipe-two-phase/fluid2-openfoam/run.sh | 2 +- partitioned-pipe-two-phase/monolithic/run.sh | 2 +- perpendicular-flap/solid-calculix/run.sh | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/breaking-dam-2d/fluid-openfoam/run.sh b/breaking-dam-2d/fluid-openfoam/run.sh index bb9aebf15..a0296976c 100755 --- a/breaking-dam-2d/fluid-openfoam/run.sh +++ b/breaking-dam-2d/fluid-openfoam/run.sh @@ -3,7 +3,7 @@ set -e -u . ../../tools/log.sh -log cp 0/alpha.water_orig 0/alpha.water +cp 0/alpha.water_orig 0/alpha.water log blockMesh log setFields diff --git a/elastic-tube-1d/fluid-cpp/run.sh b/elastic-tube-1d/fluid-cpp/run.sh index 7906d3981..bc40e63ec 100755 --- a/elastic-tube-1d/fluid-cpp/run.sh +++ b/elastic-tube-1d/fluid-cpp/run.sh @@ -4,7 +4,7 @@ set -e -u . ../../tools/log.sh if [ ! -d build ]; then - log mkdir build + mkdir build log cmake -S . -B build log cmake --build build fi diff --git a/elastic-tube-1d/solid-cpp/run.sh b/elastic-tube-1d/solid-cpp/run.sh index 6708de8c8..649201774 100755 --- a/elastic-tube-1d/solid-cpp/run.sh +++ b/elastic-tube-1d/solid-cpp/run.sh @@ -4,7 +4,7 @@ set -e -u . ../../tools/log.sh if [ ! -d build ]; then - log mkdir build + mkdir build log cmake -S . -B build log cmake --build build fi diff --git a/elastic-tube-3d/fluid-openfoam/run.sh b/elastic-tube-3d/fluid-openfoam/run.sh index 5a90867ba..d253a51fe 100755 --- a/elastic-tube-3d/fluid-openfoam/run.sh +++ b/elastic-tube-3d/fluid-openfoam/run.sh @@ -3,7 +3,7 @@ set -e -u . ../../tools/log.sh -log cp -r constant/polyMesh.orig constant/polyMesh +cp -r constant/polyMesh.orig constant/polyMesh log ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs diff --git a/flow-around-controlled-moving-cylinder/fluid-openfoam/run.sh b/flow-around-controlled-moving-cylinder/fluid-openfoam/run.sh index 19ade3233..f9c4a9f62 100755 --- a/flow-around-controlled-moving-cylinder/fluid-openfoam/run.sh +++ b/flow-around-controlled-moving-cylinder/fluid-openfoam/run.sh @@ -7,8 +7,8 @@ log blockMesh log transformPoints -scale '(0.0016 0.0016 1)' log transformPoints -translate '(0.0 0.0 -0.05)' -log rm -rf 0 -log cp -r 0.orig 0 +rm -rf 0 +cp -r 0.orig 0 log ../../tools/run-openfoam.sh "$@" . ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs diff --git a/partitioned-heat-conduction-direct/nutils/run.sh b/partitioned-heat-conduction-direct/nutils/run.sh index f81ed0d1c..0c9de3146 100755 --- a/partitioned-heat-conduction-direct/nutils/run.sh +++ b/partitioned-heat-conduction-direct/nutils/run.sh @@ -17,11 +17,11 @@ log pip install -r requirements.txt while getopts ":dn" opt; do case ${opt} in d) - log rm -rf Dirichlet-*.vtk + rm -rf Dirichlet-*.vtk log NUTILS_RICHOUTPUT=no python3 heat.py --side=Dirichlet ;; n) - log rm -rf Neumann-*.vtk + rm -rf Neumann-*.vtk log NUTILS_RICHOUTPUT=no python3 heat.py --side=Neumann ;; *) diff --git a/partitioned-pipe-two-phase/fluid1-openfoam/run.sh b/partitioned-pipe-two-phase/fluid1-openfoam/run.sh index dd6219e85..50646029c 100755 --- a/partitioned-pipe-two-phase/fluid1-openfoam/run.sh +++ b/partitioned-pipe-two-phase/fluid1-openfoam/run.sh @@ -4,7 +4,7 @@ set -e -u . ../../tools/log.sh log blockMesh -log cp -r 0.orig 0 +cp -r 0.orig 0 log setFields log ../../tools/run-openfoam.sh "$@" diff --git a/partitioned-pipe-two-phase/fluid2-openfoam/run.sh b/partitioned-pipe-two-phase/fluid2-openfoam/run.sh index dd6219e85..50646029c 100755 --- a/partitioned-pipe-two-phase/fluid2-openfoam/run.sh +++ b/partitioned-pipe-two-phase/fluid2-openfoam/run.sh @@ -4,7 +4,7 @@ set -e -u . ../../tools/log.sh log blockMesh -log cp -r 0.orig 0 +cp -r 0.orig 0 log setFields log ../../tools/run-openfoam.sh "$@" diff --git a/partitioned-pipe-two-phase/monolithic/run.sh b/partitioned-pipe-two-phase/monolithic/run.sh index dd6219e85..50646029c 100755 --- a/partitioned-pipe-two-phase/monolithic/run.sh +++ b/partitioned-pipe-two-phase/monolithic/run.sh @@ -4,7 +4,7 @@ set -e -u . ../../tools/log.sh log blockMesh -log cp -r 0.orig 0 +cp -r 0.orig 0 log setFields log ../../tools/run-openfoam.sh "$@" diff --git a/perpendicular-flap/solid-calculix/run.sh b/perpendicular-flap/solid-calculix/run.sh index 74f14a9d7..3d4333eb4 100755 --- a/perpendicular-flap/solid-calculix/run.sh +++ b/perpendicular-flap/solid-calculix/run.sh @@ -16,7 +16,7 @@ if [ $# -eq 0 ]; then log ccx_preCICE -i flap -precice-participant Solid else log ccx_preCICE -i frequency - log mv frequency.eig flap_modal.eig + mv frequency.eig flap_modal.eig log ccx_preCICE -i flap_modal -precice-participant Solid fi From d02b018c1252ee1a7d895ded25135f1714b40513 Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 16:13:39 +0100 Subject: [PATCH 16/17] Simplify logging of everything, switch to bash --- breaking-dam-2d/fluid-openfoam/run.sh | 11 ++++++----- breaking-dam-2d/solid-calculix/run.sh | 5 +++-- .../chemical-fenics/run.sh | 5 +++-- channel-transport-reaction/fluid-fenics/run.sh | 5 +++-- channel-transport/fluid-nutils/run.sh | 11 ++++++----- channel-transport/fluid-openfoam/run.sh | 9 +++++---- channel-transport/transport-nutils/run.sh | 11 ++++++----- elastic-tube-1d/fluid-cpp/run.sh | 8 ++++---- elastic-tube-1d/fluid-python/run.sh | 5 +++-- elastic-tube-1d/fluid-rust/run.sh | 5 +++-- elastic-tube-1d/solid-cpp/run.sh | 8 ++++---- elastic-tube-1d/solid-python/run.sh | 5 +++-- elastic-tube-1d/solid-rust/run.sh | 5 +++-- elastic-tube-3d/fluid-openfoam/run.sh | 6 +++--- elastic-tube-3d/solid-calculix/run.sh | 4 ++-- elastic-tube-3d/solid-fenics/run.sh | 2 +- .../controller-fmi/run.sh | 8 ++++---- .../fluid-openfoam/run.sh | 13 +++++++------ .../solid-python/run.sh | 5 +++-- .../fluid-openfoam/run.sh | 9 +++++---- .../solid-openfoam/run.sh | 9 +++++---- .../fluid1-openfoam/run.sh | 9 +++++---- .../fluid2-openfoam/run.sh | 9 +++++---- .../solid-openfoam/run.sh | 9 +++++---- .../fluid-openfoam/run.sh | 9 +++++---- .../solid-codeaster/run.sh | 15 ++++++++------- .../fluid-openfoam/run.sh | 9 +++++---- .../solid-calculix/run.sh | 7 ++++--- flow-over-heated-plate/fluid-openfoam/run.sh | 9 +++++---- flow-over-heated-plate/solid-dunefem/run.sh | 3 ++- flow-over-heated-plate/solid-fenics/run.sh | 5 +++-- flow-over-heated-plate/solid-nutils/run.sh | 9 +++++---- flow-over-heated-plate/solid-openfoam/run.sh | 9 +++++---- .../fluid-bottom-openfoam/run.sh | 9 +++++---- .../fluid-top-openfoam/run.sh | 9 +++++---- .../solid-calculix/run.sh | 7 ++++--- heat-exchanger/fluid-inner-openfoam/run.sh | 7 ++++--- heat-exchanger/fluid-outer-openfoam/run.sh | 7 ++++--- heat-exchanger/solid-calculix/run.sh | 6 +++--- .../fluid-openfoam/run.sh | 9 +++++---- oscillator-overlap/mass-left-python/run.sh | 5 +++-- oscillator-overlap/mass-right-python/run.sh | 5 +++-- oscillator/fmi/run.sh | 18 +++++++++--------- oscillator/python/run.sh | 10 +++++----- .../fluid1-openfoam/run.sh | 9 +++++---- .../fluid2-openfoam/run.sh | 9 +++++---- .../dirichlet-calculix/run.sh | 4 ++-- .../neumann-calculix/run.sh | 4 ++-- .../dirichlet-fenics/run.sh | 5 +++-- .../neumann-fenics/run.sh | 5 +++-- .../nutils/run.sh | 16 ++++++++-------- .../left-fenics/run.sh | 5 +++-- .../right-fenics/run.sh | 5 +++-- .../dirichlet-fenics/run.sh | 5 +++-- .../dirichlet-openfoam/run.sh | 10 +++++----- partitioned-heat-conduction/fenicsx/run.sh | 8 ++++---- .../neumann-fenics/run.sh | 5 +++-- .../neumann-openfoam/run.sh | 11 ++++++----- partitioned-heat-conduction/nutils/run.sh | 2 +- .../fluid1-openfoam/run.sh | 11 ++++++----- .../fluid2-openfoam/run.sh | 11 ++++++----- partitioned-pipe-two-phase/monolithic/run.sh | 11 ++++++----- .../fluid1-openfoam-pimplefoam/run.sh | 12 ++++++------ .../fluid1-openfoam-sonicliquidfoam/run.sh | 9 +++++---- .../fluid2-openfoam-pimplefoam/run.sh | 12 ++++++------ .../fluid2-openfoam-sonicliquidfoam/run.sh | 9 +++++---- perpendicular-flap/fluid-nutils/run.sh | 11 ++++++----- perpendicular-flap/fluid-openfoam/run.sh | 9 +++++---- perpendicular-flap/fluid-su2/run.sh | 6 +++--- perpendicular-flap/solid-calculix/run.sh | 10 +++++----- perpendicular-flap/solid-dune/run.sh | 5 +++-- perpendicular-flap/solid-fenics/run.sh | 5 +++-- perpendicular-flap/solid-nutils/run.sh | 11 ++++++----- perpendicular-flap/solid-openfoam/run.sh | 9 +++++---- perpendicular-flap/solid-solids4foam/run.sh | 7 ++++--- quickstart/fluid-openfoam/run.sh | 9 +++++---- quickstart/solid-cpp/run.sh | 7 ++++--- tools/log.sh | 15 ++++++--------- tools/run-dealii.sh | 2 +- turek-hron-fsi3/fluid-openfoam/run.sh | 9 +++++---- two-scale-heat-conduction/macro-dumux/run.sh | 5 +++-- two-scale-heat-conduction/macro-nutils/run.sh | 11 ++++++----- two-scale-heat-conduction/micro-dumux/run.sh | 12 ++++++------ two-scale-heat-conduction/micro-nutils/run.sh | 18 +++++++++--------- volume-coupled-diffusion/fenics/run.sh | 10 +++++----- volume-coupled-flow/fluid-openfoam/run.sh | 11 ++++++----- volume-coupled-flow/source-nutils/run.sh | 5 +++-- 87 files changed, 384 insertions(+), 324 deletions(-) diff --git a/breaking-dam-2d/fluid-openfoam/run.sh b/breaking-dam-2d/fluid-openfoam/run.sh index a0296976c..d1c9bfbd5 100755 --- a/breaking-dam-2d/fluid-openfoam/run.sh +++ b/breaking-dam-2d/fluid-openfoam/run.sh @@ -1,13 +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 -log blockMesh -log setFields +blockMesh +setFields -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 a12ac5937..3a9f49aae 100755 --- a/breaking-dam-2d/solid-calculix/run.sh +++ b/breaking-dam-2d/solid-calculix/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log ccx_preCICE -i flap -precice-participant Solid +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 ab6e02f37..63712e999 100755 --- a/channel-transport-reaction/chemical-fenics/run.sh +++ b/channel-transport-reaction/chemical-fenics/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 chemical-reaction-advection-diffusion.py +python3 chemical-reaction-advection-diffusion.py close_log diff --git a/channel-transport-reaction/fluid-fenics/run.sh b/channel-transport-reaction/fluid-fenics/run.sh index b17cd285e..e25136551 100755 --- a/channel-transport-reaction/fluid-fenics/run.sh +++ b/channel-transport-reaction/fluid-fenics/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 fluid.py +python3 fluid.py close_log diff --git a/channel-transport/fluid-nutils/run.sh b/channel-transport/fluid-nutils/run.sh index 0e99d59f7..7094b61c8 100755 --- a/channel-transport/fluid-nutils/run.sh +++ b/channel-transport/fluid-nutils/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 -m venv .venv -log . .venv/bin/activate -log pip install -r requirements.txt -log python3 fluid.py +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 864ca8c26..da82a9ba2 100755 --- a/channel-transport/fluid-openfoam/run.sh +++ b/channel-transport/fluid-openfoam/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 26bc8f71f..4430e392c 100755 --- a/channel-transport/transport-nutils/run.sh +++ b/channel-transport/transport-nutils/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 -m venv .venv -log . .venv/bin/activate -log pip install -r requirements.txt -log python3 transport.py +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/run.sh b/elastic-tube-1d/fluid-cpp/run.sh index bc40e63ec..e99dd09e5 100755 --- a/elastic-tube-1d/fluid-cpp/run.sh +++ b/elastic-tube-1d/fluid-cpp/run.sh @@ -1,14 +1,14 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh if [ ! -d build ]; then mkdir build - log cmake -S . -B build - log cmake --build build + cmake -S . -B build + cmake --build build fi -log ./build/FluidSolver ../precice-config.xml +./build/FluidSolver ../precice-config.xml close_log diff --git a/elastic-tube-1d/fluid-python/run.sh b/elastic-tube-1d/fluid-python/run.sh index 36a1ca22b..dcf4c901d 100755 --- a/elastic-tube-1d/fluid-python/run.sh +++ b/elastic-tube-1d/fluid-python/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 ./FluidSolver.py ../precice-config.xml +python3 ./FluidSolver.py ../precice-config.xml close_log diff --git a/elastic-tube-1d/fluid-rust/run.sh b/elastic-tube-1d/fluid-rust/run.sh index 987cf781c..9985f982b 100755 --- a/elastic-tube-1d/fluid-rust/run.sh +++ b/elastic-tube-1d/fluid-rust/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log cargo run --release ../precice-config.xml +cargo run --release ../precice-config.xml close_log diff --git a/elastic-tube-1d/solid-cpp/run.sh b/elastic-tube-1d/solid-cpp/run.sh index 649201774..84261afbc 100755 --- a/elastic-tube-1d/solid-cpp/run.sh +++ b/elastic-tube-1d/solid-cpp/run.sh @@ -1,14 +1,14 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh if [ ! -d build ]; then mkdir build - log cmake -S . -B build - log cmake --build build + cmake -S . -B build + cmake --build build fi -log ./build/SolidSolver ../precice-config.xml +./build/SolidSolver ../precice-config.xml close_log diff --git a/elastic-tube-1d/solid-python/run.sh b/elastic-tube-1d/solid-python/run.sh index 0c4e5dd52..6e772ed24 100755 --- a/elastic-tube-1d/solid-python/run.sh +++ b/elastic-tube-1d/solid-python/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 ./SolidSolver.py ../precice-config.xml +python3 ./SolidSolver.py ../precice-config.xml close_log diff --git a/elastic-tube-1d/solid-rust/run.sh b/elastic-tube-1d/solid-rust/run.sh index 49305ddf7..85bee03f5 100755 --- a/elastic-tube-1d/solid-rust/run.sh +++ b/elastic-tube-1d/solid-rust/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log cargo run --release ../precice-config.xml +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 d253a51fe..114671a2d 100755 --- a/elastic-tube-3d/fluid-openfoam/run.sh +++ b/elastic-tube-3d/fluid-openfoam/run.sh @@ -1,11 +1,11 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh cp -r constant/polyMesh.orig constant/polyMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 2676d0c2a..a5925b868 100755 --- a/elastic-tube-3d/solid-calculix/run.sh +++ b/elastic-tube-3d/solid-calculix/run.sh @@ -1,10 +1,10 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh export OMP_NUM_THREADS=1 export CCX_NPROC_EQUATION_SOLVER=1 -log ccx_preCICE -i tube -precice-participant Solid +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/run.sh b/flow-around-controlled-moving-cylinder/controller-fmi/run.sh index cb63130f8..9827e49c9 100755 --- a/flow-around-controlled-moving-cylinder/controller-fmi/run.sh +++ b/flow-around-controlled-moving-cylinder/controller-fmi/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh @@ -8,12 +8,12 @@ if [ ! -f PIDcontroller.fmu ]; then rm -rf build mkdir build cd build - log cmake -DFMI_TYPE=CS -DFMI_VERSION=3 .. - log make + cmake -DFMI_TYPE=CS -DFMI_VERSION=3 .. + make cp ./PIDcontroller.fmu ../.. cd ../../ fi -log fmiprecice ./fmi-settings.json ./precice-settings.json +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 f9c4a9f62..e2a8415a0 100755 --- a/flow-around-controlled-moving-cylinder/fluid-openfoam/run.sh +++ b/flow-around-controlled-moving-cylinder/fluid-openfoam/run.sh @@ -1,16 +1,17 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh -log transformPoints -scale '(0.0016 0.0016 1)' -log transformPoints -translate '(0.0 0.0 -0.05)' +blockMesh +transformPoints -scale '(0.0016 0.0016 1)' +transformPoints -translate '(0.0 0.0 -0.05)' rm -rf 0 cp -r 0.orig 0 -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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/run.sh b/flow-around-controlled-moving-cylinder/solid-python/run.sh index 9494ca643..678a825eb 100755 --- a/flow-around-controlled-moving-cylinder/solid-python/run.sh +++ b/flow-around-controlled-moving-cylinder/solid-python/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 solid.py ../precice-config.xml +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 864ca8c26..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,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 864ca8c26..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,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 864ca8c26..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,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 864ca8c26..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,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 864ca8c26..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,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 864ca8c26..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,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 c70dcdeef..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,16 +1,17 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log echo "Warning: this case requires a manual preparation step for code_aster." -log echo "You also need to set an absolute path as exchange-directory in precice-config.xml." -log echo "See the tutorial and code_aster adapter documentation pages for more:" -log echo "https://precice.org/adapter-code_aster.html" -log echo "" +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:" +echo "https://precice.org/adapter-code_aster.html" +echo "" export TUTORIAL_ROOT="${PWD}" export PRECICE_PARTICIPANT=Solid -log as_run --run solid.export +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 864ca8c26..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,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 832e75b61..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,9 +1,10 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 ./generate_mesh.py > all.msh -log ccx_preCICE -i solid -precice-participant Solid +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 864ca8c26..da82a9ba2 100755 --- a/flow-over-heated-plate/fluid-openfoam/run.sh +++ b/flow-over-heated-plate/fluid-openfoam/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 536d0dea4..6d5da4496 100755 --- a/flow-over-heated-plate/solid-dunefem/run.sh +++ b/flow-over-heated-plate/solid-dunefem/run.sh @@ -2,7 +2,8 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 solid.py +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 ad66b6d1b..6d5da4496 100755 --- a/flow-over-heated-plate/solid-fenics/run.sh +++ b/flow-over-heated-plate/solid-fenics/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 solid.py +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 f216f8055..125686c9e 100755 --- a/flow-over-heated-plate/solid-nutils/run.sh +++ b/flow-over-heated-plate/solid-nutils/run.sh @@ -2,10 +2,11 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 -m venv .venv -log . .venv/bin/activate -log pip install -r requirements.txt -log python3 solid.py +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 864ca8c26..da82a9ba2 100755 --- a/flow-over-heated-plate/solid-openfoam/run.sh +++ b/flow-over-heated-plate/solid-openfoam/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 864ca8c26..da82a9ba2 100755 --- a/heat-exchanger-simplified/fluid-bottom-openfoam/run.sh +++ b/heat-exchanger-simplified/fluid-bottom-openfoam/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 864ca8c26..da82a9ba2 100755 --- a/heat-exchanger-simplified/fluid-top-openfoam/run.sh +++ b/heat-exchanger-simplified/fluid-top-openfoam/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 832e75b61..460b914bd 100755 --- a/heat-exchanger-simplified/solid-calculix/run.sh +++ b/heat-exchanger-simplified/solid-calculix/run.sh @@ -1,9 +1,10 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 ./generate_mesh.py > all.msh -log ccx_preCICE -i solid -precice-participant Solid +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 c71009214..71a1313ae 100755 --- a/heat-exchanger/fluid-inner-openfoam/run.sh +++ b/heat-exchanger/fluid-inner-openfoam/run.sh @@ -1,9 +1,10 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 c71009214..71a1313ae 100755 --- a/heat-exchanger/fluid-outer-openfoam/run.sh +++ b/heat-exchanger/fluid-outer-openfoam/run.sh @@ -1,9 +1,10 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 bf264eb69..c57ccc311 100755 --- a/heat-exchanger/solid-calculix/run.sh +++ b/heat-exchanger/solid-calculix/run.sh @@ -1,15 +1,15 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh if [ ! -f all.msh ]; then - log echo "Mesh files not found. Use the Download_meshes script to download them." + echo "Mesh files not found. Use the Download_meshes script to download them." exit fi export OMP_NUM_THREADS=1 export CCX_NPROC_EQUATION_SOLVER=1 -log ccx_preCICE -i solid -precice-participant Solid +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 864ca8c26..da82a9ba2 100755 --- a/multiple-perpendicular-flaps/fluid-openfoam/run.sh +++ b/multiple-perpendicular-flaps/fluid-openfoam/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs close_log diff --git a/oscillator-overlap/mass-left-python/run.sh b/oscillator-overlap/mass-left-python/run.sh index 23c30d4e3..d2e5f9515 100755 --- a/oscillator-overlap/mass-left-python/run.sh +++ b/oscillator-overlap/mass-left-python/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 ../solver-python/oscillator.py Mass-Left +python3 ../solver-python/oscillator.py Mass-Left close_log diff --git a/oscillator-overlap/mass-right-python/run.sh b/oscillator-overlap/mass-right-python/run.sh index fb373fd33..4bd290c63 100755 --- a/oscillator-overlap/mass-right-python/run.sh +++ b/oscillator-overlap/mass-right-python/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 ../solver-python/oscillator.py Mass-Right +python3 ../solver-python/oscillator.py Mass-Right close_log diff --git a/oscillator/fmi/run.sh b/oscillator/fmi/run.sh index a12a334d5..8e6fbfbe5 100755 --- a/oscillator/fmi/run.sh +++ b/oscillator/fmi/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh @@ -7,7 +7,7 @@ usage() { echo "Usage: cmd [-l] [-r]" 1>&2; exit 1; } # Check if no input argument was provided if [ -z "$*" ] ; then - log usage + usage fi if [ ! -f Oscillator.fmu ]; then @@ -16,8 +16,8 @@ if [ ! -f Oscillator.fmu ]; then mkdir build cd build # Both FMI_VERSION=3 and FMI_VERSION=2 are supported - log cmake -DFMI_TYPE=CS -DFMI_VERSION=3 .. - log make + cmake -DFMI_TYPE=CS -DFMI_VERSION=3 .. + make cp ./Oscillator.fmu ../.. cd ../../ fi @@ -26,17 +26,17 @@ fi while getopts ":lr" opt; do case ${opt} in l) - log fmiprecice ./MassLeft/fmi-settings.json MassLeft/precice-settings.json - log python3 calculate-error.py MassLeft/fmi-settings.json MassLeft/precice-settings.json MassRight/fmi-settings.json MassRight/precice-settings.json Mass-Left + fmiprecice ./MassLeft/fmi-settings.json MassLeft/precice-settings.json + python3 calculate-error.py MassLeft/fmi-settings.json MassLeft/precice-settings.json MassRight/fmi-settings.json MassRight/precice-settings.json Mass-Left ;; r) - log fmiprecice MassRight/fmi-settings.json MassRight/precice-settings.json - log python3 calculate-error.py MassLeft/fmi-settings.json MassLeft/precice-settings.json MassRight/fmi-settings.json MassRight/precice-settings.json Mass-Right + fmiprecice MassRight/fmi-settings.json MassRight/precice-settings.json + python3 calculate-error.py MassLeft/fmi-settings.json MassLeft/precice-settings.json MassRight/fmi-settings.json MassRight/precice-settings.json Mass-Right ;; *) - log usage + usage ;; esac done diff --git a/oscillator/python/run.sh b/oscillator/python/run.sh index 131c7e55e..3e4fb0209 100755 --- a/oscillator/python/run.sh +++ b/oscillator/python/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh @@ -7,20 +7,20 @@ usage() { echo "Usage: cmd [-l] [-r]" 1>&2; exit 1; } # Check if no input argument was provided if [ -z "$*" ] ; then - log usage + usage fi # Select appropriate case while getopts ":lr" opt; do case ${opt} in l) - log python3 oscillator.py Mass-Left + python3 oscillator.py Mass-Left ;; r) - log python3 oscillator.py Mass-Right + python3 oscillator.py Mass-Right ;; *) - log usage + usage ;; esac done diff --git a/partitioned-backwards-facing-step/fluid1-openfoam/run.sh b/partitioned-backwards-facing-step/fluid1-openfoam/run.sh index 864ca8c26..da82a9ba2 100755 --- a/partitioned-backwards-facing-step/fluid1-openfoam/run.sh +++ b/partitioned-backwards-facing-step/fluid1-openfoam/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 864ca8c26..da82a9ba2 100755 --- a/partitioned-backwards-facing-step/fluid2-openfoam/run.sh +++ b/partitioned-backwards-facing-step/fluid2-openfoam/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 c825396f1..d0a6bac87 100755 --- a/partitioned-elastic-beam/dirichlet-calculix/run.sh +++ b/partitioned-elastic-beam/dirichlet-calculix/run.sh @@ -1,10 +1,10 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh export OMP_NUM_THREADS=1 export CCX_NPROC_EQUATION_SOLVER=1 -log ccx_preCICE -i beam1 -precice-participant Calculix1 +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 2c7a6b96c..bbc7ecfe6 100755 --- a/partitioned-elastic-beam/neumann-calculix/run.sh +++ b/partitioned-elastic-beam/neumann-calculix/run.sh @@ -1,10 +1,10 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh export OMP_NUM_THREADS=1 export CCX_NPROC_EQUATION_SOLVER=1 -log ccx_preCICE -i beam2 -precice-participant Calculix2 +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 a9100a6db..e4c1a798c 100755 --- a/partitioned-heat-conduction-complex/dirichlet-fenics/run.sh +++ b/partitioned-heat-conduction-complex/dirichlet-fenics/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 ../solver-fenics/heat.py -d -i complex +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 c8c7bb9a0..4f0ae3402 100755 --- a/partitioned-heat-conduction-complex/neumann-fenics/run.sh +++ b/partitioned-heat-conduction-complex/neumann-fenics/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 ../solver-fenics/heat.py -n -i complex +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 0c9de3146..b6d8dc781 100755 --- a/partitioned-heat-conduction-direct/nutils/run.sh +++ b/partitioned-heat-conduction-direct/nutils/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh @@ -7,25 +7,25 @@ usage() { echo "Usage: cmd [-d] [-n]" 1>&2; exit 1; } # Check if no input argument was provided if [ -z "$*" ] ; then - log usage + usage fi -log python3 -m venv .venv -log . .venv/bin/activate -log pip install -r requirements.txt +python3 -m venv .venv +. .venv/bin/activate +pip install -r requirements.txt while getopts ":dn" opt; do case ${opt} in d) rm -rf Dirichlet-*.vtk - log NUTILS_RICHOUTPUT=no python3 heat.py --side=Dirichlet + NUTILS_RICHOUTPUT=no python3 heat.py --side=Dirichlet ;; n) rm -rf Neumann-*.vtk - log NUTILS_RICHOUTPUT=no python3 heat.py --side=Neumann + NUTILS_RICHOUTPUT=no python3 heat.py --side=Neumann ;; *) - log usage + usage ;; esac done diff --git a/partitioned-heat-conduction-overlap/left-fenics/run.sh b/partitioned-heat-conduction-overlap/left-fenics/run.sh index af69be292..df525cc51 100755 --- a/partitioned-heat-conduction-overlap/left-fenics/run.sh +++ b/partitioned-heat-conduction-overlap/left-fenics/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 ../solver-fenics/heat.py Left +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 fc635bc2a..ae72b4d1b 100755 --- a/partitioned-heat-conduction-overlap/right-fenics/run.sh +++ b/partitioned-heat-conduction-overlap/right-fenics/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 ../solver-fenics/heat.py Right +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 5fa306a84..874a00a5a 100755 --- a/partitioned-heat-conduction/dirichlet-fenics/run.sh +++ b/partitioned-heat-conduction/dirichlet-fenics/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 ../solver-fenics/heat.py Dirichlet +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 7baacfb2c..c71f80da2 100755 --- a/partitioned-heat-conduction/dirichlet-openfoam/run.sh +++ b/partitioned-heat-conduction/dirichlet-openfoam/run.sh @@ -1,13 +1,13 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh -log blockMesh -log ./setInitialField.sh +blockMesh +./setInitialField.sh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs close_log diff --git a/partitioned-heat-conduction/fenicsx/run.sh b/partitioned-heat-conduction/fenicsx/run.sh index 1737dc040..948a4f66b 100755 --- a/partitioned-heat-conduction/fenicsx/run.sh +++ b/partitioned-heat-conduction/fenicsx/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh @@ -6,13 +6,13 @@ set -e -u while getopts ":dn" opt; do case ${opt} in d) - log python3 heat.py -d --error-tol 10e-3 + python3 heat.py -d --error-tol 10e-3 ;; n) - log python3 heat.py -n --error-tol 10e-3 + python3 heat.py -n --error-tol 10e-3 ;; \?) - log echo "Usage: cmd [-d] [-n]" + echo "Usage: cmd [-d] [-n]" ;; esac done diff --git a/partitioned-heat-conduction/neumann-fenics/run.sh b/partitioned-heat-conduction/neumann-fenics/run.sh index 4d8da96f6..8c02791c1 100755 --- a/partitioned-heat-conduction/neumann-fenics/run.sh +++ b/partitioned-heat-conduction/neumann-fenics/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 ../solver-fenics/heat.py Neumann +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 7f360be5c..e75dacd3d 100755 --- a/partitioned-heat-conduction/neumann-openfoam/run.sh +++ b/partitioned-heat-conduction/neumann-openfoam/run.sh @@ -1,12 +1,13 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh -log ./setInitialField.sh +blockMesh +./setInitialField.sh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 50646029c..63adb50c4 100755 --- a/partitioned-pipe-two-phase/fluid1-openfoam/run.sh +++ b/partitioned-pipe-two-phase/fluid1-openfoam/run.sh @@ -1,13 +1,14 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh cp -r 0.orig 0 -log setFields +setFields -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 50646029c..63adb50c4 100755 --- a/partitioned-pipe-two-phase/fluid2-openfoam/run.sh +++ b/partitioned-pipe-two-phase/fluid2-openfoam/run.sh @@ -1,13 +1,14 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh cp -r 0.orig 0 -log setFields +setFields -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 50646029c..63adb50c4 100755 --- a/partitioned-pipe-two-phase/monolithic/run.sh +++ b/partitioned-pipe-two-phase/monolithic/run.sh @@ -1,13 +1,14 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh cp -r 0.orig 0 -log setFields +setFields -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 a804c9a78..33ff84014 100755 --- a/partitioned-pipe/fluid1-openfoam-pimplefoam/run.sh +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh @@ -13,14 +13,14 @@ do done if [ "$use_skewed" = true ]; then - log blockMesh -dict system/blockMeshDictSkewed + blockMesh -dict system/blockMeshDictSkewed else - log blockMesh + blockMesh fi -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs -log postProcess -func "flowRatePatch(name=inlet)" -latestTime -noZero +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 864ca8c26..da82a9ba2 100755 --- a/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/run.sh +++ b/partitioned-pipe/fluid1-openfoam-sonicliquidfoam/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 a804c9a78..33ff84014 100755 --- a/partitioned-pipe/fluid2-openfoam-pimplefoam/run.sh +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh @@ -13,14 +13,14 @@ do done if [ "$use_skewed" = true ]; then - log blockMesh -dict system/blockMeshDictSkewed + blockMesh -dict system/blockMeshDictSkewed else - log blockMesh + blockMesh fi -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../tools/run-openfoam.sh "$@" +. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs -log postProcess -func "flowRatePatch(name=inlet)" -latestTime -noZero +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 864ca8c26..da82a9ba2 100755 --- a/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/run.sh +++ b/partitioned-pipe/fluid2-openfoam-sonicliquidfoam/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 0e99d59f7..7094b61c8 100755 --- a/perpendicular-flap/fluid-nutils/run.sh +++ b/perpendicular-flap/fluid-nutils/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 -m venv .venv -log . .venv/bin/activate -log pip install -r requirements.txt -log python3 fluid.py +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 864ca8c26..da82a9ba2 100755 --- a/perpendicular-flap/fluid-openfoam/run.sh +++ b/perpendicular-flap/fluid-openfoam/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 c3e6900f8..4b7eda062 100755 --- a/perpendicular-flap/fluid-su2/run.sh +++ b/perpendicular-flap/fluid-su2/run.sh @@ -1,12 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh if [ "${1:-}" = "-parallel" ]; then - log mpirun -n 2 SU2_CFD euler_config_coupled.cfg + mpirun -n 2 SU2_CFD euler_config_coupled.cfg else - log SU2_CFD euler_config_coupled.cfg + 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 3d4333eb4..fd38f4581 100755 --- a/perpendicular-flap/solid-calculix/run.sh +++ b/perpendicular-flap/solid-calculix/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh @@ -8,16 +8,16 @@ usage() { echo "Usage: run.sh [-modal]" 1>&2; exit 1; } # There must be either 0 arguments or 1, which is modal. # Send an error otherwise if [ $# -ge 2 ] || { [ $# -eq 1 ] && [ "$1" != "-modal" ]; }; then - log usage + usage fi # No arg => regular simulation. Otherwise, it's modal if [ $# -eq 0 ]; then - log ccx_preCICE -i flap -precice-participant Solid + ccx_preCICE -i flap -precice-participant Solid else - log ccx_preCICE -i frequency + ccx_preCICE -i frequency mv frequency.eig flap_modal.eig - log ccx_preCICE -i flap_modal -precice-participant Solid + ccx_preCICE -i flap_modal -precice-participant Solid fi close_log diff --git a/perpendicular-flap/solid-dune/run.sh b/perpendicular-flap/solid-dune/run.sh index c46407ade..7cf8e187a 100755 --- a/perpendicular-flap/solid-dune/run.sh +++ b/perpendicular-flap/solid-dune/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log ./dune-perpendicular-flap +./dune-perpendicular-flap close_log diff --git a/perpendicular-flap/solid-fenics/run.sh b/perpendicular-flap/solid-fenics/run.sh index ad66b6d1b..6d5da4496 100755 --- a/perpendicular-flap/solid-fenics/run.sh +++ b/perpendicular-flap/solid-fenics/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 solid.py +python3 solid.py close_log diff --git a/perpendicular-flap/solid-nutils/run.sh b/perpendicular-flap/solid-nutils/run.sh index 73285978f..43cc739cd 100755 --- a/perpendicular-flap/solid-nutils/run.sh +++ b/perpendicular-flap/solid-nutils/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 -m venv .venv -log . .venv/bin/activate -log pip install -r requirements.txt -log python3 solid.py richoutput=no +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 c971873e2..7996753e3 100755 --- a/perpendicular-flap/solid-openfoam/run.sh +++ b/perpendicular-flap/solid-openfoam/run.sh @@ -1,13 +1,14 @@ #!/bin/bash . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh # Compile boundary condition -(cd solidDisplacementFoamForce && log wmake libso) +(cd solidDisplacementFoamForce && wmake libso) -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 aba5de63d..4f2b797ab 100755 --- a/perpendicular-flap/solid-solids4foam/run.sh +++ b/perpendicular-flap/solid-solids4foam/run.sh @@ -1,10 +1,11 @@ #!/bin/bash . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 e8baeb5e0..40cd648cf 100755 --- a/quickstart/fluid-openfoam/run.sh +++ b/quickstart/fluid-openfoam/run.sh @@ -1,12 +1,13 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" +../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +. ../../tools/openfoam-remove-empty-dirs.sh && openfoam_remove_empty_dirs close_log diff --git a/quickstart/solid-cpp/run.sh b/quickstart/solid-cpp/run.sh index 19895306a..c764a8f73 100755 --- a/quickstart/solid-cpp/run.sh +++ b/quickstart/solid-cpp/run.sh @@ -1,13 +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 - log ${solver} + ${solver} else - log echo "Unable to locate the executable ${solver}. Have a look at the README for building instructions." + echo "Unable to locate the executable ${solver}. Have a look at the README for building instructions." fi close_log diff --git a/tools/log.sh b/tools/log.sh index 8925148d1..76cd533d1 100644 --- a/tools/log.sh +++ b/tools/log.sh @@ -1,21 +1,18 @@ -#!/bin/sh +#!/bin/bash set -e -u CASENAME="$(pwd | xargs basename)" -export CASENAME +LOGFILE="$CASENAME.log" +export LOGFILE STARTDATE="$(date --rfc-email)" STARTTIME="$(date +%s)" echo "Started on: $STARTDATE" | tee "$CASENAME.log" 2>&1 -log() { - "$@" | tee --append "$CASENAME.log" 2>&1 -} - close_log() { - echo "Started on: $STARTDATE" | tee --append "$CASENAME.log" 2>&1 + echo "Started on: $STARTDATE" | tee --append "$LOGFILE" 2>&1 ENDDATE="$(date --rfc-email)" ENDTIME="$(date +%s)" - echo "Finished on: $ENDDATE" | tee --append "$CASENAME.log" 2>&1 - echo "Duration: $((ENDTIME-STARTTIME)) seconds (wall-clock time, including time waiting for participants)" | tee --append "$CASENAME.log" 2>&1 + 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/turek-hron-fsi3/fluid-openfoam/run.sh b/turek-hron-fsi3/fluid-openfoam/run.sh index 864ca8c26..da82a9ba2 100755 --- a/turek-hron-fsi3/fluid-openfoam/run.sh +++ b/turek-hron-fsi3/fluid-openfoam/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh +blockMesh -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 22671307e..920352b8d 100755 --- a/two-scale-heat-conduction/macro-dumux/run.sh +++ b/two-scale-heat-conduction/macro-dumux/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log ./macro_dumux params.input +./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 c37669008..5ae6ac050 100755 --- a/two-scale-heat-conduction/macro-nutils/run.sh +++ b/two-scale-heat-conduction/macro-nutils/run.sh @@ -1,11 +1,12 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 -m venv .venv -log . .venv/bin/activate -log pip install -r requirements.txt -log python3 macro.py richoutput=no +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 48ffd12bd..7b739e57e 100755 --- a/two-scale-heat-conduction/micro-dumux/run.sh +++ b/two-scale-heat-conduction/micro-dumux/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh @@ -7,20 +7,20 @@ usage() { echo "Usage: cmd [-s] [-p n]" 1>&2; exit 1; } # Check if no input argument was provided if [ -z "$*" ] ; then - log echo "No input argument provided. Micro Manager is launched in serial" - log 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 case ${opt} in s) - log python3 run_micro_manager.py params.input + python3 run_micro_manager.py params.input ;; p) - log mpiexec -n "$2" python3 run_micro_manager.py params.input + mpiexec -n "$2" python3 run_micro_manager.py params.input ;; *) - log usage + usage ;; esac done diff --git a/two-scale-heat-conduction/micro-nutils/run.sh b/two-scale-heat-conduction/micro-nutils/run.sh index d3ab76305..0b9846c86 100755 --- a/two-scale-heat-conduction/micro-nutils/run.sh +++ b/two-scale-heat-conduction/micro-nutils/run.sh @@ -1,30 +1,30 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh usage() { echo "Usage: cmd [-s] [-p n]" 1>&2; exit 1; } -log python3 -m venv .venv -log . .venv/bin/activate -log pip install -r requirements.txt +python3 -m venv .venv +. .venv/bin/activate +pip install -r requirements.txt # Check if no input argument was provided if [ -z "$*" ] ; then - log echo "No input argument provided. Micro Manager is launched in serial" - log python3 run-micro-problems.py + echo "No input argument provided. Micro Manager is launched in serial" + python3 run-micro-problems.py fi while getopts ":sp" opt; do case ${opt} in s) - log python3 run-micro-problems.py + python3 run-micro-problems.py ;; p) - log mpiexec -n "$2" python3 run-micro-problems.py + mpiexec -n "$2" python3 run-micro-problems.py ;; *) - log usage + usage ;; esac done diff --git a/volume-coupled-diffusion/fenics/run.sh b/volume-coupled-diffusion/fenics/run.sh index 98cc73f65..213c47471 100755 --- a/volume-coupled-diffusion/fenics/run.sh +++ b/volume-coupled-diffusion/fenics/run.sh @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh @@ -7,20 +7,20 @@ usage() { echo "Usage: cmd [-s] [-d]" 1>&2; exit 1; } # Check if no input argument was provided if [ -z "$*" ] ; then - log usage + usage fi # Select appropriate case while getopts ":sd" opt; do case ${opt} in s) - log python3 volume-coupled-diffusion.py --source + python3 volume-coupled-diffusion.py --source ;; d) - log python3 volume-coupled-diffusion.py --drain + python3 volume-coupled-diffusion.py --drain ;; *) - log usage + usage ;; esac done diff --git a/volume-coupled-flow/fluid-openfoam/run.sh b/volume-coupled-flow/fluid-openfoam/run.sh index 4c61a814c..75b56f415 100755 --- a/volume-coupled-flow/fluid-openfoam/run.sh +++ b/volume-coupled-flow/fluid-openfoam/run.sh @@ -1,12 +1,13 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log blockMesh -log topoSet +blockMesh +topoSet -log ../../tools/run-openfoam.sh "$@" -. ../../tools/openfoam-remove-empty-dirs.sh && log openfoam_remove_empty_dirs +../../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 39c1fb74b..716fe373b 100755 --- a/volume-coupled-flow/source-nutils/run.sh +++ b/volume-coupled-flow/source-nutils/run.sh @@ -1,8 +1,9 @@ -#!/bin/sh +#!/bin/bash set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 -log python3 source.py +python3 source.py close_log From 48d76dc9710c76a8fc013d460523326d82bc2baf Mon Sep 17 00:00:00 2001 From: Gerasimos Chourdakis Date: Wed, 20 Mar 2024 16:25:09 +0100 Subject: [PATCH 17/17] Port more cases --- elastic-tube-1d/fluid-cpp/run.sh | 1 + elastic-tube-1d/solid-cpp/run.sh | 1 + elastic-tube-3d/fluid-openfoam/run.sh | 1 + elastic-tube-3d/solid-calculix/run.sh | 1 + flow-around-controlled-moving-cylinder/controller-fmi/run.sh | 1 + heat-exchanger/solid-calculix/run.sh | 1 + oscillator/fmi/run.sh | 1 + oscillator/python/run.sh | 1 + partitioned-elastic-beam/dirichlet-calculix/run.sh | 1 + partitioned-elastic-beam/neumann-calculix/run.sh | 1 + partitioned-heat-conduction-direct/nutils/run.sh | 1 + partitioned-heat-conduction/dirichlet-openfoam/run.sh | 2 +- partitioned-heat-conduction/fenicsx/run.sh | 1 + partitioned-pipe/fluid1-openfoam-pimplefoam/run.sh | 1 + partitioned-pipe/fluid2-openfoam-pimplefoam/run.sh | 1 + perpendicular-flap/fluid-su2/run.sh | 1 + perpendicular-flap/solid-calculix/run.sh | 1 + two-scale-heat-conduction/micro-dumux/run.sh | 1 + two-scale-heat-conduction/micro-nutils/run.sh | 1 + volume-coupled-diffusion/fenics/run.sh | 1 + 20 files changed, 20 insertions(+), 1 deletion(-) diff --git a/elastic-tube-1d/fluid-cpp/run.sh b/elastic-tube-1d/fluid-cpp/run.sh index e99dd09e5..0e005451e 100755 --- a/elastic-tube-1d/fluid-cpp/run.sh +++ b/elastic-tube-1d/fluid-cpp/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 if [ ! -d build ]; then mkdir build diff --git a/elastic-tube-1d/solid-cpp/run.sh b/elastic-tube-1d/solid-cpp/run.sh index 84261afbc..fe674287d 100755 --- a/elastic-tube-1d/solid-cpp/run.sh +++ b/elastic-tube-1d/solid-cpp/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 if [ ! -d build ]; then mkdir build diff --git a/elastic-tube-3d/fluid-openfoam/run.sh b/elastic-tube-3d/fluid-openfoam/run.sh index 114671a2d..9d072bcda 100755 --- a/elastic-tube-3d/fluid-openfoam/run.sh +++ b/elastic-tube-3d/fluid-openfoam/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 cp -r constant/polyMesh.orig constant/polyMesh diff --git a/elastic-tube-3d/solid-calculix/run.sh b/elastic-tube-3d/solid-calculix/run.sh index a5925b868..6e8b5a83f 100755 --- a/elastic-tube-3d/solid-calculix/run.sh +++ b/elastic-tube-3d/solid-calculix/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 export OMP_NUM_THREADS=1 export CCX_NPROC_EQUATION_SOLVER=1 diff --git a/flow-around-controlled-moving-cylinder/controller-fmi/run.sh b/flow-around-controlled-moving-cylinder/controller-fmi/run.sh index 9827e49c9..46a4f217d 100755 --- a/flow-around-controlled-moving-cylinder/controller-fmi/run.sh +++ b/flow-around-controlled-moving-cylinder/controller-fmi/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 if [ ! -f PIDcontroller.fmu ]; then cd fmu diff --git a/heat-exchanger/solid-calculix/run.sh b/heat-exchanger/solid-calculix/run.sh index c57ccc311..f1f5b3aef 100755 --- a/heat-exchanger/solid-calculix/run.sh +++ b/heat-exchanger/solid-calculix/run.sh @@ -2,6 +2,7 @@ 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." diff --git a/oscillator/fmi/run.sh b/oscillator/fmi/run.sh index 8e6fbfbe5..7928ee03f 100755 --- a/oscillator/fmi/run.sh +++ b/oscillator/fmi/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 usage() { echo "Usage: cmd [-l] [-r]" 1>&2; exit 1; } diff --git a/oscillator/python/run.sh b/oscillator/python/run.sh index 3e4fb0209..fdc19ba4b 100755 --- a/oscillator/python/run.sh +++ b/oscillator/python/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 usage() { echo "Usage: cmd [-l] [-r]" 1>&2; exit 1; } diff --git a/partitioned-elastic-beam/dirichlet-calculix/run.sh b/partitioned-elastic-beam/dirichlet-calculix/run.sh index d0a6bac87..a7266841a 100755 --- a/partitioned-elastic-beam/dirichlet-calculix/run.sh +++ b/partitioned-elastic-beam/dirichlet-calculix/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 export OMP_NUM_THREADS=1 export CCX_NPROC_EQUATION_SOLVER=1 diff --git a/partitioned-elastic-beam/neumann-calculix/run.sh b/partitioned-elastic-beam/neumann-calculix/run.sh index bbc7ecfe6..b8dfea3d6 100755 --- a/partitioned-elastic-beam/neumann-calculix/run.sh +++ b/partitioned-elastic-beam/neumann-calculix/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 export OMP_NUM_THREADS=1 export CCX_NPROC_EQUATION_SOLVER=1 diff --git a/partitioned-heat-conduction-direct/nutils/run.sh b/partitioned-heat-conduction-direct/nutils/run.sh index b6d8dc781..ae66a8256 100755 --- a/partitioned-heat-conduction-direct/nutils/run.sh +++ b/partitioned-heat-conduction-direct/nutils/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 usage() { echo "Usage: cmd [-d] [-n]" 1>&2; exit 1; } diff --git a/partitioned-heat-conduction/dirichlet-openfoam/run.sh b/partitioned-heat-conduction/dirichlet-openfoam/run.sh index c71f80da2..e75dacd3d 100755 --- a/partitioned-heat-conduction/dirichlet-openfoam/run.sh +++ b/partitioned-heat-conduction/dirichlet-openfoam/run.sh @@ -2,7 +2,7 @@ set -e -u . ../../tools/log.sh - +exec > >(tee --append "$LOGFILE") 2>&1 blockMesh ./setInitialField.sh diff --git a/partitioned-heat-conduction/fenicsx/run.sh b/partitioned-heat-conduction/fenicsx/run.sh index 948a4f66b..c4cf97cc4 100755 --- a/partitioned-heat-conduction/fenicsx/run.sh +++ b/partitioned-heat-conduction/fenicsx/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 while getopts ":dn" opt; do case ${opt} in diff --git a/partitioned-pipe/fluid1-openfoam-pimplefoam/run.sh b/partitioned-pipe/fluid1-openfoam-pimplefoam/run.sh index 33ff84014..198f58108 100755 --- a/partitioned-pipe/fluid1-openfoam-pimplefoam/run.sh +++ b/partitioned-pipe/fluid1-openfoam-pimplefoam/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 use_skewed=false diff --git a/partitioned-pipe/fluid2-openfoam-pimplefoam/run.sh b/partitioned-pipe/fluid2-openfoam-pimplefoam/run.sh index 33ff84014..198f58108 100755 --- a/partitioned-pipe/fluid2-openfoam-pimplefoam/run.sh +++ b/partitioned-pipe/fluid2-openfoam-pimplefoam/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 use_skewed=false diff --git a/perpendicular-flap/fluid-su2/run.sh b/perpendicular-flap/fluid-su2/run.sh index 4b7eda062..529a74f75 100755 --- a/perpendicular-flap/fluid-su2/run.sh +++ b/perpendicular-flap/fluid-su2/run.sh @@ -2,6 +2,7 @@ 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 diff --git a/perpendicular-flap/solid-calculix/run.sh b/perpendicular-flap/solid-calculix/run.sh index fd38f4581..1954b6584 100755 --- a/perpendicular-flap/solid-calculix/run.sh +++ b/perpendicular-flap/solid-calculix/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 usage() { echo "Usage: run.sh [-modal]" 1>&2; exit 1; } diff --git a/two-scale-heat-conduction/micro-dumux/run.sh b/two-scale-heat-conduction/micro-dumux/run.sh index 7b739e57e..7ce4c9a0b 100755 --- a/two-scale-heat-conduction/micro-dumux/run.sh +++ b/two-scale-heat-conduction/micro-dumux/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 usage() { echo "Usage: cmd [-s] [-p n]" 1>&2; exit 1; } diff --git a/two-scale-heat-conduction/micro-nutils/run.sh b/two-scale-heat-conduction/micro-nutils/run.sh index 0b9846c86..49d74d2ce 100755 --- a/two-scale-heat-conduction/micro-nutils/run.sh +++ b/two-scale-heat-conduction/micro-nutils/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 usage() { echo "Usage: cmd [-s] [-p n]" 1>&2; exit 1; } diff --git a/volume-coupled-diffusion/fenics/run.sh b/volume-coupled-diffusion/fenics/run.sh index 213c47471..b894cafeb 100755 --- a/volume-coupled-diffusion/fenics/run.sh +++ b/volume-coupled-diffusion/fenics/run.sh @@ -2,6 +2,7 @@ set -e -u . ../../tools/log.sh +exec > >(tee --append "$LOGFILE") 2>&1 usage() { echo "Usage: cmd [-s] [-d]" 1>&2; exit 1; }