From 21931c7aeaa22e65f2bf2504de17f5f8c5554ac5 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 8 Jun 2011 12:48:21 +0100 Subject: [PATCH] BUG: cylinder/Allrun: enabled codeStream --- tutorials/basic/potentialFoam/cylinder/Allrun | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tutorials/basic/potentialFoam/cylinder/Allrun b/tutorials/basic/potentialFoam/cylinder/Allrun index 219e4473de..bb35ba990c 100755 --- a/tutorials/basic/potentialFoam/cylinder/Allrun +++ b/tutorials/basic/potentialFoam/cylinder/Allrun @@ -6,6 +6,32 @@ cd ${0%/*} || exit 1 # run from this directory application=`getApplication` + +# This case uses the #codeStream which is disabled by default. Enable for +# just this case. +MAIN_CONTROL_DICT=`foamEtcFile controlDict` +if [ -f "$MAIN_CONTROL_DICT" ] +then + echo "Modifying ${MAIN_CONTROL_DICT}" + if [ -e ${MAIN_CONTROL_DICT}.org ] + then + echo "File ${MAIN_CONTROL_DICT}.org already exists" + echo "Did Allrun fail in some way and then run again?" + exit 1 + fi + + # Clean up on termination and on Ctrl-C + trap 'mv ${MAIN_CONTROL_DICT}.org ${MAIN_CONTROL_DICT} 2>/dev/null; exit 0' \ + EXIT TERM INT + cp ${MAIN_CONTROL_DICT} ${MAIN_CONTROL_DICT}.org + + echo "Enabling allowSystemOperations in ${MAIN_CONTROL_DICT}." + + sed \ + -e s/"\(allowSystemOperations[ \t]*\)\([0-9]\);"/"\1 1;"/g \ + ${MAIN_CONTROL_DICT}.org > ${MAIN_CONTROL_DICT} +fi + cp -r 0.org 0 > /dev/null 2>&1 runApplication blockMesh runApplication $application