Newer
Older
cd "${0%/*}" || exit # Run from this directory
. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions # Tutorial run functions
#------------------------------------------------------------------------------
decompDict5="-decomposeParDict system/decomposeParDict.5"
Mattijs Janssens
committed
fileHandler="-fileHandler uncollated"
Mattijs Janssens
committed
runParallel -s decompose redistributePar -decompose $fileHandler
Mattijs Janssens
committed
runParallel -s CuthillMcKee renumberMesh -overwrite $fileHandler
runParallel -s CuthillMcKee icoFoam $fileHandler
runParallel -s random renumberMesh -renumber-method random -overwrite $fileHandler
Mattijs Janssens
committed
runParallel -s random icoFoam $fileHandler
cp system/controlDict-latestTime system/controlDict
# 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
Mattijs Janssens
committed
runParallel -s 5 $decompDict5 redistributePar -cellDist $fileHandler
latestTime=$(foamListTimes -processor -latestTime)
echo "New mesh distribution. Time = $latestTime"
Mattijs Janssens
committed
runParallel -s 5 $decompDict5 icoFoam $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
#------------------------------------------------------------------------------