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

View file

@ -0,0 +1,27 @@
#! /bin/sh
# Cleaning up stray functionObjectProperties files, see https://github.com/precice/openfoam-adapter/issues/26
openfoam_remove_empty_dirs() {
(
set -e -u
echo "Cleaning up any time directories without results"
for f in [0-9]* [0-9]*.[0-9]*; do
if ! [ -f "${f}/U" ] && ! [ -f "${f}/T" ] && ! [ -f "${f}/U.gz" ] && ! [ -f "${f}/T.gz" ] && ! [ -f "${f}/D" ] && ! [ -f "${f}/pointD" ] && ! [ -f "${f}/DD" ] && ! [ -f "${f}/pointDD" ] && ! [ -f "${f}/D.gz" ] && ! [ -f "${f}/pointD.gz" ] && ! [ -f "${f}/DD.gz" ] && ! [ -f "${f}/pointDD.gz" ]; then
rm -rf "${f}"
fi
done
if [ -d processor0 ]; then
for d in processor*; do
cd "${d}"
for f in [0-9]* [0-9]*.[0-9]*; do
if ! [ -f "${f}/U" ] && ! [ -f "${f}/T" ] && ! [ -f "${f}/U.gz" ] && ! [ -f "${f}/T.gz" ] && ! [ -f "${f}/D" ] && ! [ -f "${f}/pointD" ] && ! [ -f "${f}/DD" ] && ! [ -f "${f}/pointDD" ] && ! [ -f "${f}/D.gz" ] && ! [ -f "${f}/pointD.gz" ] && ! [ -f "${f}/DD.gz" ] && ! [ -f "${f}/pointDD.gz" ]; then
rm -rf "${f}"
fi
done
cd ..
done
fi
echo "Done."
)
}