STYLE: more consistent shell style in tutorial run/clean scripts

This commit is contained in:
Mark Olesen
2010-03-10 10:55:42 +01:00
parent 2068c67a33
commit 6b6dd51a27
112 changed files with 721 additions and 260 deletions

View File

@ -1,14 +1,17 @@
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
# Source tutorial run functions
. $WM_PROJECT_DIR/bin/tools/RunFunctions
# Set application name
application="interFoam"
setDamBreakFine ()
setDamBreakFine()
{
blockMeshDict="constant/polyMesh/blockMeshDict"
controlDict="system/controlDict"
sed \
-e s/"23 8"/"46 10"/g \
-e s/"19 8"/"40 10"/g \
@ -17,6 +20,7 @@ setDamBreakFine ()
-e s/"19 42\(.*\) 1 1)"/"40 76\1 2 1)"/g \
$blockMeshDict > temp.$$
mv temp.$$ $blockMeshDict
sed \
-e s/"\(deltaT[ \t]*\) 0.001;"/"\1 5e-04;"/g \
-e s/"\(endTime[ \t]*\) 1;"/"\1 0.4;"/g \
@ -25,19 +29,24 @@ setDamBreakFine ()
}
# Do damBreak
(cd damBreak && foamRunTutorials)
( cd damBreak && foamRunTutorials )
# Clone case
cloneCase damBreak damBreakFine
cd damBreakFine
(
cd damBreakFine || exit
# Modify case
setDamBreakFine
cp ../damBreak/0/alpha1.org 0/alpha1
# And execute
runApplication blockMesh
runApplication setFields
runApplication decomposePar
runParallel $application 4
runApplication reconstructPar
cd ..
)
# ----------------------------------------------------------------- end-of-file