Merge remote branch 'bundle/home' into olesenm

This commit is contained in:
Mark Olesen
2011-01-03 10:06:56 +01:00
29 changed files with 749 additions and 454 deletions

View File

@ -2,7 +2,7 @@
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright (C) 1991-2010 OpenCFD Ltd.
# \\ / A nd | Copyright (C) 2008-2011 OpenCFD Ltd.
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
@ -25,23 +25,23 @@
# RunFunctions
#
# Description
#
# Miscellaneous functions for running tutorial cases
#------------------------------------------------------------------------------
getApplication()
{
grep application system/controlDict | sed "s/application *\([a-zA-Z]*\);/\1/"
sed -ne 's/^ *application *\([a-zA-Z]*\) *;.*$/\1/p' system/controlDict
}
runApplication()
{
APP_RUN=$1
APP_NAME=${1##*/}
shift
APP_NAME=${APP_RUN##*/}
if [ -f log.$APP_NAME ]
then
echo "$APP_NAME already run on $PWD: remove log file to run"
echo "$APP_NAME already run on $PWD: remove log file to re-run"
else
echo "Running $APP_RUN on $PWD"
$APP_RUN $* > log.$APP_NAME 2>&1
@ -51,16 +51,17 @@ runApplication()
runParallel()
{
APP_RUN=$1
APP_NAME=${1##*/}
shift
if [ -f $log.$APP_RUN ]
if [ -f log.$APP_NAME ]
then
echo "$APP_RUN already run on $PWD: remove log file to run"
echo "$APP_NAME already run on $PWD: remove log file to re-run"
else
nProcs=$1
shift
echo "Running $APP_RUN in parallel on $PWD using $nProcs processes"
( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_RUN 2>&1 )
( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 )
fi
}