File size: 1,476 Bytes
5a600cf | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 | #!/bin/bash
cd ${0%/*} || exit 1 # Run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Get the serial/parallel mode
! isTest "$@" && [ -n "$1" ] && mode=$1 || mode=serial
case $mode in
serial)
./Allmesh serial
runApplication foamMultiRun
;;
parallel | stitchSerial)
./Allmesh serial
# Decompose the meshes and fields
runApplication decomposePar -allRegions
for meshDir in constant/meshes/*
do
runApplication -a decomposePar -mesh "$(basename "$meshDir")" \
-region fluid
done
runParallel foamMultiRun
runApplication reconstructPar -allRegions
;;
stitchParallel)
./Allmesh parallel
# Reconstruct the mesh and then decompose the fields
#
# !!! Note: We could do decomposePar -copyZero here instead if the
# field files were set up with boundary conditions for the processor
# and nonConformalProcessorCyclic patch groups
#
runApplication reconstructPar -allRegions -noFields -constant
runApplication -a decomposePar -allRegions -fields
runParallel foamMultiRun
runApplication -a reconstructPar -allRegions
;;
*)
echo "Error: mode $mode not recognised"
exit 1
;;
esac
#------------------------------------------------------------------------------
|