1 #---------------------------------*- sh -*-------------------------------------
3 # \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
5 # \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
7 #------------------------------------------------------------------------------
9 # This file is part of OpenFOAM.
11 # OpenFOAM is free software: you can redistribute it and/or modify it
12 # under the terms of the GNU General Public License as published by
13 # the Free Software Foundation, either version 3 of the License, or
14 # (at your option) any later version.
16 # OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
17 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
18 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 # You should have received a copy of the GNU General Public License
22 # along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
28 # Miscellaneous functions for running tutorial cases
29 #------------------------------------------------------------------------------
33 sed -ne 's/^ *application *\([a-zA-Z]*\) *;.*$/\1/p' system/controlDict
42 if [ -f log.$APP_NAME ]
44 echo "$APP_NAME already run on $PWD: remove log file to re-run"
46 echo "Running $APP_RUN on $PWD"
47 $APP_RUN $* > log.$APP_NAME 2>&1
57 if [ -f log.$APP_NAME ]
59 echo "$APP_NAME already run on $PWD: remove log file to re-run"
63 echo "Running $APP_RUN in parallel on $PWD using $nProcs processes"
65 #if [ "$WM_SCHEDULER" ]
67 # echo "$PWD: $WM_SCHEDULER -np $nProcs" 1>&2
68 # $WM_SCHEDULER -np $nProcs "( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 )"
70 ( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 )
77 echo "Compiling $1 application"
85 echo "Case already cloned: remove case directory $2 to clone"
87 echo "Cloning $2 case from $1"
89 cpfiles="0 system constant"
97 #------------------------------------------------------------------------------