Skip to content
Snippets Groups Projects
Commit 16ef46f6 authored by laurence's avatar laurence
Browse files

ENH: foamRunTutorials: Enable Alltest files to be read as well as Allrun

foamRunTutorials now accepts two arguments:
-test : Preferentially execute Alltest, if present, over Allrun.
-skipFirst : Skip Alltest/Allrun at the top level to prevent recursion

Added because some tutorials are not dependent on controlDict and take
a long time.
parent 0953846f
Branches
Tags
No related merge requests found
......@@ -37,6 +37,8 @@
# normally use "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" ]
......@@ -73,8 +75,32 @@ then
thisScript="$PWD/$thisScript"
fi
# parse options
while [ "$#" -gt 0 ]
do
case "$1" in
-t | -test)
runTests=true
shift
;;
-s | -skipFirst)
skipFirst=true
shift
;;
*)
break
;;
esac
done
# If an argument is supplied do not execute ./Allrun to avoid recursion
if [ $# = 0 -a -f "./Allrun" ]
if ! $skipFirst && $runTests && [ -f "./Alltest" ]
then
# Run a special test script.
./Alltest
elif ! $skipFirst && [ -f "./Allrun" ]
then
# Specialised script.
./Allrun
......@@ -104,7 +130,10 @@ 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"
$make -k -f $WM_PROJECT_DIR/bin/tools/MakefileDirs FOAM_TARGETS="$FOAM_TARGETS" FOAM_APP="$thisScript"
passArgs=$(if $runTests; then echo "-test"; fi)
$make -k -f $WM_PROJECT_DIR/bin/tools/MakefileDirs FOAM_TARGETS="$FOAM_TARGETS" FOAM_APP="$thisScript" FOAM_ARGS="$passArgs"
fi
#------------------------------------------------------------------------------
......@@ -36,7 +36,7 @@
application: $(FOAM_TARGETS)
$(FOAM_TARGETS):
+@(cd $@ && $(FOAM_APP))
+@(cd $@ && $(FOAM_APP) $(FOAM_ARGS))
#------------------------------------------------------------------------------
......@@ -68,7 +68,7 @@ logReport()
# Recursively run all tutorials
foamRunTutorials cases
foamRunTutorials -test -skipFirst
# Analyse all log files
......
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication cvMesh
# Change collapseEdges to only do one iteration
cp system/collapseDict system/collapseDict.org
sed -e s/"\(maximumIterations[ \t]*\)\([0-9]*\);"/"\1 1;"/g \
system/collapseDict.org > system/collapseDict
runApplication collapseEdges -latestTime -collapseFaces
# ----------------------------------------------------------------- end-of-file
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
runApplication surfaceFeatureExtract
# Create tight-fitting background mesh
runApplication blockMesh
runApplication cvMesh
# Change collapseEdges to only do one iteration
cp system/collapseDict system/collapseDict.org
sed -e s/"\(maximumIterations[ \t]*\)\([0-9]*\);"/"\1 1;"/g \
system/collapseDict.org > system/collapseDict
runApplication collapseEdges -latestTime -collapseFaces
# ----------------------------------------------------------------- end-of-file
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