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 54 55 56 57 58 59 60 61 62 63 64
|
#!/bin/sh
cd ${0%/*} || exit 1 # Run from this directory
. $WM_PROJECT_DIR/bin/tools/RunFunctions # Tutorial run functions
# 1) Run meshing
# 2) Reconstruct
# 3) Test input zones and movement
#
# linkParallelCase srcDir dstDir
#
linkParallelCase()
{
local src=$1
local dst=$2
shift 2
if [ -e "$dst" ]
then
echo "Case already linked: remove case directory $dst prior to linking"
return 1
elif [ ! -d "$src" ]
then
echo "Error: no directory to link: $src"
return 1
fi
echo "Linking $dst parallel case from $src"
mkdir $dst
# Copy system - may wish to change things
for i in system 0
do
echo " copy $i/"
( cd $dst && cp -r ../$src/$i . )
done
echo " link constant/"
( cd $dst && ln -sf ../$src/constant . )
echo " link processor*/ with $# times: $@"
for proc in $(cd $src && \ls -d processor*)
do
( cd $dst && ln -sf ../$src/$proc . )
done
return 0
}
# Do steady-state case
(cd steady && ./Allrun.pre)
if notTest $@
then
# Copy/link the steady-state case to movement
linkParallelCase steady movement
# Test movement
\cp files/Allrun.movement movement/Allrun
(cd movement && foamRunTutorials)
fi
#------------------------------------------------------------------------------
|