foamRunTutorials: Removed redundant code and simplified
This commit is contained in:
@ -26,47 +26,15 @@
|
|||||||
# foamRunTutorials
|
# foamRunTutorials
|
||||||
#
|
#
|
||||||
# Description
|
# Description
|
||||||
# Run either Allrun or blockMesh/application in current directory
|
# Run either Allrun or blockMesh/application in current directory
|
||||||
# and all its subdirectories.
|
# and all its subdirectories.
|
||||||
#
|
#
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
# Normally use standard "make"
|
||||||
# Select the version of make to be used
|
|
||||||
#------------------------------------------------------------------------------
|
|
||||||
|
|
||||||
# normally use "make"
|
|
||||||
make="make"
|
make="make"
|
||||||
runTests=false
|
|
||||||
skipFirst=false
|
|
||||||
|
|
||||||
## set WM_NCOMPPROCS automatically when both WM_HOSTS and WM_SCHEDULER are set
|
# Source tutorial run functions
|
||||||
#if [ -z "$WM_NCOMPPROCS" -a -n "$WM_HOSTS" -a -n "$WM_SCHEDULER" ]
|
|
||||||
#then
|
|
||||||
# WM_NCOMPPROCS=$(wmakeScheduler -count)
|
|
||||||
# [ $? -eq 0 ] || unset WM_NCOMPPROCS
|
|
||||||
#fi
|
|
||||||
#
|
|
||||||
#if [ "$WM_NCOMPPROCS" ]
|
|
||||||
#then
|
|
||||||
# if [ "$WM_NCOMPPROCS" -gt 1 -a ! "$MAKEFLAGS" ]
|
|
||||||
# then
|
|
||||||
# lockDir=$HOME/.$WM_PROJECT/.wmake
|
|
||||||
#
|
|
||||||
# if [ -d $lockDir ]
|
|
||||||
# then
|
|
||||||
# rm -f $lockDir/*
|
|
||||||
# else
|
|
||||||
# mkdir -p $lockDir
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# make="make --no-print-directory -j "$WM_NCOMPPROCS
|
|
||||||
# fi
|
|
||||||
#fi
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# Source tutorial functions
|
|
||||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||||
|
|
||||||
thisScript=$0
|
thisScript=$0
|
||||||
@ -75,13 +43,14 @@ then
|
|||||||
thisScript="$PWD/$thisScript"
|
thisScript="$PWD/$thisScript"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
skipFirst=false
|
||||||
|
|
||||||
# parse options
|
# Parse options
|
||||||
while [ "$#" -gt 0 ]
|
while [ "$#" -gt 0 ]
|
||||||
do
|
do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
-t | -test)
|
-t | -test)
|
||||||
runTests=true
|
passArgs="-test"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
-s | -skipFirst)
|
-s | -skipFirst)
|
||||||
@ -94,20 +63,14 @@ do
|
|||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
|
|
||||||
passArgs=$(if $runTests; then echo "-test"; fi)
|
|
||||||
|
|
||||||
# If an argument is supplied do not execute ./Allrun to avoid recursion
|
# If an argument is supplied do not execute ./Allrun to avoid recursion
|
||||||
if ! $skipFirst && $runTests && [ -f "./Alltest" ]
|
if ! $skipFirst && [ -f "./Allrun" ]
|
||||||
then
|
then
|
||||||
# Run a special test script.
|
# Run specialised Allrun script.
|
||||||
./Alltest $passArgs
|
|
||||||
elif ! $skipFirst && [ -f "./Allrun" ]
|
|
||||||
then
|
|
||||||
# Specialised script.
|
|
||||||
./Allrun $passArgs
|
./Allrun $passArgs
|
||||||
elif [ -d system ]
|
elif [ -d system ]
|
||||||
then
|
then
|
||||||
# Normal case.
|
# Run normal case.
|
||||||
parentDir=`dirname $PWD`
|
parentDir=`dirname $PWD`
|
||||||
application=`getApplication`
|
application=`getApplication`
|
||||||
runApplication blockMesh
|
runApplication blockMesh
|
||||||
@ -123,10 +86,7 @@ else
|
|||||||
done
|
done
|
||||||
FOAM_TARGETS=$(for d in *; do [ -d "$d" ] && echo "$d"; done | xargs)
|
FOAM_TARGETS=$(for d in *; do [ -d "$d" ] && echo "$d"; done | xargs)
|
||||||
|
|
||||||
#$make -k -f $WM_PROJECT_DIR/bin/tools/MakefileDirs \
|
# Run all cases which have not already been run
|
||||||
# FOAM_TARGETS="$FOAM_TARGETS" \
|
|
||||||
# FOAM_APP="$WM_SCHEDULER $thisScript" FOAM_ARGS="$passArgs"
|
|
||||||
|
|
||||||
$make -k -f $WM_PROJECT_DIR/bin/tools/MakefileDirs \
|
$make -k -f $WM_PROJECT_DIR/bin/tools/MakefileDirs \
|
||||||
FOAM_TARGETS="$FOAM_TARGETS" \
|
FOAM_TARGETS="$FOAM_TARGETS" \
|
||||||
FOAM_APP="$thisScript" FOAM_ARGS="$passArgs"
|
FOAM_APP="$thisScript" FOAM_ARGS="$passArgs"
|
||||||
|
|||||||
Reference in New Issue
Block a user