From 568917214ca61d7a98780f4cfc3c8f407b2ee607 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Tue, 15 Nov 2011 10:30:34 +0000
Subject: [PATCH] ENH: pipeCyclic/Allrun: enable dynamic code

---
 .../simpleFoam/pipeCyclic/Allrun              | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/tutorials/incompressible/simpleFoam/pipeCyclic/Allrun b/tutorials/incompressible/simpleFoam/pipeCyclic/Allrun
index 6ab4c317b65..e27a9470fba 100755
--- a/tutorials/incompressible/simpleFoam/pipeCyclic/Allrun
+++ b/tutorials/incompressible/simpleFoam/pipeCyclic/Allrun
@@ -7,6 +7,26 @@ cd ${0%/*} || exit 1    # run from this directory
 # Get application 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} to enable allowSystemOperations"
+
+    # Clean up on termination and on Ctrl-C
+    trap 'mv ${MAIN_CONTROL_DICT}.$$ ${MAIN_CONTROL_DICT} 2>/dev/null; exit 0' \
+        EXIT TERM INT
+    cp ${MAIN_CONTROL_DICT} ${MAIN_CONTROL_DICT}.$$
+
+    echo "Enabling allowSystemOperations in ${MAIN_CONTROL_DICT}."
+
+    sed \
+    -e s/"\(allowSystemOperations[ \t]*\)\([0-9]\);"/"\1 1;"/g \
+    ${MAIN_CONTROL_DICT}.$$ > ${MAIN_CONTROL_DICT}
+fi
+
+
 runApplication blockMesh
 runApplication topoSet
 runApplication refineHexMesh c0 -overwrite
-- 
GitLab