copied from preCICE tutorials
This commit is contained in:
parent
46a7e98752
commit
3f1b1a6d0f
68 changed files with 156449 additions and 0 deletions
19
preCICE_tools/run-openfoam.sh
Executable file
19
preCICE_tools/run-openfoam.sh
Executable 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue