2 #------------------------------------------------------------------------------
4 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
6 # \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
8 #------------------------------------------------------------------------------
10 # This file is part of OpenFOAM.
12 # OpenFOAM is free software: you can redistribute it and/or modify it
13 # under the terms of the GNU General Public License as published by
14 # the Free Software Foundation, either version 3 of the License, or
15 # (at your option) any later version.
17 # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
18 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
19 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
22 # You should have received a copy of the GNU General Public License
23 # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
29 # Run either Allrun or blockMesh/application in current directory
30 # and all its subdirectories.
32 #------------------------------------------------------------------------------
34 #------------------------------------------------------------------------------
35 # Select the version of make to be used
36 #------------------------------------------------------------------------------
41 ## set WM_NCOMPPROCS automatically when both WM_HOSTS and WM_SCHEDULER are set
42 #if [ -z "$WM_NCOMPPROCS" -a -n "$WM_HOSTS" -a -n "$WM_SCHEDULER" ]
44 # WM_NCOMPPROCS=$(wmakeScheduler -count)
45 # [ $? -eq 0 ] || unset WM_NCOMPPROCS
48 #if [ "$WM_NCOMPPROCS" ]
50 # if [ "$WM_NCOMPPROCS" -gt 1 -a ! "$MAKEFLAGS" ]
52 # lockDir=$HOME/.$WM_PROJECT/.wmake
61 # make="make --no-print-directory -j "$WM_NCOMPPROCS
67 # Source tutorial functions
68 .
$WM_PROJECT_DIR/bin
/tools
/RunFunctions
71 if [ "/${thisScript#/}" != "$thisScript" ]
73 thisScript
="$PWD/$thisScript"
76 # If an argument is supplied do not execute ./Allrun to avoid recursion
77 if [ $# = 0 -a -f "./Allrun" ]
84 parentDir
=`dirname $PWD`
85 application
=`getApplication`
86 runApplication blockMesh
87 runApplication
$application
89 # Loop over sub-directories and compile any applications
92 if [ -d $caseName -a -d "$caseName/Make" ]
94 ( compileApplication
$caseName )
97 # Recurse to subdirectories
100 # if [ -d $caseName ]
102 # ( cd $caseName && $thisScript )
105 FOAM_TARGETS
=$
(for d
in *; do [ -d "$d" ] && echo "$d"; done |
xargs)
106 #$make -k -f $WM_PROJECT_DIR/bin/tools/MakefileDirs FOAM_TARGETS="$FOAM_TARGETS" FOAM_APP="$WM_SCHEDULER $thisScript"
107 $make -k -f $WM_PROJECT_DIR/bin
/tools
/MakefileDirs FOAM_TARGETS
="$FOAM_TARGETS" FOAM_APP
="$thisScript"
110 #------------------------------------------------------------------------------