Commit 603b513b authored by Henry Weller's avatar Henry Weller
Browse files

foamRunTutorials: Removed redundant code and simplified

parent 51442e15
......@@ -26,47 +26,15 @@
# foamRunTutorials
#
# Description
# Run either Allrun or blockMesh/application in current directory
# and all its subdirectories.
# Run either Allrun or blockMesh/application in current directory
# and all its subdirectories.
#
#------------------------------------------------------------------------------
#------------------------------------------------------------------------------
# Select the version of make to be used
#------------------------------------------------------------------------------
# normally use "make"
# Normally use standard "make"
make="make"
runTests=false
skipFirst=false
## set WM_NCOMPPROCS automatically when both WM_HOSTS and WM_SCHEDULER are set
#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
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
thisScript=$0
......@@ -75,13 +43,14 @@ then
thisScript="$PWD/$thisScript"
fi
skipFirst=false
# parse options
# Parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-t | -test)
runTests=true
passArgs="-test"
shift
;;
-s | -skipFirst)
......@@ -94,20 +63,14 @@ do
esac
done
passArgs=$(if $runTests; then echo "-test"; fi)
# If an argument is supplied do not execute ./Allrun to avoid recursion
if ! $skipFirst && $runTests && [ -f "./Alltest" ]
then
# Run a special test script.
./Alltest $passArgs
elif ! $skipFirst && [ -f "./Allrun" ]
if ! $skipFirst && [ -f "./Allrun" ]
then
# Specialised script.
# Run specialised Allrun script.
./Allrun $passArgs
elif [ -d system ]
then
# Normal case.
# Run normal case.
parentDir=`dirname $PWD`
application=`getApplication`
runApplication blockMesh
......@@ -123,10 +86,7 @@ else
done
FOAM_TARGETS=$(for d in *; do [ -d "$d" ] && echo "$d"; done | xargs)
#$make -k -f $WM_PROJECT_DIR/bin/tools/MakefileDirs \
# FOAM_TARGETS="$FOAM_TARGETS" \
# FOAM_APP="$WM_SCHEDULER $thisScript" FOAM_ARGS="$passArgs"
# Run all cases which have not already been run
$make -k -f $WM_PROJECT_DIR/bin/tools/MakefileDirs \
FOAM_TARGETS="$FOAM_TARGETS" \
FOAM_APP="$thisScript" FOAM_ARGS="$passArgs"
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment