TUT: fix mesh/parallel/cavity for Alltest mode

- use foamListTimes instead of hard-coded time to track the
  redistribution point. Still slightly fragile...
This commit is contained in:
Mark Olesen
2024-01-18 11:20:52 +01:00
parent 7b7dde0a6d
commit 81f0620b7b
2 changed files with 19 additions and 7 deletions

View File

@ -25,16 +25,27 @@ runParallel -s random icoFoam $fileHandler
# Pick up last result
cp system/controlDict-latestTime system/controlDict
# Redistribute to 5 processors. Note that new processors only get written
# a mesh to the current time (0.505). Use -overwrite instead to write the
# mesh to constant.
# Redistribute to 5 processors.
# Note that new processors only get written with a mesh at the current time.
# Use -overwrite instead to write the mesh to constant
runParallel -s 5 $decompDict5 redistributePar -cellDist $fileHandler
latestTime=$(foamListTimes -processor -latestTime)
echo "New mesh distribution. Time = $latestTime"
# Run a bit more
runParallel -s 5 $decompDict5 icoFoam $fileHandler
# Reconstruct mesh and results. Note the time argument to make sure we
# only pick up the new decomposition
runParallel -s reconstruct -np 5 redistributePar -reconstruct -time 0.505: $fileHandler
# Reconstruct mesh and results.
# The time argument to make sure we only pick up the new decomposition
if [ -n "$latestTime" ]
then
runParallel -s reconstruct -np 5 redistributePar -reconstruct \
-time "${latestTime}:" $fileHandler
else
runParallel -s reconstruct -np 5 redistributePar -reconstruct \
-latestTime $fileHandler
fi
#------------------------------------------------------------------------------