diff --git a/bin/foamRunTutorials b/bin/foamRunTutorials index a2c33cfb8..8f2325808 100755 --- a/bin/foamRunTutorials +++ b/bin/foamRunTutorials @@ -3,7 +3,7 @@ # ========= | # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox # \\ / O peration | -# \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation +# \\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation # \\/ M anipulation | #------------------------------------------------------------------------------ # License @@ -94,16 +94,17 @@ 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 + ./Alltest $passArgs elif ! $skipFirst && [ -f "./Allrun" ] then # Specialised script. - ./Allrun + ./Allrun $passArgs elif [ -d system ] then # Normal case. @@ -120,20 +121,15 @@ else ( compileApplication $caseName ) fi done - # Recurse to subdirectories - #for caseName in * - #do - # if [ -d $caseName ] - # then - # ( cd $caseName && $thisScript ) - # fi - #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" - passArgs=$(if $runTests; then echo "-test"; fi) + #$make -k -f $WM_PROJECT_DIR/bin/tools/MakefileDirs \ + # FOAM_TARGETS="$FOAM_TARGETS" \ + # FOAM_APP="$WM_SCHEDULER $thisScript" FOAM_ARGS="$passArgs" - $make -k -f $WM_PROJECT_DIR/bin/tools/MakefileDirs FOAM_TARGETS="$FOAM_TARGETS" FOAM_APP="$thisScript" FOAM_ARGS="$passArgs" + $make -k -f $WM_PROJECT_DIR/bin/tools/MakefileDirs \ + FOAM_TARGETS="$FOAM_TARGETS" \ + FOAM_APP="$thisScript" FOAM_ARGS="$passArgs" fi #------------------------------------------------------------------------------ diff --git a/bin/tools/RunFunctions b/bin/tools/RunFunctions index b9240bb1a..3c074c726 100644 --- a/bin/tools/RunFunctions +++ b/bin/tools/RunFunctions @@ -28,6 +28,17 @@ # Miscellaneous functions for running tutorial cases #------------------------------------------------------------------------------ +isTest() +{ + for i in "$@"; do + if [ "$i" = "-test" ] + then + return 0 + fi + done + return 1 +} + getNumberOfProcessors() { expandDictionary system/decomposeParDict \ diff --git a/tutorials/combustion/chemFoam/gri/Allrun b/tutorials/combustion/chemFoam/gri/Allrun index 8bc8e4c07..82ff17fe5 100755 --- a/tutorials/combustion/chemFoam/gri/Allrun +++ b/tutorials/combustion/chemFoam/gri/Allrun @@ -9,7 +9,6 @@ application=`getApplication` runApplication $application -(cd validation && ./Allrun) +(cd validation && ./Allrun $*) # ----------------------------------------------------------------- end-of-file - diff --git a/tutorials/combustion/chemFoam/h2/Allrun b/tutorials/combustion/chemFoam/h2/Allrun index 8bc8e4c07..82ff17fe5 100755 --- a/tutorials/combustion/chemFoam/h2/Allrun +++ b/tutorials/combustion/chemFoam/h2/Allrun @@ -9,7 +9,6 @@ application=`getApplication` runApplication $application -(cd validation && ./Allrun) +(cd validation && ./Allrun $*) # ----------------------------------------------------------------- end-of-file - diff --git a/tutorials/combustion/chemFoam/ic8h18/Allrun b/tutorials/combustion/chemFoam/ic8h18/Allrun index 8bc8e4c07..82ff17fe5 100755 --- a/tutorials/combustion/chemFoam/ic8h18/Allrun +++ b/tutorials/combustion/chemFoam/ic8h18/Allrun @@ -9,7 +9,6 @@ application=`getApplication` runApplication $application -(cd validation && ./Allrun) +(cd validation && ./Allrun $*) # ----------------------------------------------------------------- end-of-file - diff --git a/tutorials/combustion/chemFoam/nc7h16/Allrun b/tutorials/combustion/chemFoam/nc7h16/Allrun index 8bc8e4c07..82ff17fe5 100755 --- a/tutorials/combustion/chemFoam/nc7h16/Allrun +++ b/tutorials/combustion/chemFoam/nc7h16/Allrun @@ -9,7 +9,6 @@ application=`getApplication` runApplication $application -(cd validation && ./Allrun) +(cd validation && ./Allrun $*) # ----------------------------------------------------------------- end-of-file - diff --git a/tutorials/incompressible/pisoFoam/les/motorBike/Allrun b/tutorials/incompressible/pisoFoam/les/motorBike/Allrun index ebba3c5ff..cc5a57896 100755 --- a/tutorials/incompressible/pisoFoam/les/motorBike/Allrun +++ b/tutorials/incompressible/pisoFoam/les/motorBike/Allrun @@ -25,11 +25,14 @@ cloneParallelCase() # Do the Spalart-Allmaras steady-state case (cd motorBike && foamRunTutorials) -# Clone the steady-state case to the LES case -cloneParallelCase motorBike motorBikeLES +if ! isTest $@ +then + # Clone the steady-state case to the LES case + cloneParallelCase motorBike motorBikeLES -# Do the LES case -cp lesFiles/Allrun motorBikeLES/ -(cd motorBikeLES && foamRunTutorials) + # Do the LES case + cp lesFiles/Allrun motorBikeLES/ + (cd motorBikeLES && foamRunTutorials) +fi # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/pisoFoam/les/motorBike/Alltest b/tutorials/incompressible/pisoFoam/les/motorBike/Alltest deleted file mode 100755 index 97e6f4816..000000000 --- a/tutorials/incompressible/pisoFoam/les/motorBike/Alltest +++ /dev/null @@ -1,10 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory - -# Source tutorial run functions -. $WM_PROJECT_DIR/bin/tools/RunFunctions - -# Do the Spalart-Allmaras steady-state case -(cd motorBike && foamRunTutorials) - -# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/Allrun b/tutorials/incompressible/simpleFoam/turbineSiting/Allrun index 310b8184e..702759237 100755 --- a/tutorials/incompressible/simpleFoam/turbineSiting/Allrun +++ b/tutorials/incompressible/simpleFoam/turbineSiting/Allrun @@ -16,7 +16,7 @@ runParallel snappyHexMesh -overwrite find . -type f -iname "*level*" -exec rm {} \; -ls -d processor* | xargs -I {} cp -r 0.org ./{}/0 $1 +ls -d processor* | xargs -I {} cp -r 0.org ./{}/0 runParallel topoSet runParallel `getApplication` diff --git a/tutorials/mesh/foamyHexMesh/Allrun b/tutorials/mesh/foamyHexMesh/Allrun index e33b67e64..5a6e534cb 100755 --- a/tutorials/mesh/foamyHexMesh/Allrun +++ b/tutorials/mesh/foamyHexMesh/Allrun @@ -1,29 +1,32 @@ #!/bin/sh cd ${0%/*} || exit 1 # Run from this directory +# Any cases that are links to solver test cases and are run when the Allrun +# scripts of those solvers are run. This script avoids meshing these cases +# twice. + +# Source tutorial run functions +. $WM_PROJECT_DIR/bin/tools/RunFunctions ( cd blob || exit - ./Allrun -) -( - cd flange || exit - ./Allrun + ./Allrun $* ) ( cd simpleShapes || exit - ./Allrun -) -( - cd mixerVessel || exit - ./Allrun + ./Allrun $* ) -exit 0 - -# Any cases that are links to solver test cases and are run when the Allrun -# scripts of those solvers are run. - -# This dummy Allrun script avoids meshing these cases twice. +if ! isTest $@ +then + ( + cd flange || exit + ./Allrun $* + ) + ( + cd mixerVessel || exit + ./Allrun $* + ) +fi # ----------------------------------------------------------------- end-of-file diff --git a/tutorials/mesh/foamyHexMesh/flange/Alltest b/tutorials/mesh/foamyHexMesh/flange/Alltest deleted file mode 100755 index 6d4a15444..000000000 --- a/tutorials/mesh/foamyHexMesh/flange/Alltest +++ /dev/null @@ -1,32 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory - -# Source tutorial run functions -. $WM_PROJECT_DIR/bin/tools/RunFunctions - -# copy flange surface from resources directory -cp $FOAM_TUTORIALS/resources/geometry/flange.stl.gz constant/triSurface/ - -cp system/controlDict system/controlDict.org - -sed -e s/"\(endTime[ \t]*\)\([0-9]*\);"/"\1 10;"/g \ - -e s/"\(writeInterval[ \t]*\)\([0-9]*\);"/"\1 10;"/g \ - system/controlDict.org > system/controlDict - -runApplication foamyHexMesh - -# 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 - -cp system/controlDict.org system/controlDict -cp system/collapseDict.org system/collapseDict - -rm -f system/controlDict.org system/collapseDict.org - - -# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/mesh/foamyHexMesh/mixerVessel/Alltest b/tutorials/mesh/foamyHexMesh/mixerVessel/Alltest deleted file mode 100755 index 56c0410d5..000000000 --- a/tutorials/mesh/foamyHexMesh/mixerVessel/Alltest +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/sh -cd ${0%/*} || exit 1 # Run from this directory - -# Source tutorial run functions -. $WM_PROJECT_DIR/bin/tools/RunFunctions - -# Do nothing for now. - -# ----------------------------------------------------------------- end-of-file diff --git a/tutorials/mesh/snappyHexMesh/Allrun b/tutorials/mesh/snappyHexMesh/Allrun index a035a98d0..4a41dcfe2 100755 --- a/tutorials/mesh/snappyHexMesh/Allrun +++ b/tutorials/mesh/snappyHexMesh/Allrun @@ -4,7 +4,7 @@ cd ${0%/*} || exit 1 # Run from this directory ( cd flange || exit - ./Allrun + ./Allrun $* ) exit 0 diff --git a/tutorials/multiphase/cavitatingFoam/les/Allrun b/tutorials/multiphase/cavitatingFoam/les/Allrun index e15cc1a1d..d00a7e4b5 100755 --- a/tutorials/multiphase/cavitatingFoam/les/Allrun +++ b/tutorials/multiphase/cavitatingFoam/les/Allrun @@ -3,12 +3,12 @@ cd ${0%/*} || exit 1 # Run from this directory ( cd throttle || exit - ./Allrun + ./Allrun $* ) ( cd throttle3D || exit - ./Allrun + ./Allrun $* ) # ----------------------------------------------------------------- end-of-file