copied from preCICE tutorials

This commit is contained in:
jakob.schratter 2026-01-26 16:14:46 +01:00
commit 3f1b1a6d0f
68 changed files with 156449 additions and 0 deletions

19
preCICE_tools/run-openfoam.sh Executable file
View file

@ -0,0 +1,19 @@
#!/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"
solver=$(getApplication)
if [ "${1:-}" = "-parallel" ]; then
procs=$(getNumberOfProcessors)
decomposePar -force
mpirun -np "${procs}" "${solver}" -parallel
reconstructPar
else
${solver}
fi