diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/Allwclean b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/Allwclean
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/Allwclean
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/Allwclean
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/Allwmake b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/Allwmake
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/Allwmake
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/Allwmake
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/Make/files b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/Make/files
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/Make/files
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/Make/files
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/Make/options b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/Make/options
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/Make/options
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/Make/options
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/UEqn.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/UEqn.H
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/UEqn.H
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/UEqn.H
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/createFields.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/createFields.H
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/createFields.H
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/createFields.H
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/eEqn.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/eEqn.H
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/eEqn.H
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/eEqn.H
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/interCondensatingEvaporatingFoam.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/interCondensatingEvaporatingFoam.C
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/interCondensatingEvaporatingFoam.C
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/interCondensatingEvaporatingFoam.C
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/pEqn.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/pEqn.H
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/pEqn.H
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/pEqn.H
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/Make/files b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/Make/files
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/Make/files
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/Make/files
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/Make/options b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/Make/options
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/Make/options
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/Make/options
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.C
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.H
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.H
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/constant/constant.H
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/newtemperaturePhaseChangeTwoPhaseMixture.C
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixture.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixture.C
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixture.C
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixture.C
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixture.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixture.H
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixture.H
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixtures/temperaturePhaseChangeTwoPhaseMixture.H
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.C
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.C
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.C
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.H
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.H
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/thermoIncompressibleTwoPhaseMixture/thermoIncompressibleTwoPhaseMixture.H
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.C
diff --git a/applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.H b/applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.H
similarity index 100%
rename from applications/solvers/multiphase/interCondensingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.H
rename to applications/solvers/multiphase/interCondensatingEvaporatingFoam/temperaturePhaseChangeTwoPhaseMixtures/twoPhaseMixtureEThermo/twoPhaseMixtureEThermo.H
diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C
index 2bc5d377de989db355cb865ab3ee430762419818..3fff5e49150dbaab8632396c1d38cdfa2966c75b 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C
@@ -63,7 +63,7 @@ Foam::dragModels::Ergun::~Ergun()
 Foam::tmp<Foam::volScalarField> Foam::dragModels::Ergun::CdRe() const
 {
     return
-        (4/3)
+        (4.0/3.0)
        *(
             150
            *max
diff --git a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C
index ca378985ea568e1cf05c9c5b39d701e2ae52a2c5..cb318e5d075ecb0924f2a32d4e533b2fe3240b05 100644
--- a/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C
+++ b/applications/solvers/multiphase/reactingEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C
@@ -68,7 +68,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::Gibilaro::CdRe() const
     );
 
     return
-        (4/3)
+        (4.0/3.0)
        *(17.3/alpha2 + 0.336*pair_.Re())
        *max(pair_.continuous(), pair_.continuous().residualAlpha())
        *pow(alpha2, -2.8);
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C
index 2bc5d377de989db355cb865ab3ee430762419818..3fff5e49150dbaab8632396c1d38cdfa2966c75b 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Ergun/Ergun.C
@@ -63,7 +63,7 @@ Foam::dragModels::Ergun::~Ergun()
 Foam::tmp<Foam::volScalarField> Foam::dragModels::Ergun::CdRe() const
 {
     return
-        (4/3)
+        (4.0/3.0)
        *(
             150
            *max
diff --git a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C
index ca378985ea568e1cf05c9c5b39d701e2ae52a2c5..cb318e5d075ecb0924f2a32d4e533b2fe3240b05 100644
--- a/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C
+++ b/applications/solvers/multiphase/twoPhaseEulerFoam/interfacialModels/dragModels/Gibilaro/Gibilaro.C
@@ -68,7 +68,7 @@ Foam::tmp<Foam::volScalarField> Foam::dragModels::Gibilaro::CdRe() const
     );
 
     return
-        (4/3)
+        (4.0/3.0)
        *(17.3/alpha2 + 0.336*pair_.Re())
        *max(pair_.continuous(), pair_.continuous().residualAlpha())
        *pow(alpha2, -2.8);
diff --git a/applications/test/dictionary/testDict b/applications/test/dictionary/testDict
index a128a0b2e79ea302db3fb68b7c84492aa40ca210..736f4263056db343c6d72614035505a19b98799c 100644
--- a/applications/test/dictionary/testDict
+++ b/applications/test/dictionary/testDict
@@ -64,7 +64,8 @@ boundaryField
     inlet_4  { $inactive }
     inlet_5  "a primitiveEntry is squashed by a directory entry";
     inlet_5  { $inactive }
-    inlet_6  { $.inactive }     // Test scoping
+    inlet_6a { $...inactive }   // Relative scoping - fairly horrible to use
+    inlet_6b { $^inactive }     // Absolute scoping
     inlet_7  { ${inactive}}     // Test variable expansion
     inlet_8  { $inactive }
     ${key}   { $inactive }
diff --git a/applications/test/faces/Test-faces.C b/applications/test/faces/Test-faces.C
index 823f33e3e10046f8836158180c2d22f033b855f1..280cdf70069dcf59656e1fa355dbe3a90884ebd4 100644
--- a/applications/test/faces/Test-faces.C
+++ b/applications/test/faces/Test-faces.C
@@ -52,7 +52,7 @@ int main(int argc, char *argv[])
     Info<< "face:" << f1 << nl;
 
     // expect these to fail
-    FatalError.throwExceptions();
+    const bool throwingError = FatalError.throwExceptions();
     try
     {
         labelledTri l1{ 1, 2, 3, 10, 24 };
@@ -63,7 +63,7 @@ int main(int argc, char *argv[])
         WarningInFunction
             << "Caught FatalError " << err << nl << endl;
     }
-    FatalError.dontThrowExceptions();
+    FatalError.throwExceptions(throwingError);
 
     labelledTri l2{ 1, 2, 3 };
     Info<< "labelled:" << l2 << nl;
diff --git a/applications/test/fieldMapping/pipe1D/system/blockMeshDict b/applications/test/fieldMapping/pipe1D/system/blockMeshDict
index 455cdb1f9b94be01493a3b657a601b876e869879..f5e65a7dfde5867b92a4af0691744b2e5d194eac 100644
--- a/applications/test/fieldMapping/pipe1D/system/blockMeshDict
+++ b/applications/test/fieldMapping/pipe1D/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/applications/test/hexRef8/block/system/blockMeshDict b/applications/test/hexRef8/block/system/blockMeshDict
index 594ef61bd1b15e8b27997e1fd251d0a747cdeab4..931f6899a1b8d2250d7964187b56e03c832d15ae 100644
--- a/applications/test/hexRef8/block/system/blockMeshDict
+++ b/applications/test/hexRef8/block/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/applications/test/io/Test-io.C b/applications/test/io/Test-io.C
index aeef9468ecf80a9e0e4a2251a93668eb21d7d5a3..40f503a4ee7f1d7c37abe88b134a344b4d59a02e 100644
--- a/applications/test/io/Test-io.C
+++ b/applications/test/io/Test-io.C
@@ -40,7 +40,8 @@ using namespace Foam;
 int main(void)
 {
     string st("sfdsf  sdfs23df sdf32f .  sdfsdff23/2sf32");
-    Info<< word(string::validate<word>(st)) << "END" << endl;
+    Info<<"string: " << st << nl;
+    Info<<"word:   \"" << string::validate<word>(st) << "\"" << endl;
 
     string st1("1234567");
 
diff --git a/applications/test/mapDistributePolyMesh/cavity/system/blockMeshDict b/applications/test/mapDistributePolyMesh/cavity/system/blockMeshDict
index 3118c894d875f5cf3287d1714402b6bd2cd2f48f..6b7e69ca49f5fd62bb46fc54438cc27a4ec33bca 100644
--- a/applications/test/mapDistributePolyMesh/cavity/system/blockMeshDict
+++ b/applications/test/mapDistributePolyMesh/cavity/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/applications/test/parallelOverset/heatTransfer/system/blockMeshDict b/applications/test/parallelOverset/heatTransfer/system/blockMeshDict
index d04d518b0afd4f8ddda4246bd372216de1e61d3d..7d3c759df321a352fadaa0dad4beadc823d0a40f 100644
--- a/applications/test/parallelOverset/heatTransfer/system/blockMeshDict
+++ b/applications/test/parallelOverset/heatTransfer/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/applications/test/patchRegion/cavity_pinched/system/blockMeshDict b/applications/test/patchRegion/cavity_pinched/system/blockMeshDict
index 5f58428dd6957756f1e7d66e8d9a31e95ad07e8c..6c09069cce78a74eb7a1f40bb1e2350e46a2d75d 100644
--- a/applications/test/patchRegion/cavity_pinched/system/blockMeshDict
+++ b/applications/test/patchRegion/cavity_pinched/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/applications/test/string/Test-string.C b/applications/test/string/Test-string.C
index 208e1c297f615aa3a4632d3c67072a67c5935836..7975620442b1a47db7e6a9916b8ee527f371a2a0 100644
--- a/applications/test/string/Test-string.C
+++ b/applications/test/string/Test-string.C
@@ -83,7 +83,8 @@ int main(int argc, char *argv[])
     Info<<"camel-case => " << (word("camel") & "case") << nl;
     for (const auto& s : { " text with \"spaces'", "08/15 value" })
     {
-        Info<<"validated \"" << s << "\" => " <<  word::validated(s) << nl;
+        Info<<"validated \"" << s << "\" => "
+            << word::validate(s, true) << nl;
     }
     Info<< nl;
 
diff --git a/applications/test/stringSplit/Make/files b/applications/test/stringSplit/Make/files
new file mode 100644
index 0000000000000000000000000000000000000000..06bdafe1b23840f0531493f3230870077a541bd5
--- /dev/null
+++ b/applications/test/stringSplit/Make/files
@@ -0,0 +1,3 @@
+Test-stringSplit.C
+
+EXE = $(FOAM_USER_APPBIN)/Test-stringSplit
diff --git a/applications/test/stringSplit/Make/options b/applications/test/stringSplit/Make/options
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/applications/test/stringSplit/Test-stringSplit.C b/applications/test/stringSplit/Test-stringSplit.C
new file mode 100644
index 0000000000000000000000000000000000000000..9b1208c252fbf66a5ebcd23bc5717455182dae77
--- /dev/null
+++ b/applications/test/stringSplit/Test-stringSplit.C
@@ -0,0 +1,81 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2017 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
+
+Application
+    Test-stringSplit
+
+Description
+    Test string splitting
+
+\*---------------------------------------------------------------------------*/
+
+#include "argList.H"
+#include "fileName.H"
+#include "stringOps.H"
+
+using namespace Foam;
+
+template<class String>
+void printSplitting(const String& str, const char delimiter)
+{
+    auto split = stringOps::split(str, delimiter);
+
+    Info<< "string {" << str.size() << " chars} = " << str << nl
+        << split.size() << " elements {" << split.length() << " chars}"
+        << nl;
+
+    unsigned i = 0;
+    for (const auto s : split)
+    {
+        Info<< "[" << i++ << "] {" << s.length() << " chars} = "
+            << s.str() << nl;
+    }
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// Main program:
+
+int main(int argc, char *argv[])
+{
+    argList::noBanner();
+    argList::noParallel();
+
+    argList args(argc, argv, false, true);
+
+    if (args.size() <= 1 && args.options().empty())
+    {
+        args.printUsage();
+    }
+
+    for (label argi=1; argi < args.size(); ++argi)
+    {
+        printSplitting(args[argi], '/');
+    }
+
+    Info<< "\nEnd\n" << endl;
+    return 0;
+}
+
+
+// ************************************************************************* //
diff --git a/applications/test/volField/cavity/system/blockMeshDict b/applications/test/volField/cavity/system/blockMeshDict
index cb67af8ad1ce0fef2af012af46988a910d3d4421..69ed9d520102702ef63559f7ddcabe8506a4bc33 100644
--- a/applications/test/volField/cavity/system/blockMeshDict
+++ b/applications/test/volField/cavity/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/applications/utilities/mesh/conversion/ccm/ccmToFoam/ccmToFoam.C b/applications/utilities/mesh/conversion/ccm/ccmToFoam/ccmToFoam.C
index 52377df3393a533ade4d556a4b0a6e963d0c1a97..3c971ad743b227c76d29720f95aed671d4082c23 100644
--- a/applications/utilities/mesh/conversion/ccm/ccmToFoam/ccmToFoam.C
+++ b/applications/utilities/mesh/conversion/ccm/ccmToFoam/ccmToFoam.C
@@ -45,7 +45,8 @@ Usage
         List some information about the geometry
 
       - \par -name \<name\>
-        Provide alternative base name for export. Default is <tt>meshExport</tt>.
+        Provide alternative base name for export.
+        Default is <tt>meshExport</tt>.
 
       - \par -noBaffles
         Remove any baffles by merging the faces.
@@ -57,7 +58,8 @@ Usage
         Use numbered patch/zone (not names) directly from ccm ids.
 
       - \par -remap \<name\>
-        use specified remapping dictionary instead of <tt>constant/remapping</tt>
+        Use specified remapping dictionary instead of
+        <tt>constant/remapping</tt>
 
       - \par -scale \<factor\>
         Specify an alternative geometry scaling factor.
@@ -92,7 +94,8 @@ int main(int argc, char *argv[])
     (
         "Reads CCM files as written by PROSTAR/STARCCM and writes an OPENFOAM "
         " polyMesh. Multi-region support for PROSTAR meshes should be stable."
-        " Multi-region merging for STARCCM meshes will not always be successful."
+        " Multi-region merging for STARCCM meshes will not always be"
+        " successful."
     );
 
     argList::noParallel();
diff --git a/applications/utilities/mesh/conversion/ccm/foamToCcm/foamToCcm.C b/applications/utilities/mesh/conversion/ccm/foamToCcm/foamToCcm.C
index 9d64cc09b063abf3e6fb862e797fff8d021402a6..31ef8b3a8dd2d2ccfcadab0f70288b15c70b46c1 100644
--- a/applications/utilities/mesh/conversion/ccm/foamToCcm/foamToCcm.C
+++ b/applications/utilities/mesh/conversion/ccm/foamToCcm/foamToCcm.C
@@ -44,10 +44,11 @@ Usage
         No backup of existing output files.
 
       - \par -remap \<name\>
-        use specified remapping dictionary instead of <tt>constant/remapping</tt>
+        Use specified remapping dictionary instead of
+        <tt>constant/remapping</tt>
 
       - \par -results
-        convert results only to CCM format
+        Convert results only to CCM format
 
 Note
     - No parallel data
@@ -206,8 +207,7 @@ int main(int argc, char *argv[])
         // #include "checkHasMovingMesh.H"
         // #include "checkHasLagrangian.H"
 
-        IOobjectList objects(mesh, timeDirs[timeDirs.size()-1].name());
-        //  IOobjectList sprayObjects(mesh, Times[Times.size()-1].name(), "lagrangian");
+        IOobjectList objects(mesh, timeDirs.last().name());
 
         forAll(timeDirs, timeI)
         {
diff --git a/applications/utilities/mesh/conversion/datToFoam/datToFoam.C b/applications/utilities/mesh/conversion/datToFoam/datToFoam.C
index 11255ced731357992a2f1afc458b1594fa386f25..7cc4fbffb86cc8963724e708ff35918424c66846 100644
--- a/applications/utilities/mesh/conversion/datToFoam/datToFoam.C
+++ b/applications/utilities/mesh/conversion/datToFoam/datToFoam.C
@@ -122,7 +122,7 @@ int main(int argc, char *argv[])
     fileName pointsFile(runTime.constantPath()/"points.tmp");
     OFstream pFile(pointsFile);
 
-    const scalar a = 0.1_deg;
+    const scalar a = degToRad(0.1);
     tensor rotateZ =
         tensor
         (
diff --git a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L
index ca276a034885ff842d159f14545bf0cef5cd4e77..8898cded2c61177a1e9aca648cc5c1d4d0e528c7 100644
--- a/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L
+++ b/applications/utilities/mesh/conversion/fluent3DMeshToFoam/fluent3DMeshToFoam.L
@@ -221,6 +221,7 @@ redundantBlock             {space}({comment}|{unknownPeriodicFace}|{periodicFace
 endOfSection               {space}")"{space}
 
 
+/* balance "-quoted for editor */
 
  /* ------------------------------------------------------------------------ *\
                       -----  Exclusive start states -----
@@ -693,7 +694,7 @@ endOfSection               {space}")"{space}
 {lbrac}{label} {
         Warning
             << "Found unknown block of type: "
-            << Foam::string(YYText())(1, YYLeng()-1) << nl
+            << std::string(YYText()).substr(1, YYLeng()-1) << nl
             << "    on line " << lineNo << endl;
 
         yy_push_state(ignoreBlock);
diff --git a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L
index 6db26071d55f2c13893ee87f9814555e74ca78cd..23432898a609a013579fb2f62b3cd17db8b3b7ac 100644
--- a/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L
+++ b/applications/utilities/mesh/conversion/gambitToFoam/gambitToFoam.L
@@ -488,7 +488,7 @@ mtype                 {space}"MTYPE:"{space}
 
 <cellStreamTitle>{spaceNl}{word}{spaceNl} {
 
-        word streamName(Foam::string::validate<word>(YYText()));
+        const word streamName(word::validate(YYText()));
 
         BEGIN(cellStreamFlags);
     }
diff --git a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C
index ea0bd7f6dc94f08b689b28d3e487baba92e83b1f..cf878490790ce5e67475cb3a9aa562050ca4b912 100644
--- a/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C
+++ b/applications/utilities/mesh/conversion/gmshToFoam/gmshToFoam.C
@@ -370,7 +370,7 @@ void readPhysNames(IFstream& inFile, Map<word>& physicalNames)
             lineStr >> regionI >> regionName;
 
             Info<< "    " << regionI << '\t'
-                << string::validate<word>(regionName) << endl;
+                << word::validate(regionName) << endl;
         }
         else if (nSpaces == 2)
         {
@@ -380,21 +380,21 @@ void readPhysNames(IFstream& inFile, Map<word>& physicalNames)
             if (physType == 1)
             {
                 Info<< "    " << "Line " << regionI << '\t'
-                    << string::validate<word>(regionName) << endl;
+                    << word::validate(regionName) << endl;
             }
             else if (physType == 2)
             {
                 Info<< "    " << "Surface " << regionI << '\t'
-                    << string::validate<word>(regionName) << endl;
+                    << word::validate(regionName) << endl;
             }
             else if (physType == 3)
             {
                 Info<< "    " << "Volume " << regionI << '\t'
-                    << string::validate<word>(regionName) << endl;
+                    << word::validate(regionName) << endl;
             }
         }
 
-        physicalNames.insert(regionI, string::validate<word>(regionName));
+        physicalNames.insert(regionI, word::validate(regionName));
     }
 
     inFile.getLine(line);
diff --git a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C
index 8583c9fac5d055a125a7d7ca34fd6dcfef5ade0b..6ad6dfcd433517e33648136f380ca720a883726c 100644
--- a/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C
+++ b/applications/utilities/mesh/conversion/ideasUnvToFoam/ideasUnvToFoam.C
@@ -512,7 +512,7 @@ void readSets
             >> dofSet >> tempSet >> contactSet >> nFaces;
 
         is.getLine(line);
-        word groupName = string::validate<word>(line);
+        const word groupName = word::validate(line);
 
         Info<< "For group " << group
             << " named " << groupName
diff --git a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H
index e97a717f0346229e59a86efacb1de10f07b56ed2..5e3afb3b3a898523dc1d740b9975960a61fe6af8 100644
--- a/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H
+++ b/applications/utilities/mesh/conversion/kivaToFoam/readKivaGrid.H
@@ -419,7 +419,7 @@ if (pFaces[WEDGE].size() && pFaces[WEDGE][0].size())
     {
         // Distribute the points to be +/- 2.5deg from the x-z plane
 
-        const scalar tanTheta = Foam::tan(2.5_deg);
+        const scalar tanTheta = Foam::tan(degToRad(2.5));
 
         SLList<face>::iterator iterf = pFaces[WEDGE][0].begin();
         SLList<face>::iterator iterb = pFaces[WEDGE][1].begin();
diff --git a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C
index df009f30830afb543a73b9fc6c7e5b4ab5a543b4..575bf8de69f1e9e93e151893788ebc71bf73a351 100644
--- a/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C
+++ b/applications/utilities/mesh/generation/foamyMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshConformToSurface.C
@@ -33,10 +33,10 @@ License
 using namespace Foam::vectorTools;
 
 const Foam::scalar Foam::conformalVoronoiMesh::searchConeAngle
-    = Foam::cos(30.0_deg);
+    = Foam::cos(degToRad(30.0));
 
 const Foam::scalar Foam::conformalVoronoiMesh::searchAngleOppositeSurface
-    = Foam::cos(150.0_deg);
+    = Foam::cos(degToRad(150.0));
 
 
 // * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
diff --git a/applications/utilities/mesh/manipulation/setSet/setSet.C b/applications/utilities/mesh/manipulation/setSet/setSet.C
index 4a64e6f8011ac8df4f6e87a7503aa172d045152d..2f5b6a5cca332aa0a81bb4c651caaa2394df1b0f 100644
--- a/applications/utilities/mesh/manipulation/setSet/setSet.C
+++ b/applications/utilities/mesh/manipulation/setSet/setSet.C
@@ -903,10 +903,10 @@ int main(int argc, char *argv[])
             }
 
             // Strip off anything after #
-            string::size_type i = rawLine.find_first_of("#");
+            string::size_type i = rawLine.find('#');
             if (i != string::npos)
             {
-                rawLine = rawLine(0, i);
+                rawLine.resize(i);
             }
 
             if (rawLine.empty())
diff --git a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C
index 81971b85f5f5c3be18241d9efdbeb9db35ab87e3..b024745f42a79c95989af936e582ce7d79be65c8 100644
--- a/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C
+++ b/applications/utilities/miscellaneous/foamFormatConvert/foamFormatConvert.C
@@ -191,7 +191,7 @@ int main(int argc, char *argv[])
             << endl;
     }
 
-    int oldFlag = entry::disableFunctionEntries;
+    const int oldFlag = entry::disableFunctionEntries;
     if (!enableEntries)
     {
         // By default disable dictionary expansion for fields
diff --git a/applications/utilities/miscellaneous/foamHelp/foamHelp.C b/applications/utilities/miscellaneous/foamHelp/foamHelp.C
index a0e7097e4f96c52479f66520f3821179215388eb..88aac628c00277acfeaabf5e5879ac80877c5f9f 100644
--- a/applications/utilities/miscellaneous/foamHelp/foamHelp.C
+++ b/applications/utilities/miscellaneous/foamHelp/foamHelp.C
@@ -45,7 +45,7 @@ int main(int argc, char *argv[])
     #include "addToolOption.H"
 
     // Intercept request for help
-    if ((argc > 0) && (strcmp(argv[1], "-help") == 0))
+    if ((argc > 1) && (strcmp(argv[1], "-help") == 0))
     {
         #include "setRootCase.H"
     }
diff --git a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
index 6789c6f9e9373d3f71411309d2e2a514e3d3dd9f..4be4abb392dcac6907fd207cb85e69c2b7f6e934 100644
--- a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
+++ b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
@@ -598,10 +598,7 @@ int main(int argc, char *argv[])
                     // Pass2: reconstruct the cloud
                     forAllConstIter(HashTable<IOobjectList>, cloudObjects, iter)
                     {
-                        const word cloudName = string::validate<word>
-                        (
-                            iter.key()
-                        );
+                        const word cloudName = word::validate(iter.key());
 
                         // Objects (on arbitrary processor)
                         const IOobjectList& sprayObjs = iter();
diff --git a/applications/utilities/postProcessing/dataConversion/smapToFoam/smapToFoam.C b/applications/utilities/postProcessing/dataConversion/smapToFoam/smapToFoam.C
index 9ac03a63c4ef739c189ba9c6c1d38feea2e680e6..d228a420876c8e508760fdb36408b2b636b3a8c2 100644
--- a/applications/utilities/postProcessing/dataConversion/smapToFoam/smapToFoam.C
+++ b/applications/utilities/postProcessing/dataConversion/smapToFoam/smapToFoam.C
@@ -89,11 +89,7 @@ int main(int argc, char *argv[])
             break;
         }
 
-        if
-        (
-            fieldName.type() != token::WORD
-         && fieldName.wordToken() != "CELL"
-        )
+        if (!fieldName.isWord() || fieldName.wordToken() != "CELL")
         {
             FatalErrorInFunction
                 << "Expected first CELL, found "
@@ -103,7 +99,7 @@ int main(int argc, char *argv[])
 
         label nCols = 0;
         smapFile >> fieldName;
-        while (fieldName.type() == token::WORD)
+        while (fieldName.isWord())
         {
             starFieldNames[nCols++] = fieldName.wordToken();
             smapFile >> fieldName;
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwclean b/applications/utilities/postProcessing/graphics/PVReaders/Allwclean
index 54808b94b1b75fa19287ccca871003f4757b9b22..7a429617b84a99edaa33237a9100d2346181cdcd 100755
--- a/applications/utilities/postProcessing/graphics/PVReaders/Allwclean
+++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwclean
@@ -1,8 +1,19 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # Run from this directory
 
+# Source the wmake functions
+. $WM_PROJECT_DIR/wmake/scripts/wmakeFunctions
+
+# Cleanup OpenFOAM libraries
 wclean libso foamPv
-PVblockMeshReader/Allwclean
-PVFoamReader/Allwclean
+wclean libso vtkPVblockMesh
+wclean libso vtkPVFoam
+
+# Cleanup client-server and/or combined plugins
+rm -f $FOAM_LIBBIN/libPVblockMeshReader* 2>/dev/null
+rm -f $FOAM_LIBBIN/libPVFoamReader* 2>/dev/null
+
+# Cleanup generated files - remove entire top-level
+removeObjectDir $PWD
 
 #------------------------------------------------------------------------------
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake
index d80b89f34dc66d5f809ff7d478a1a84944807fad..cb085fd8c04247f648ec0a511d6356947377c81f 100755
--- a/applications/utilities/postProcessing/graphics/PVReaders/Allwmake
+++ b/applications/utilities/postProcessing/graphics/PVReaders/Allwmake
@@ -12,6 +12,13 @@ export WM_CONTINUE_ON_ERROR=true
 
 # -----------------------------------------------------------------------------
 
+warnIncomplete()
+{
+    echo
+    echo "    WARNING: incomplete build of ParaView plugin: $@"
+    echo
+}
+
 # major version as per paraview include directory:
 # Eg, "PREFIX/include/paraview-5.0" -> "5.0"
 major="${ParaView_INCLUDE_DIR##*-}"
@@ -22,8 +29,14 @@ case "$major" in
     then
     (
         wmakeLibPv foamPv
-        PVblockMeshReader/Allwmake $targetType $*
-        PVFoamReader/Allwmake $targetType $*
+        wmakeLibPv vtkPVblockMesh
+        wmakeLibPv vtkPVFoam
+
+        if [ "$targetType" != objects ]
+        then
+            cmakePv $PWD/PVblockMeshReader || warnIncomplete "BlockMesh"
+            cmakePv $PWD/PVFoamReader || warnIncomplete "OpenFOAM"
+        fi
     )
     fi
     ;;
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwclean b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwclean
deleted file mode 100755
index 9b1370c3ff8aadbeaf507735ba20dde746a049d1..0000000000000000000000000000000000000000
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwclean
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Source the wmake functions
-. $WM_PROJECT_DIR/wmake/scripts/wmakeFunctions
-
-# Cleanup client-server and/or combined plugins
-rm -f $FOAM_LIBBIN/libPVFoamReader* 2>/dev/null
-
-rm -rf PVFoamReader/Make        # safety: old build location
-wclean libso vtkPVFoam
-
-# Cleanup generated files - remove entire top-level
-removeObjectDir $PWD
-
-#------------------------------------------------------------------------------
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwmake
deleted file mode 100755
index b9f216f54eb020691d29bb4985c710645aad10b5..0000000000000000000000000000000000000000
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/Allwmake
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-
-# Source CMake functions
-. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions
-
-# -----------------------------------------------------------------------------
-
-if [ -d "$ParaView_DIR" ]
-then
-    wmakeLibPv vtkPVFoam
-
-    if [ "$targetType" != objects ]
-    then
-        cmakePv $PWD/PVFoamReader || {
-            echo
-            echo "    WARNING: incomplete build of ParaView OpenFOAM plugin"
-            echo
-        }
-    fi
-fi
-
-#------------------------------------------------------------------------------
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt
similarity index 97%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt
rename to applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt
index f2fd631fd1be82cf9a709cc513d42d9d034f0b16..4815a13d8d87539bd06373031cc139bb43120a68 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/CMakeLists.txt
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/CMakeLists.txt
@@ -14,8 +14,8 @@ include_directories(
     $ENV{WM_PROJECT_DIR}/src/OSspecific/$ENV{WM_OSTYPE}/lnInclude
     $ENV{WM_PROJECT_DIR}/src/conversion/lnInclude
     $ENV{WM_PROJECT_DIR}/src/finiteVolume/lnInclude
+    ${PROJECT_SOURCE_DIR}/../foamPv
     ${PROJECT_SOURCE_DIR}/../vtkPVFoam
-    ${PROJECT_SOURCE_DIR}/../../foamPv/lnInclude
 )
 
 add_definitions(
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/PVFoamReader_SM.xml b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader_SM.xml
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/PVFoamReader_SM.xml
rename to applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader_SM.xml
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqFoamReaderControls.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/pqFoamReaderControls.cxx
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqFoamReaderControls.cxx
rename to applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/pqFoamReaderControls.cxx
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqFoamReaderControls.h b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/pqFoamReaderControls.h
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/pqFoamReaderControls.h
rename to applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/pqFoamReaderControls.h
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoamReader.cxx
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.cxx
rename to applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoamReader.cxx
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.h b/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoamReader.h
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/PVFoamReader/vtkPVFoamReader.h
rename to applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoamReader.h
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwclean b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwclean
deleted file mode 100755
index b49fed7d2d173f7647bd09a89117a7eab86c74a3..0000000000000000000000000000000000000000
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwclean
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Source the wmake functions
-. $WM_PROJECT_DIR/wmake/scripts/wmakeFunctions
-
-# Cleanup client-server and/or combined plugins
-rm -f $FOAM_LIBBIN/libPVblockMeshReader* 2>/dev/null
-
-rm -rf PVblockMeshReader/Make   # safety: old build location
-wclean libso vtkPVblockMesh
-
-# Cleanup generated files - remove entire top-level
-removeObjectDir $PWD
-
-#------------------------------------------------------------------------------
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwmake b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwmake
deleted file mode 100755
index 24d577b2aef6d315af7a6964dcda0f323a6debed..0000000000000000000000000000000000000000
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/Allwmake
+++ /dev/null
@@ -1,26 +0,0 @@
-#!/bin/sh
-cd ${0%/*} || exit 1    # Run from this directory
-
-# Parse arguments for library compilation
-. $WM_PROJECT_DIR/wmake/scripts/AllwmakeParseArguments
-
-# Source CMake functions
-. $WM_PROJECT_DIR/wmake/scripts/cmakeFunctions
-
-# -----------------------------------------------------------------------------
-
-if [ -d "$ParaView_DIR" ]
-then
-    wmakeLibPv vtkPVblockMesh
-
-    if [ "$targetType" != objects ]
-    then
-        cmakePv $PWD/PVblockMeshReader || {
-            echo
-            echo "    WARNING: incomplete build of ParaView BlockMesh plugin"
-            echo
-        }
-    fi
-fi
-
-#------------------------------------------------------------------------------
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/CMakeLists.txt
similarity index 97%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt
rename to applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/CMakeLists.txt
index c3c889ffb5f9c3d6bf248ee35e740767907ec28d..ff3a876d3085e12885a682f0019bf6c39a9e3735 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/CMakeLists.txt
+++ b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/CMakeLists.txt
@@ -13,8 +13,8 @@ include_directories(
     $ENV{WM_PROJECT_DIR}/src/OpenFOAM/lnInclude
     $ENV{WM_PROJECT_DIR}/src/OSspecific/$ENV{WM_OSTYPE}/lnInclude
     $ENV{WM_PROJECT_DIR}/src/meshing/blockMesh/lnInclude
+    ${PROJECT_SOURCE_DIR}/../foamPv
     ${PROJECT_SOURCE_DIR}/../vtkPVblockMesh
-    ${PROJECT_SOURCE_DIR}/../../foamPv/lnInclude
 )
 
 add_definitions(
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader_SM.xml b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader_SM.xml
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/PVblockMeshReader_SM.xml
rename to applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader_SM.xml
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqFoamBlockMeshControls.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/pqFoamBlockMeshControls.cxx
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqFoamBlockMeshControls.cxx
rename to applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/pqFoamBlockMeshControls.cxx
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqFoamBlockMeshControls.h b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/pqFoamBlockMeshControls.h
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/pqFoamBlockMeshControls.h
rename to applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/pqFoamBlockMeshControls.h
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMeshReader.cxx
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.cxx
rename to applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMeshReader.cxx
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.h b/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMeshReader.h
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/PVblockMeshReader/vtkPVblockMeshReader.h
rename to applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMeshReader.h
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/Make/files b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/Make/files
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/Make/files
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/Make/files
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/Make/options b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/Make/options
similarity index 94%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/Make/options
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/Make/options
index 4a739397116ce17d611a676c5cdb8f70f488d958..8c7fdce47261a7acbac1c83b7dbe1854937b2a83 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/Make/options
+++ b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/Make/options
@@ -10,7 +10,7 @@ EXE_INC = \
     -I$(LIB_SRC)/conversion/lnInclude \
     -I$(ParaView_INCLUDE_DIR) \
     -I$(ParaView_INCLUDE_DIR)/vtkkwiml \
-    -I../../foamPv/lnInclude \
+    -I../foamPv \
     -I../PVFoamReader
 
 LIB_LIBS = \
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.C
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.C
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.C
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.H b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.H
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoam.H
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoam.H
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamFieldTemplates.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamFieldTemplates.C
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamFieldTemplates.C
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamFieldTemplates.C
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamFields.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamFields.C
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamFields.C
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamFields.C
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMesh.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamMesh.C
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMesh.C
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamMesh.C
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshLagrangian.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamMeshLagrangian.C
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshLagrangian.C
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamMeshLagrangian.C
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshVolume.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamMeshVolume.C
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamMeshVolume.C
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamMeshVolume.C
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamTemplates.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamTemplates.C
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamTemplates.C
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamTemplates.C
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfo.C
similarity index 99%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfo.C
index f71354aaa1d390b33e64099f617712c32533e6a8..335a975fc84cb9da27298383c56ebc5ee4f4e5b2 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateInfo.C
+++ b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateInfo.C
@@ -635,8 +635,7 @@ void Foam::vtkPVFoam::updateInfoLagrangianFields
 
     if (debug)
     {
-        Info<< "<end> updateInfoLagrangianFields - "
-            << "lagrangian objects.size() = " << objects.size() << endl;
+        Info<< "<end> " << FUNCTION_NAME << endl;
     }
 }
 
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateTemplates.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateTemplates.C
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVFoamReader/vtkPVFoam/vtkPVFoamUpdateTemplates.C
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVFoam/vtkPVFoamUpdateTemplates.C
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/Make/files b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/Make/files
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/Make/files
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/Make/files
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/Make/options b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/Make/options
similarity index 92%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/Make/options
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/Make/options
index d07c5b2469270e9ad29f0da7b1977df93cdcc077..a41d97cf4fa18c1a1573c7bb908981bb9b9d09e6 100644
--- a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/Make/options
+++ b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/Make/options
@@ -7,7 +7,7 @@ EXE_INC = \
     -I$(LIB_SRC)/mesh/blockMesh/lnInclude \
     -I$(ParaView_INCLUDE_DIR) \
     -I$(ParaView_INCLUDE_DIR)/vtkkwiml \
-    -I../../foamPv/lnInclude \
+    -I../foamPv \
     -I../PVblockMeshReader
 
 LIB_LIBS = \
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/vtkPVblockMesh.C
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.C
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/vtkPVblockMesh.C
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.H b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/vtkPVblockMesh.H
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMesh.H
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/vtkPVblockMesh.H
diff --git a/applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMeshConvert.C b/applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/vtkPVblockMeshConvert.C
similarity index 100%
rename from applications/utilities/postProcessing/graphics/PVReaders/PVblockMeshReader/vtkPVblockMesh/vtkPVblockMeshConvert.C
rename to applications/utilities/postProcessing/graphics/PVReaders/vtkPVblockMesh/vtkPVblockMeshConvert.C
diff --git a/applications/utilities/postProcessing/noise/noiseDict b/applications/utilities/postProcessing/noise/noiseDict
index 00a3fbc81d58ede2674bd7ea90b214a366236ac9..ca808462c4c2dceccc6d51c0da878557d969aae7 100644
--- a/applications/utilities/postProcessing/noise/noiseDict
+++ b/applications/utilities/postProcessing/noise/noiseDict
@@ -48,8 +48,11 @@ surfaceNoiseCoeffs
 */
 
 
-    // Input file
-    inputFile   "postProcessing/faceSource1/surface/patch_motorBike_rider-helmet%65/patch_motorBike_rider-helmet%65.case";
+    // Input file(s)
+    file   "postProcessing/faceSource1/surface/patch1/patch1.case";
+    // Multiple inputs
+    //files   ( "postProcessing/faceSource1/surface/patch1/patch1.case"
+    //          "postProcessing/faceSource2/surface/patch2/patch2.case" );
 
     // Surface reader
     reader      ensight;
@@ -83,20 +86,25 @@ surfaceNoiseCoeffs
     //startTime       0;
 
     // Write interval for FFT data, default = 1
-//    fftWriteInterval 100;
+    //fftWriteInterval 100;
+
+    // Bounds for valid pressure from input source
+        // Maximum pressure, default 0.5*VGREAT
+        //maxPressure 150e5;
+
+        // Minimum pressure, default -0.5*VGREAT
+        //minPressure -150e5;
 }
 
 pointNoiseCoeffs
 {
-    csvFileData
-    {
-        file            "pressureData";
-        nHeaderLine     1;
-        refColumn       0;
-        componentColumns (1);
-        separator       " ";
-        mergeSeparators yes;
-    }
+    file            "pressureData";
+    //files           ( "pressureData" "pressureData2");
+    nHeaderLine     1;
+    refColumn       0;
+    componentColumns (1);
+    separator       " ";
+    mergeSeparators yes;
 
     HanningCoeffs
     {
@@ -130,6 +138,13 @@ pointNoiseCoeffs
 
     // Write interval for FFT data, default = 1
     fftWriteInterval 100;
+
+    // Bounds for valid pressure from input source
+        // Maximum pressure, default 0.5*VGREAT
+        //maxPressure 150e5;
+
+        // Minimum pressure, default -0.5*VGREAT
+        //minPressure -150e5;
 }
 
 
diff --git a/applications/utilities/postProcessing/postProcess/postProcess.C b/applications/utilities/postProcessing/postProcess/postProcess.C
index 3f7f51dd2d4d2998b2bad374fadf5f3064c9192d..8a01c21eb44bdccf327297c0ea0475c388d01d12 100644
--- a/applications/utilities/postProcessing/postProcess/postProcess.C
+++ b/applications/utilities/postProcessing/postProcess/postProcess.C
@@ -191,7 +191,7 @@ int main(int argc, char *argv[])
             );
         }
 
-        FatalIOError.throwExceptions();
+        const bool throwingIOErr = FatalIOError.throwExceptions();
 
         try
         {
@@ -208,12 +208,15 @@ int main(int argc, char *argv[])
             // Report to output (avoid overwriting values from simulation)
             profiling::print(Info);
         }
-        catch (IOerror& err)
+        catch (Foam::IOerror& err)
         {
             Warning<< err << endl;
         }
 
         Info<< endl;
+
+        // Restore previous exception throwing state
+        FatalIOError.throwExceptions(throwingIOErr);
     }
 
     Info<< "End\n" << endl;
diff --git a/applications/utilities/preProcessing/changeDictionary/changeDictionary.C b/applications/utilities/preProcessing/changeDictionary/changeDictionary.C
index d9a7fbb8fc01d78d92659a30c47757bb65b83b9b..f9be71c75fa5f9da247288b48b70dfb4f5aea0cd 100644
--- a/applications/utilities/preProcessing/changeDictionary/changeDictionary.C
+++ b/applications/utilities/preProcessing/changeDictionary/changeDictionary.C
@@ -254,7 +254,7 @@ bool merge
 
         if (key[0] == '~')
         {
-            word eraseKey = key(1, key.size()-1);
+            const word eraseKey = key.substr(1);
             if (thisDict.remove(eraseKey))
             {
                 // Mark thisDict entry as having been match for wildcard
@@ -325,7 +325,7 @@ bool merge
 
             if (key[0] == '~')
             {
-                word eraseKey = key(1, key.size()-1);
+                const word eraseKey = key.substr(1);
 
                 // List of indices into thisKeys
                 labelList matches
@@ -464,7 +464,7 @@ int main(int argc, char *argv[])
             << endl;
     }
 
-    int oldFlag = entry::disableFunctionEntries;
+    const int oldFlag = entry::disableFunctionEntries;
     if (!enableEntries)
     {
         // By default disable dictionary expansion for fields
diff --git a/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C b/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C
index bca1b7a39484333ceabeb3de3f02576aa9833c13..b35b5b3707e328760af8b787deab21ff66d156b2 100644
--- a/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C
+++ b/applications/utilities/preProcessing/foamUpgradeCyclics/foamUpgradeCyclics.C
@@ -500,7 +500,7 @@ int main(int argc, char *argv[])
         IOobjectList objects(runTime, runTime.timeName());
 
 
-        int oldFlag = entry::disableFunctionEntries;
+        const int oldFlag = entry::disableFunctionEntries;
         if (!enableEntries)
         {
             // By default disable dictionary expansion for fields
diff --git a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/SpaldingsLaw/SpaldingsLaw.C b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/SpaldingsLaw/SpaldingsLaw.C
index 24834c227f20e1aebe55d5aca325b8855ba47f2d..27b20c59324ed9e81570b24fd30de4794632ba7c 100644
--- a/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/SpaldingsLaw/SpaldingsLaw.C
+++ b/applications/utilities/preProcessing/wallFunctionTable/tabulatedWallFunction/SpaldingsLaw/SpaldingsLaw.C
@@ -91,7 +91,7 @@ void Foam::tabulatedWallFunctions::SpaldingsLaw::invertFunction()
                 (
                     2*E_*uPlus
                   + exp(kUPlus)*(kUPlus + 1)
-                  - 2/3*pow3(kUPlus)
+                  - 2.0/3.0*pow3(kUPlus)
                   - 1.5*sqr(kUPlus)
                   - 2*kUPlus
                   - 1
diff --git a/bin/tools/foamCreateBashCompletions b/bin/tools/foamCreateBashCompletions
deleted file mode 100755
index f7c384f48252fca60a505ddb8a8b1e47b8d9228b..0000000000000000000000000000000000000000
--- a/bin/tools/foamCreateBashCompletions
+++ /dev/null
@@ -1,229 +0,0 @@
-#!/bin/sh
-#------------------------------------------------------------------------------
-# =========                 |
-# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-#  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 2017 OpenCFD Ltd.
-#    \\/     M anipulation  |
-#------------------------------------------------------------------------------
-# License
-#     This file is part of OpenFOAM.
-#
-#     OpenFOAM is free software: you can redistribute it and/or modify it
-#     under the terms of the GNU General Public License as published by
-#     the Free Software Foundation, either version 3 of the License, or
-#     (at your option) any later version.
-#
-#     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-#     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-#     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-#     for more details.
-#
-#     You should have received a copy of the GNU General Public License
-#     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-#
-# Script
-#     foamCreateBashCompletions
-#
-# Description
-#     Create bash completions for OpenFOAM applications
-#
-#------------------------------------------------------------------------------
-usage() {
-    exec 1>&2
-    while [ "$#" -ge 1 ]; do echo "$1"; shift; done
-    cat<<USAGE
-
-Usage: ${0##*/} [OPTION] <outputFile>
-options:
-  -d dir | -dir dir       Directory to process
-  -u | -user              Add \$FOAM_USER_APPBIN to the search directories
-  -h | -help              Print the usage
-
-Create bash completions for OpenFOAM applications and write to <outputFile>.
-By default searches \$FOAM_APPBIN only.
-
-USAGE
-    exit 1
-}
-
-# Report error and exit
-die()
-{
-    exec 1>&2
-    echo
-    echo "Error encountered:"
-    while [ "$#" -ge 1 ]; do echo "    $1"; shift; done
-    echo
-    echo "See '${0##*/} -help' for usage"
-    echo
-    exit 1
-}
-
-#-------------------------------------------------------------------------------
-#set -x
-
-unset outFile
-searchDirs="$FOAM_APPBIN"
-while [ "$#" -gt 0 ]
-do
-    case "$1" in
-        -h | -help)
-            usage
-            ;;
-        -d | -dir)
-            searchDirs="$2"
-            [ -d $searchDirs ] || usage "directory not found '$searchDirs'"
-            shift
-            ;;
-        -u | -user)
-            searchDirs="$searchDirs $FOAM_USER_APPBIN"
-            ;;
-        -*)
-            usage "unknown option: '$1'"
-            ;;
-        *)
-            outFile=$1
-            break
-            ;;
-    esac
-    shift
-done
-
-[ -n "$outFile" ] || usage "No output file specified"
-
-
-# Generate header
-cat << HEADER > $outFile
-#----------------------------------*-sh-*--------------------------------------
-# Bash completions for OpenFOAM applications
-# Formatted as "complete ... -F _of_APPNAME APPNAME
-
-unset -f _of_filter_opts 2>/dev/null
-_of_filter_opts()
-{
-    local allOpts=\$1
-    local applied=\$2
-    for o in \${allOpts}; do
-        [ "\${applied/\$o/}" == "\${applied}" ] && echo \$o
-    done
-}
-
-HEADER
-
-#------------------------------------------------------------------------------
-
-#
-# Produce contents for switch for common options
-#
-commonOptions()
-{
-    local indent1="    "
-    local indent2="        "
-    for opt
-    do
-        case $opt in
-        -case)
-            echo "${indent1}-case)"
-            echo "${indent2}COMPREPLY=(\$(compgen -d -- \${cur}))"
-            echo "${indent2};;"
-            ;;
-        -srcDoc|-help)
-            echo "${indent1}-srcDoc|-help)"
-            echo "${indent2}COMPREPLY=()"
-            echo "${indent2};;"
-            ;;
-        -time)
-            echo "${indent1}-time)"
-            echo "${indent2}COMPREPLY=(\$(compgen -d -X '![-0-9]*' -- \${cur}))"
-            echo "${indent2};;"
-            ;;
-        -region)
-            echo "${indent1}-region)"
-            echo "${indent2}local regions=\$(sed 's#/##g' <<< \$([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))"
-            echo "${indent2}COMPREPLY=(\$(compgen -W \"\$regions\" -- \${cur}))"
-            echo "${indent2};;"
-            ;;
-        *Dict)
-            echo "${indent1}*Dict)"
-#           echo "${indent2}local dirs=\$(\ls -d s*/)"
-#           echo "${indent2}local files=\$(\ls -f | grep Dict)"
-#           echo "${indent2}COMPREPLY=(\$(compgen -W \"\$dirs \$files\" -- \${cur}))"
-            echo "${indent2}COMPREPLY=(\$(compgen -f -- \${cur}))"
-            echo "${indent2};;"
-            ;;
-        esac
-    done
-}
-
-
-#------------------------------------------------------------------------------
-
-for dir in ${searchDirs}
-do
-    if [ -d "$dir" ]
-    then
-        echo "Processing directory $dir" 1>&2
-    else
-        echo "No such directory: $dir" 1>&2
-        continue
-    fi
-
-    # Sort with ignore-case
-    set -- $(\ls $dir | sort -f)
-    for appName
-    do
-        [ -f "$dir/$appName" -a -x "$dir/$appName" ] || continue
-        appHelp=$($appName -help)
-
-        echo "    $appName" 1>&2
-
-        # Options with args
-        optsWithArgs=($(awk '/^ {0,4}-[a-z]/ && /</ {print $1}' <<< "$appHelp"))
-
-        # Options without args
-        opts=($(awk '/^ {0,4}-[a-z]/ && !/</ {print $1}' <<< "$appHelp"))
-
-        cat << WRITECOMPLETION >> $outFile
-unset -f _of_${appName} 2>/dev/null
-_of_${appName}()
-{
-    local cur="\${COMP_WORDS[COMP_CWORD]}"
-    local prev="\${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="${opts[@]} "
-    local optsWithArgs="${optsWithArgs[@]} "
-
-    case \${prev} in
-$(commonOptions ${optsWithArgs[@]})
-    *)
-        if [ "\${optsWithArgs/\${prev} /}" != "\${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=(\$(compgen -f -- \${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=\$(_of_filter_opts "\${opts}" "\${COMP_LINE}")
-            optsWithArgs=\$(_of_filter_opts "\${optsWithArgs}" "\${COMP_LINE}")
-            COMPREPLY=(\$(compgen -W "\${opts} \${optsWithArgs}" -- \${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_${appName} $appName
-
-WRITECOMPLETION
-    done
-done
-
-
-# Generate footer
-cat << FOOTER >> $outFile
-
-#------------------------------------------------------------------------------
-FOOTER
-
-#------------------------------------------------------------------------------
diff --git a/bin/tools/foamCreateCompletionCache b/bin/tools/foamCreateCompletionCache
new file mode 100755
index 0000000000000000000000000000000000000000..48f1e3449a4dee43b40aae0129890c013a2c2a03
--- /dev/null
+++ b/bin/tools/foamCreateCompletionCache
@@ -0,0 +1,199 @@
+#!/bin/bash
+#------------------------------------------------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2017 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# License
+#     This file is part of OpenFOAM.
+#
+#     OpenFOAM is free software: you can redistribute it and/or modify it
+#     under the terms of the GNU General Public License as published by
+#     the Free Software Foundation, either version 3 of the License, or
+#     (at your option) any later version.
+#
+#     OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+#     ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+#     FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+#     for more details.
+#
+#     You should have received a copy of the GNU General Public License
+#     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
+#
+# Script
+#     foamCreateCompletionCache
+#
+# Description
+#     Create cache of bash completion values for OpenFOAM applications
+#     The cached values are typically used by the tcsh completion wrapper.
+#
+#------------------------------------------------------------------------------
+defaultOutputFile="$WM_PROJECT_DIR/etc/config.sh/completion_cache"
+
+usage() {
+    exec 1>&2
+    while [ "$#" -ge 1 ]; do echo "$1"; shift; done
+    cat<<USAGE
+
+Usage: ${0##*/} [OPTION] [appName .. [appNameN]]
+options:
+  -d dir | -dir dir   Directory to process
+  -u | -user          Add \$FOAM_USER_APPBIN to the search directories
+  -no-header          Suppress header generation
+  -o FILE             Write to alternative output
+  -h | -help          Print the usage
+
+Create cache of bash completion values for OpenFOAM applications.
+The cached values are typically used by the tcsh completion wrapper.
+Default search: \$FOAM_APPBIN only.
+Default output: $defaultOutputFile
+
+Uses the search directory if applications are specified.
+
+USAGE
+    exit 1
+}
+
+# Report error and exit
+die()
+{
+    exec 1>&2
+    echo
+    echo "Error encountered:"
+    while [ "$#" -ge 1 ]; do echo "    $1"; shift; done
+    echo
+    echo "See '${0##*/} -help' for usage"
+    echo
+    exit 1
+}
+
+#-------------------------------------------------------------------------------
+
+searchDirs="$FOAM_APPBIN"
+optHeader=true
+unset outputFile
+while [ "$#" -gt 0 ]
+do
+    case "$1" in
+    -h | -help)
+        usage
+        ;;
+    -d | -dir)
+        [ "$#" -ge 2 ] || die "'$1' option requires an argument"
+        searchDirs="$2"
+        [ -d "$searchDirs" ] || die "directory not found '$searchDirs'"
+        shift
+        ;;
+    -u | -user)
+        searchDirs="$searchDirs $FOAM_USER_APPBIN"
+        ;;
+    -no-head*)
+        optHeader=false
+        ;;
+    -o | -output)
+        [ "$#" -ge 2 ] || die "'$1' option requires an argument"
+        outputFile="$2"
+        shift
+        ;;
+    -*)
+        usage "unknown option: '$1'"
+        ;;
+    *)
+        break
+        ;;
+    esac
+    shift
+done
+
+: ${outputFile:=$defaultOutputFile}
+
+# Verify that output is writeable
+if [ -e "$outputFile" ]
+then
+    [ -f "$outputFile" ] || \
+        die "Cannot overwrite $outputFile" "Not a file"
+    [ -w "$outputFile" ] || \
+        die "Cannot overwrite $outputFile" "No permission?"
+else
+    [ -w "$(dirname $outputFile)" ] || \
+        die "Cannot write $outputFile" "directory is not writeble"
+fi
+
+exec 1>| $outputFile || exit $?
+echo "Writing $outputFile" 1>&2
+echo 1>&2
+
+# Header not disabled
+[ "$optHeader" = true ] && cat << HEADER
+#----------------------------------*-sh-*--------------------------------------
+# Cached options for bash completion of OpenFOAM applications.
+# These are the values expected by the '_of_complete_' function
+#
+# Recreate with "${0##*/}"
+
+# Global associative array (cached options for OpenFOAM applications)
+declare -gA _of_complete_cache_;
+
+# Clear existing cache.
+_of_complete_cache_=()
+
+#------------------------------------------------------------------------------
+HEADER
+
+#-------------------------------------------------------------------------------
+
+# Scans the output of the application -help to detect options with/without
+# arguments.  Dispatch via _of_complete_
+#
+extractOptions()
+{
+    local appName="$1"
+    local helpText=$($appName -help 2>/dev/null | sed -ne '/^  *-/p')
+
+    [ -n "$helpText" ] || {
+        echo "Error calling $appName" 1>&2
+        return 1
+    }
+
+    # Array of options with args
+    local argOpts=($(awk '/^ {0,4}-[a-z]/ && /</ {print $1}' <<< "$helpText"))
+
+    # Array of options without args
+    local boolOpts=($(awk '/^ {0,4}-[a-z]/ && !/</ {print $1}' <<< "$helpText"))
+
+    appName="${appName##*/}"
+    echo "$appName" 1>&2
+    echo "_of_complete_cache_[${appName}]=\"${argOpts[@]} | ${boolOpts[@]}\""
+}
+#------------------------------------------------------------------------------
+
+[ "$#" -gt 0 ] || set -- ${searchDirs}
+
+for item
+do
+    if [ -d "$item" ]
+    then
+        # Process directory for applications - sort with ignore-case
+        echo "[directory] $item" 1>&2
+        choices="$(find $item -maxdepth 1 -executable -type f | sort -f 2>/dev/null)"
+        for appName in $choices
+        do
+            extractOptions $appName
+        done
+    elif command -v "$item" > /dev/null 2>&1
+    then
+        extractOptions $item
+    else
+        echo "No such file or directory: $item" 1>&2
+    fi
+done
+
+# Generate footer
+[ "$optHeader" = true ] && cat << FOOTER
+
+#------------------------------------------------------------------------------
+FOOTER
+
+#------------------------------------------------------------------------------
diff --git a/etc/bashrc b/etc/bashrc
index 97c8152b33379af199a35700b5cb6b3f8fc053f6..e2e887ac646048ac52fa5f7ef0845474bc7f4bec 100644
--- a/etc/bashrc
+++ b/etc/bashrc
@@ -175,9 +175,9 @@ then
     _foamEtc config.sh/aliases
 
     # Bash completions
-    if command -v complete > /dev/null 2>&1
+    if [ "${BASH_VERSINFO:-0}" -ge 4 ]
     then
-        _foamEtc config.sh/bashcompletion
+        _foamEtc config.sh/bash_completion
     fi
 fi
 
diff --git a/etc/config.csh/complete-wrapper b/etc/config.csh/complete-wrapper
new file mode 100644
index 0000000000000000000000000000000000000000..8fbbdffac6766c134c7405aa2374be485d5a9dc7
--- /dev/null
+++ b/etc/config.csh/complete-wrapper
@@ -0,0 +1,102 @@
+#!bash
+#----------------------------------*-sh-*--------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2017 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# This file is part of OpenFOAM, licensed under the GNU General Public License
+# <http://www.gnu.org/licenses/>.
+#
+# File
+#     etc/config.csh/complete-wrapper
+#
+# Description
+#     A wrapper for using OpenFOAM bash completions with tcsh.
+#
+# Arguments
+#     appName = the application name
+#
+# Environment
+#     The tcsh COMMAND_LINE is passed in via the environment.
+#     This corresponds to the bash COMP_LINE variable
+#
+#------------------------------------------------------------------------------
+[ "$#" -ge 1 ] || exit 1
+
+# Support '-test' option to check bash version
+if [ "$1" = "-test" ]
+then
+    # Uses 'declare -gA' for the implementation
+    # The '-A' requires bash >= 4.0 and the '-g' requires bash >= 4.2
+    [ "${BASH_VERSINFO[0]:-0}${BASH_VERSINFO[1]:-0}" -ge 42 ]
+    exit $?
+fi
+
+# Preload completion cache
+if [ -f $WM_PROJECT_DIR/etc/config.sh/completion_cache ]
+then  . $WM_PROJECT_DIR/etc/config.sh/completion_cache
+fi
+
+# Use the bash completion function, but retain cache etc.
+_of_complete_tcsh=true
+if [ -f $WM_PROJECT_DIR/etc/config.sh/bash_completion ]
+then  . $WM_PROJECT_DIR/etc/config.sh/bash_completion
+else
+    # Could warn about missing file, or treat silently
+    echo
+    exit 1
+fi
+
+appName=$1
+
+# Ensure COMP_LINE is available for bash function
+if [ "$#" -eq 2 ]
+then
+    COMP_LINE=$2
+else
+    COMP_LINE=$COMMAND_LINE
+fi
+
+# Remove the colon as a completion separator because tcsh cannot handle it
+COMP_WORDBREAKS=${COMP_WORDBREAKS//:}
+
+# Set COMP_WORDS in a way that can be handled by the bash script.
+COMP_WORDS=($COMP_LINE)
+
+# The cursor is at the end of parameter #1.
+# We must check for a space as the last character which will
+# tell us that the previous word is complete and the cursor
+# is on the next word.
+if [ "${COMP_LINE: -1}" = " " ]
+then
+    # The last character is a space, so our location is at the end
+    # of the command-line array
+    COMP_CWORD=${#COMP_WORDS[@]}
+else
+    # The last character is not a space, so our location is on the
+    # last word of the command-line array, so we must decrement the
+    # count by 1
+    COMP_CWORD=$((${#COMP_WORDS[@]}-1))
+fi
+
+# Call _of_complete_ APPNAME Current Previous
+_of_complete_ \
+    "$appName" "${COMP_WORDS[COMP_CWORD]}" "${COMP_WORDS[COMP_CWORD-1]}"
+
+# Tcsh needs slash on the end of directories
+reply=($(for i in ${COMPREPLY[@]}
+    do
+        if [ -d "$i" -a "${i#/}" = "$i" ]
+        then
+            echo "$i/"
+        else
+            echo "$i"
+        fi
+    done
+))
+
+echo ${reply[@]}
+
+#------------------------------------------------------------------------------
diff --git a/etc/config.csh/tcsh_completion b/etc/config.csh/tcsh_completion
new file mode 100644
index 0000000000000000000000000000000000000000..9dfcca704650699d808a11aabd486c2678d1b603
--- /dev/null
+++ b/etc/config.csh/tcsh_completion
@@ -0,0 +1,47 @@
+#----------------------------------*-sh-*--------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2017 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# This file is part of OpenFOAM, licensed under the GNU General Public License
+# <http://www.gnu.org/licenses/>.
+#
+# File
+#     etc/config.csh/tcsh_completion
+#
+# Description
+#     Tcsh completions for OpenFOAM applications
+#     Using bash completion for the hard work
+#
+# Requires
+#     bash 4.2 or newer
+#
+#------------------------------------------------------------------------------
+
+if ($?tcsh) then  # tcsh only
+
+    # Remove old completions, which look like:
+    #   complete APPNAME 'p,*,`bash $WM_PROJECT_DIR/etc/ ...
+    foreach appName (`complete | sed -ne '/WM_PROJECT/s/\t.*$//p'`)
+        uncomplete $appName
+    end
+
+    # Generate completions for predefined directories (if support is possible)
+    bash $WM_PROJECT_DIR/etc/config.csh/complete-wrapper -test
+    if ($status == 0) then
+        foreach dirName ("$FOAM_APPBIN")
+            if ( ! -d $dirName ) continue
+            foreach appName (`find $dirName -maxdepth 1 -executable -type f`)
+                # Pass explicitly
+                ## complete $appName:t 'p,*,`bash $WM_PROJECT_DIR/etc/config.csh/complete-wrapper '$appName:t' "${COMMAND_LINE}"`,'
+                # Pass via environment
+                complete $appName:t 'p,*,`bash $WM_PROJECT_DIR/etc/config.csh/complete-wrapper '$appName:t'`,'
+            end
+        end
+    endif
+
+endif
+
+#------------------------------------------------------------------------------
diff --git a/etc/config.csh/unset b/etc/config.csh/unset
index 6f52ec8c426f91c2cebf6021a54a044cba542ae8..20f7c9eb6df633eba43b35fa4755bda3835de18c 100644
--- a/etc/config.csh/unset
+++ b/etc/config.csh/unset
@@ -196,6 +196,14 @@ unalias wmRefresh
 unalias foamVersion
 unalias foamPV
 
+# Remove old completions, which look like:
+#   complete APPNAME 'p,*,`bash $WM_PROJECT_DIR/etc/ ...
+if ($?prompt && $?tcsh) then  # Interactive tcsh only
+    foreach cleaned (`complete | sed -ne '/WM_PROJECT/s/\t.*$//p'`)
+        uncomplete $cleaned
+    end
+endif
+
 #------------------------------------------------------------------------------
 # Intermediate variables (do as last for a clean exit code)
 
diff --git a/etc/config.sh/bash_completion b/etc/config.sh/bash_completion
new file mode 100644
index 0000000000000000000000000000000000000000..8d671ee9f7dcaf8ae1885200b413f4f0c56fd8ef
--- /dev/null
+++ b/etc/config.sh/bash_completion
@@ -0,0 +1,227 @@
+#----------------------------------*-sh-*--------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2017 OpenCFD Ltd.
+#    \\/     M anipulation  |
+#------------------------------------------------------------------------------
+# This file is part of OpenFOAM, licensed under the GNU General Public License
+# <http://www.gnu.org/licenses/>.
+#
+# File
+#     etc/config.sh/bash_completion
+#
+# Description
+#     Bash completion handler for OpenFOAM applications and automatic
+#     generation of completion associations
+#
+# Provides
+#     foamAddCompletion
+#     _of_complete_
+#
+# Uses
+#     _of_complete_cache_
+#
+# Requires
+#     bash 4.2 or newer
+#
+#------------------------------------------------------------------------------
+
+# Remove old completions (skip for tcsh wrapper), which look like:
+#     "complete ... -F _of_complete_ APPNAME
+if [ -z "$_of_complete_tcsh" ]
+then
+    # For economy, obtain list first
+    foamOldDirs="$(complete 2>/dev/null | sed -ne 's/^.*-F _of_.* \(..*\)$/\1/p')"
+    for cleaned in $foamOldDirs
+    do
+        complete -r $cleaned 2>/dev/null
+    done
+fi
+
+
+# Add completion for command or directory of commands
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+unset -f foamAddCompletion 2>/dev/null
+foamAddCompletion()
+{
+    [ "$#" -gt 0 ] || \
+        echo "Usage: foamAddCompletion -clear | -list | dir(s) | app(s)" 1>&2
+
+    local appName choices
+    for appName
+    do
+        if [ "$appName" = "-clear" ]
+        then
+           # Clear cached values
+           echo "clear cached values"
+           _of_complete_cache_=()
+
+        elif [ "$appName" = "-list" ]
+        then
+           # List cached keys
+           choices="${#_of_complete_cache_[@]}"
+           echo "$choices cached values:"
+           [ "$choices" = 0 ] || echo ${!_of_complete_cache_[@]}  # keys
+
+        elif [ -d "$appName" ]
+        then
+            # Process directory for applications
+            choices="$(find $appName -maxdepth 1 -executable -type f 2>/dev/null)"
+            for appName in $choices
+            do
+                complete -o filenames -F _of_complete_ "${appName##*/}"
+                # echo "complete ${appName##*/}" 1>&2
+            done
+
+        elif command -v "$appName" > /dev/null 2>&1
+        then
+            complete -o filenames -F _of_complete_ "${appName##*/}"
+            # echo "complete ${appName##*/}" 1>&2
+        else
+            echo "No completion added for $appName" 1>&2
+        fi
+    done
+}
+
+
+# Generic completion handler for OpenFOAM applications
+#
+# Dispatch via "complete ... -F _of_complete_ APPNAME
+# - arg1 = command-name
+# - arg2 = current word
+# - arg3 = previous word
+#
+# The respective options are generated on-the-fly from the application's -help
+# output and cached to the _of_complete_cache_ global associative array with
+# entries formatted as "argOpts.. | boolOpts ..".
+# The '|' character separates options with and without arguments.
+#
+unset -f _of_complete_ 2>/dev/null
+_of_complete_()
+{
+    local appName=$1
+    local cur=$2
+    local prev=$3
+    local choices
+
+    case ${prev} in
+    -help|-doc|-srcDoc)
+        # These options are usage - we can stop now.
+        COMPREPLY=()
+        return 0
+        ;;
+    -case)
+        COMPREPLY=($(compgen -d -- ${cur}))
+        ;;
+    -time)
+        # Could use "foamListTimes -withZero", but still doesn't address ranges
+        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
+        ;;
+    -region)
+        choices=$(\ls -d system/*/ 2>/dev/null | sed -e 's#/$##' -e 's#^.*/##')
+        COMPREPLY=($(compgen -W "$choices" -- ${cur}))
+        ;;
+    -fileHandler)
+        choices="collated uncollated masterUncollated"
+        COMPREPLY=($(compgen -W "$choices" -- ${cur}))
+        ;;
+    *)
+        # All options
+        choices="${_of_complete_cache_[$appName]}"
+
+        # Not in cache, obtain by parsing application -help
+        if [ -z "$choices" ]
+        then
+            local helpText=$($appName -help 2>/dev/null | sed -ne '/^  *-/p')
+
+            if [ -n "$helpText" ]
+            then
+                # Array of options with args
+                local argOpts=($(awk '/^ {0,4}-[a-z]/ && /</ {print $1}' <<< "$helpText"))
+
+                # Array of options without args
+                local boolOpts=($(awk '/^ {0,4}-[a-z]/ && !/</ {print $1}' <<< "$helpText"))
+
+                choices="${argOpts[@]} | ${boolOpts[@]}"
+            else
+                echo "Error calling $appName" 1>&2
+                choices="false"  # Mark failure to prevent repeating again
+            fi
+            _of_complete_cache_[$appName]="$choices"
+            ## echo "generated $appName = $choices" 1>&2   # Debugging
+        fi
+        if [ "${choices:-false}" = false ]
+        then
+            COMPREPLY=($(compgen -f -- ${cur}))
+        else
+            # Everything before the '|' ==> options with args.
+            local argOpts="${choices%|*}"
+
+            if [ "${argOpts/${prev} /}" != "${argOpts}" ]
+            then
+                # Option with unknown type of arg - set to files.
+                # Not always correct but can still navigate path if needed...
+                COMPREPLY=($(compgen -f -- ${cur}))
+            elif [ -n "$cur" -a "${cur#-}" = "${cur}" ]
+            then
+                # Already started a (non-empty) word that isn't an option,
+                # in which case revert to filenames.
+                COMPREPLY=($(compgen -f -- ${cur}))
+            else
+                # Catchall
+                # - Present remaining options (not already seen in $COMP_LINE)
+                choices=$(
+                    for o in ${choices}
+                    do
+                        [ "${COMP_LINE/$o/}" = "${COMP_LINE}" ] && echo "${o#|}"
+                    done
+                )
+
+                COMPREPLY=($(compgen -W "$choices" -- ${cur}))
+            fi
+        fi
+        ;;
+    esac
+
+    return 0
+}
+
+#------------------------------------------------------------------------------
+
+
+# Uses 'declare -gA' for the implementation
+# The '-A' requires bash >= 4.0 and the '-g' requires bash >= 4.2
+if [ "${BASH_VERSINFO[0]:-0}${BASH_VERSINFO[1]:-0}" -ge 42 ]
+then
+    # Global associative array (cached options for OpenFOAM applications)
+    declare -gA _of_complete_cache_;
+
+    # Clear existing cache and reassign bash completions.
+    # But for tcsh wrapper make use of caching and avoid this overhead.
+    if [ -z "$_of_complete_tcsh" ]
+    then
+        _of_complete_cache_=()
+
+        # Generate completions for predefined directories
+        foamAddCompletion $FOAM_APPBIN
+    fi
+else
+    # Bash version is too old.
+    ## echo "No bash completions - requires bash >= 4.2" 1>&2
+
+    unset -f foamAddCompletion 2>/dev/null
+    foamAddCompletion()
+    {
+        echo "foamAddCompletion disabled - requires bash >= 4.2" 1>&2
+    }
+
+    unset -f _of_complete_ 2>/dev/null
+fi
+
+#------------------------------------------------------------------------------
+# Intermediate variables (do as last for a clean exit code)
+
+unset cleaned foamOldDirs
+
+#------------------------------------------------------------------------------
diff --git a/etc/config.sh/bashcompletion b/etc/config.sh/bashcompletion
deleted file mode 100644
index b2e723b7933e49af93ce7e69a77c3310caa018fb..0000000000000000000000000000000000000000
--- a/etc/config.sh/bashcompletion
+++ /dev/null
@@ -1,8546 +0,0 @@
-#----------------------------------*-sh-*--------------------------------------
-# Bash completions for OpenFOAM applications
-# Formatted as "complete ... -F _of_APPNAME APPNAME
-
-unset -f _of_filter_opts 2>/dev/null
-_of_filter_opts()
-{
-    local allOpts=$1
-    local applied=$2
-    for o in ${allOpts}; do
-        [ "${applied/$o/}" == "${applied}" ] && echo $o
-    done
-}
-
-unset -f _of_adiabaticFlameT 2>/dev/null
-_of_adiabaticFlameT()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_adiabaticFlameT adiabaticFlameT
-
-unset -f _of_adjointShapeOptimizationFoam 2>/dev/null
-_of_adjointShapeOptimizationFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_adjointShapeOptimizationFoam adjointShapeOptimizationFoam
-
-unset -f _of_ansysToFoam 2>/dev/null
-_of_ansysToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -scale "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_ansysToFoam ansysToFoam
-
-unset -f _of_applyBoundaryLayer 2>/dev/null
-_of_applyBoundaryLayer()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -roots -ybl "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_applyBoundaryLayer applyBoundaryLayer
-
-unset -f _of_attachMesh 2>/dev/null
-_of_attachMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -overwrite -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_attachMesh attachMesh
-
-unset -f _of_autoPatch 2>/dev/null
-_of_autoPatch()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -overwrite -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_autoPatch autoPatch
-
-unset -f _of_blockMesh 2>/dev/null
-_of_blockMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-blockTopology -noClean -noFunctionObjects -sets -srcDoc -doc -help "
-    local optsWithArgs="-case -dict -region "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_blockMesh blockMesh
-
-unset -f _of_boundaryFoam 2>/dev/null
-_of_boundaryFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_boundaryFoam boundaryFoam
-
-unset -f _of_boxTurb 2>/dev/null
-_of_boxTurb()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_boxTurb boxTurb
-
-unset -f _of_buoyantBoussinesqPimpleFoam 2>/dev/null
-_of_buoyantBoussinesqPimpleFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_buoyantBoussinesqPimpleFoam buoyantBoussinesqPimpleFoam
-
-unset -f _of_buoyantBoussinesqSimpleFoam 2>/dev/null
-_of_buoyantBoussinesqSimpleFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_buoyantBoussinesqSimpleFoam buoyantBoussinesqSimpleFoam
-
-unset -f _of_buoyantPimpleFoam 2>/dev/null
-_of_buoyantPimpleFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_buoyantPimpleFoam buoyantPimpleFoam
-
-unset -f _of_buoyantSimpleFoam 2>/dev/null
-_of_buoyantSimpleFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_buoyantSimpleFoam buoyantSimpleFoam
-
-unset -f _of_cavitatingDyMFoam 2>/dev/null
-_of_cavitatingDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_cavitatingDyMFoam cavitatingDyMFoam
-
-unset -f _of_cavitatingFoam 2>/dev/null
-_of_cavitatingFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_cavitatingFoam cavitatingFoam
-
-unset -f _of_cfx4ToFoam 2>/dev/null
-_of_cfx4ToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -scale "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_cfx4ToFoam cfx4ToFoam
-
-unset -f _of_changeDictionary 2>/dev/null
-_of_changeDictionary()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -disablePatchGroups -enableFunctionEntries -latestTime -literalRE -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -dict -instance -region -roots -subDict -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_changeDictionary changeDictionary
-
-unset -f _of_checkMesh 2>/dev/null
-_of_checkMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-allGeometry -allTopology -constant -latestTime -meshQuality -newTimes -noFunctionObjects -noTopology -noZero -parallel -writeAllFields -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -roots -time -writeFields -writeSets "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_checkMesh checkMesh
-
-unset -f _of_chemFoam 2>/dev/null
-_of_chemFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_chemFoam chemFoam
-
-unset -f _of_chemkinToFoam 2>/dev/null
-_of_chemkinToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-newFormat -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_chemkinToFoam chemkinToFoam
-
-unset -f _of_chtMultiRegionFoam 2>/dev/null
-_of_chtMultiRegionFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_chtMultiRegionFoam chtMultiRegionFoam
-
-unset -f _of_chtMultiRegionSimpleFoam 2>/dev/null
-_of_chtMultiRegionSimpleFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_chtMultiRegionSimpleFoam chtMultiRegionSimpleFoam
-
-unset -f _of_coalChemistryFoam 2>/dev/null
-_of_coalChemistryFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_coalChemistryFoam coalChemistryFoam
-
-unset -f _of_coldEngineFoam 2>/dev/null
-_of_coldEngineFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_coldEngineFoam coldEngineFoam
-
-unset -f _of_collapseEdges 2>/dev/null
-_of_collapseEdges()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-collapseFaces -constant -latestTime -newTimes -noFunctionObjects -noZero -overwrite -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -collapseFaceSet -decomposeParDict -dict -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_collapseEdges collapseEdges
-
-unset -f _of_combinePatchFaces 2>/dev/null
-_of_combinePatchFaces()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-meshQuality -noFunctionObjects -overwrite -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -concaveAngle -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_combinePatchFaces combinePatchFaces
-
-unset -f _of_compressibleInterDyMFoam 2>/dev/null
-_of_compressibleInterDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_compressibleInterDyMFoam compressibleInterDyMFoam
-
-unset -f _of_compressibleInterFoam 2>/dev/null
-_of_compressibleInterFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_compressibleInterFoam compressibleInterFoam
-
-unset -f _of_compressibleMultiphaseInterFoam 2>/dev/null
-_of_compressibleMultiphaseInterFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_compressibleMultiphaseInterFoam compressibleMultiphaseInterFoam
-
-unset -f _of_createBaffles 2>/dev/null
-_of_createBaffles()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -dict -region -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_createBaffles createBaffles
-
-unset -f _of_createExternalCoupledPatchGeometry 2>/dev/null
-_of_createExternalCoupledPatchGeometry()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -commsDir -decomposeParDict -region -regions -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_createExternalCoupledPatchGeometry createExternalCoupledPatchGeometry
-
-unset -f _of_createPatch 2>/dev/null
-_of_createPatch()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -overwrite -parallel -writeObj -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -dict -region -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_createPatch createPatch
-
-unset -f _of_createZeroDirectory 2>/dev/null
-_of_createZeroDirectory()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots -templateDir "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_createZeroDirectory createZeroDirectory
-
-unset -f _of_datToFoam 2>/dev/null
-_of_datToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_datToFoam datToFoam
-
-unset -f _of_decomposePar 2>/dev/null
-_of_decomposePar()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-allRegions -cellDist -constant -copyUniform -copyZero -fields -force -ifRequired -latestTime -newTimes -noFunctionObjects -noSets -noZero -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_decomposePar decomposePar
-
-unset -f _of_deformedGeom 2>/dev/null
-_of_deformedGeom()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_deformedGeom deformedGeom
-
-unset -f _of_dnsFoam 2>/dev/null
-_of_dnsFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_dnsFoam dnsFoam
-
-unset -f _of_DPMDyMFoam 2>/dev/null
-_of_DPMDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -cloudName -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_DPMDyMFoam DPMDyMFoam
-
-unset -f _of_DPMFoam 2>/dev/null
-_of_DPMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -cloud -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_DPMFoam DPMFoam
-
-unset -f _of_driftFluxFoam 2>/dev/null
-_of_driftFluxFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_driftFluxFoam driftFluxFoam
-
-unset -f _of_dsmcFoam 2>/dev/null
-_of_dsmcFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_dsmcFoam dsmcFoam
-
-unset -f _of_dsmcInitialise 2>/dev/null
-_of_dsmcInitialise()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_dsmcInitialise dsmcInitialise
-
-unset -f _of_electrostaticFoam 2>/dev/null
-_of_electrostaticFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_electrostaticFoam electrostaticFoam
-
-unset -f _of_engineCompRatio 2>/dev/null
-_of_engineCompRatio()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_engineCompRatio engineCompRatio
-
-unset -f _of_engineFoam 2>/dev/null
-_of_engineFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_engineFoam engineFoam
-
-unset -f _of_engineSwirl 2>/dev/null
-_of_engineSwirl()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_engineSwirl engineSwirl
-
-unset -f _of_equilibriumCO 2>/dev/null
-_of_equilibriumCO()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_equilibriumCO equilibriumCO
-
-unset -f _of_equilibriumFlameT 2>/dev/null
-_of_equilibriumFlameT()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_equilibriumFlameT equilibriumFlameT
-
-unset -f _of_extrude2DMesh 2>/dev/null
-_of_extrude2DMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_extrude2DMesh extrude2DMesh
-
-unset -f _of_extrudeMesh 2>/dev/null
-_of_extrudeMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_extrudeMesh extrudeMesh
-
-unset -f _of_extrudeToRegionMesh 2>/dev/null
-_of_extrudeToRegionMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -dict -region -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_extrudeToRegionMesh extrudeToRegionMesh
-
-unset -f _of_faceAgglomerate 2>/dev/null
-_of_faceAgglomerate()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -dict -region -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_faceAgglomerate faceAgglomerate
-
-unset -f _of_financialFoam 2>/dev/null
-_of_financialFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_financialFoam financialFoam
-
-unset -f _of_fireFoam 2>/dev/null
-_of_fireFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_fireFoam fireFoam
-
-unset -f _of_fireToFoam 2>/dev/null
-_of_fireToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-ascii -check -noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -scale "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_fireToFoam fireToFoam
-
-unset -f _of_flattenMesh 2>/dev/null
-_of_flattenMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_flattenMesh flattenMesh
-
-unset -f _of_fluent3DMeshToFoam 2>/dev/null
-_of_fluent3DMeshToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-cubit -noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -ignoreCellGroups -ignoreFaceGroups -scale "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_fluent3DMeshToFoam fluent3DMeshToFoam
-
-unset -f _of_fluentMeshToFoam 2>/dev/null
-_of_fluentMeshToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -writeSets -writeZones -srcDoc -doc -help "
-    local optsWithArgs="-case -scale "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_fluentMeshToFoam fluentMeshToFoam
-
-unset -f _of_foamDataToFluent 2>/dev/null
-_of_foamDataToFluent()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help "
-    local optsWithArgs="-case -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamDataToFluent foamDataToFluent
-
-unset -f _of_foamDictionary 2>/dev/null
-_of_foamDictionary()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-disableFunctionEntries -expand -includes -keywords -noFunctionObjects -parallel -remove -value -srcDoc -doc -help "
-    local optsWithArgs="-add -case -decomposeParDict -diff -entry -roots -set "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamDictionary foamDictionary
-
-unset -f _of_foamFormatConvert 2>/dev/null
-_of_foamFormatConvert()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -enableFunctionEntries -latestTime -newTimes -noConstant -noFunctionObjects -noZero -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamFormatConvert foamFormatConvert
-
-unset -f _of_foamHelp 2>/dev/null
-_of_foamHelp()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamHelp foamHelp
-
-unset -f _of_foamList 2>/dev/null
-_of_foamList()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-compressibleTurbulenceModels -functionObjects -fvOptions -incompressibleTurbulenceModels -noFunctionObjects -registeredSwitches -switches -unset -srcDoc -doc -help "
-    local optsWithArgs="-case -scalarBCs -vectorBCs "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamList foamList
-
-unset -f _of_foamListTimes 2>/dev/null
-_of_foamListTimes()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -processor -rm -withZero -srcDoc -doc -help "
-    local optsWithArgs="-case -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamListTimes foamListTimes
-
-unset -f _of_foamMeshToFluent 2>/dev/null
-_of_foamMeshToFluent()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamMeshToFluent foamMeshToFluent
-
-unset -f _of_foamToEnsight 2>/dev/null
-_of_foamToEnsight()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-ascii -constant -latestTime -newTimes -noFunctionObjects -noLagrangian -noPatches -noZero -nodeValues -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -cellZone -decomposeParDict -faceZones -fields -name -patches -region -roots -time -width "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamToEnsight foamToEnsight
-
-unset -f _of_foamToEnsightParts 2>/dev/null
-_of_foamToEnsightParts()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-ascii -constant -latestTime -newTimes -noFunctionObjects -noLagrangian -noMesh -noZero -srcDoc -doc -help "
-    local optsWithArgs="-case -index -name -time -width "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamToEnsightParts foamToEnsightParts
-
-unset -f _of_foamToFireMesh 2>/dev/null
-_of_foamToFireMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-ascii -constant -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help "
-    local optsWithArgs="-case -scale -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamToFireMesh foamToFireMesh
-
-unset -f _of_foamToGMV 2>/dev/null
-_of_foamToGMV()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamToGMV foamToGMV
-
-unset -f _of_foamToStarMesh 2>/dev/null
-_of_foamToStarMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -latestTime -newTimes -noBnd -noFunctionObjects -noZero -srcDoc -doc -help "
-    local optsWithArgs="-case -scale -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamToStarMesh foamToStarMesh
-
-unset -f _of_foamToSurface 2>/dev/null
-_of_foamToSurface()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -tri -srcDoc -doc -help "
-    local optsWithArgs="-case -scale -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamToSurface foamToSurface
-
-unset -f _of_foamToTetDualMesh 2>/dev/null
-_of_foamToTetDualMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -latestTime -noFunctionObjects -noZero -overwrite -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamToTetDualMesh foamToTetDualMesh
-
-unset -f _of_foamToVTK 2>/dev/null
-_of_foamToVTK()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-allPatches -ascii -constant -latestTime -nearCellValue -newTimes -noFaceZones -noFunctionObjects -noInternal -noLagrangian -noLinks -noPointValues -noZero -parallel -poly -surfaceFields -useTimeName -xml -srcDoc -doc -help "
-    local optsWithArgs="-case -cellSet -decomposeParDict -excludePatches -faceSet -fields -name -pointSet -region -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamToVTK foamToVTK
-
-unset -f _of_foamUpgradeCyclics 2>/dev/null
-_of_foamUpgradeCyclics()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -enableFunctionEntries -latestTime -newTimes -noFunctionObjects -noZero -parallel -test -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamUpgradeCyclics foamUpgradeCyclics
-
-unset -f _of_foamyHexMesh 2>/dev/null
-_of_foamyHexMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-checkGeometry -conformationOnly -noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamyHexMesh foamyHexMesh
-
-unset -f _of_foamyQuadMesh 2>/dev/null
-_of_foamyQuadMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -overwrite -srcDoc -doc -help "
-    local optsWithArgs="-case -pointsFile "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_foamyQuadMesh foamyQuadMesh
-
-unset -f _of_gambitToFoam 2>/dev/null
-_of_gambitToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -scale "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_gambitToFoam gambitToFoam
-
-unset -f _of_gmshToFoam 2>/dev/null
-_of_gmshToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-keepOrientation -noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -region "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_gmshToFoam gmshToFoam
-
-unset -f _of_icoFoam 2>/dev/null
-_of_icoFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_icoFoam icoFoam
-
-unset -f _of_icoUncoupledKinematicParcelDyMFoam 2>/dev/null
-_of_icoUncoupledKinematicParcelDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -cloud -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_icoUncoupledKinematicParcelDyMFoam icoUncoupledKinematicParcelDyMFoam
-
-unset -f _of_icoUncoupledKinematicParcelFoam 2>/dev/null
-_of_icoUncoupledKinematicParcelFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -cloud -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_icoUncoupledKinematicParcelFoam icoUncoupledKinematicParcelFoam
-
-unset -f _of_ideasUnvToFoam 2>/dev/null
-_of_ideasUnvToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-dump -noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_ideasUnvToFoam ideasUnvToFoam
-
-unset -f _of_insideCells 2>/dev/null
-_of_insideCells()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_insideCells insideCells
-
-unset -f _of_interCondensatingEvaporatingFoam 2>/dev/null
-_of_interCondensatingEvaporatingFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_interCondensatingEvaporatingFoam interCondensatingEvaporatingFoam
-
-unset -f _of_interDyMFoam 2>/dev/null
-_of_interDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_interDyMFoam interDyMFoam
-
-unset -f _of_interFoam 2>/dev/null
-_of_interFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_interFoam interFoam
-
-unset -f _of_interIsoFoam 2>/dev/null
-_of_interIsoFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_interIsoFoam interIsoFoam
-
-unset -f _of_interMixingFoam 2>/dev/null
-_of_interMixingFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_interMixingFoam interMixingFoam
-
-unset -f _of_interPhaseChangeDyMFoam 2>/dev/null
-_of_interPhaseChangeDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_interPhaseChangeDyMFoam interPhaseChangeDyMFoam
-
-unset -f _of_interPhaseChangeFoam 2>/dev/null
-_of_interPhaseChangeFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_interPhaseChangeFoam interPhaseChangeFoam
-
-unset -f _of_kivaToFoam 2>/dev/null
-_of_kivaToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -file -version -zHeadMin "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_kivaToFoam kivaToFoam
-
-unset -f _of_laplacianFoam 2>/dev/null
-_of_laplacianFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_laplacianFoam laplacianFoam
-
-unset -f _of_lumpedPointForces 2>/dev/null
-_of_lumpedPointForces()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -latestTime -newTimes -noZero -parallel -vtk -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_lumpedPointForces lumpedPointForces
-
-unset -f _of_lumpedPointMovement 2>/dev/null
-_of_lumpedPointMovement()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-removeLock -slave -srcDoc -doc -help "
-    local optsWithArgs="-case -max -scale -span "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_lumpedPointMovement lumpedPointMovement
-
-unset -f _of_lumpedPointZones 2>/dev/null
-_of_lumpedPointZones()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-verbose -srcDoc -doc -help "
-    local optsWithArgs="-case -region "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_lumpedPointZones lumpedPointZones
-
-unset -f _of_magneticFoam 2>/dev/null
-_of_magneticFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noB -noFunctionObjects -noH -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_magneticFoam magneticFoam
-
-unset -f _of_mapFields 2>/dev/null
-_of_mapFields()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-consistent -noFunctionObjects -parallelSource -parallelTarget -subtract -srcDoc -doc -help "
-    local optsWithArgs="-case -mapMethod -sourceDecomposeParDict -sourceRegion -sourceTime -targetDecomposeParDict -targetRegion "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_mapFields mapFields
-
-unset -f _of_mapFieldsPar 2>/dev/null
-_of_mapFieldsPar()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-consistent -noFunctionObjects -noLagrangian -parallel -subtract -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -fields -mapMethod -patchMapMethod -roots -sourceRegion -sourceTime -targetRegion "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_mapFieldsPar mapFieldsPar
-
-unset -f _of_mdEquilibrationFoam 2>/dev/null
-_of_mdEquilibrationFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_mdEquilibrationFoam mdEquilibrationFoam
-
-unset -f _of_mdFoam 2>/dev/null
-_of_mdFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_mdFoam mdFoam
-
-unset -f _of_mdInitialise 2>/dev/null
-_of_mdInitialise()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_mdInitialise mdInitialise
-
-unset -f _of_mergeMeshes 2>/dev/null
-_of_mergeMeshes()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help "
-    local optsWithArgs="-addRegion -case -decomposeParDict -masterRegion -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_mergeMeshes mergeMeshes
-
-unset -f _of_mergeOrSplitBaffles 2>/dev/null
-_of_mergeOrSplitBaffles()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-detectOnly -noFunctionObjects -overwrite -parallel -split -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -dict -region -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_mergeOrSplitBaffles mergeOrSplitBaffles
-
-unset -f _of_mhdFoam 2>/dev/null
-_of_mhdFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_mhdFoam mhdFoam
-
-unset -f _of_mirrorMesh 2>/dev/null
-_of_mirrorMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_mirrorMesh mirrorMesh
-
-unset -f _of_mixtureAdiabaticFlameT 2>/dev/null
-_of_mixtureAdiabaticFlameT()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_mixtureAdiabaticFlameT mixtureAdiabaticFlameT
-
-unset -f _of_modifyMesh 2>/dev/null
-_of_modifyMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_modifyMesh modifyMesh
-
-unset -f _of_moveDynamicMesh 2>/dev/null
-_of_moveDynamicMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-checkAMI -noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_moveDynamicMesh moveDynamicMesh
-
-unset -f _of_moveEngineMesh 2>/dev/null
-_of_moveEngineMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_moveEngineMesh moveEngineMesh
-
-unset -f _of_moveMesh 2>/dev/null
-_of_moveMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_moveMesh moveMesh
-
-unset -f _of_MPPICDyMFoam 2>/dev/null
-_of_MPPICDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -cloudName -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_MPPICDyMFoam MPPICDyMFoam
-
-unset -f _of_MPPICFoam 2>/dev/null
-_of_MPPICFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -cloud -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_MPPICFoam MPPICFoam
-
-unset -f _of_MPPICInterFoam 2>/dev/null
-_of_MPPICInterFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_MPPICInterFoam MPPICInterFoam
-
-unset -f _of_mshToFoam 2>/dev/null
-_of_mshToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-hex -noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_mshToFoam mshToFoam
-
-unset -f _of_multiphaseEulerFoam 2>/dev/null
-_of_multiphaseEulerFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_multiphaseEulerFoam multiphaseEulerFoam
-
-unset -f _of_multiphaseInterDyMFoam 2>/dev/null
-_of_multiphaseInterDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_multiphaseInterDyMFoam multiphaseInterDyMFoam
-
-unset -f _of_multiphaseInterFoam 2>/dev/null
-_of_multiphaseInterFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_multiphaseInterFoam multiphaseInterFoam
-
-unset -f _of_netgenNeutralToFoam 2>/dev/null
-_of_netgenNeutralToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_netgenNeutralToFoam netgenNeutralToFoam
-
-unset -f _of_noise 2>/dev/null
-_of_noise()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -dict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_noise noise
-
-unset -f _of_nonNewtonianIcoFoam 2>/dev/null
-_of_nonNewtonianIcoFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_nonNewtonianIcoFoam nonNewtonianIcoFoam
-
-unset -f _of_objToVTK 2>/dev/null
-_of_objToVTK()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_objToVTK objToVTK
-
-unset -f _of_orientFaceZone 2>/dev/null
-_of_orientFaceZone()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_orientFaceZone orientFaceZone
-
-unset -f _of_overInterDyMFoam 2>/dev/null
-_of_overInterDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_overInterDyMFoam overInterDyMFoam
-
-unset -f _of_overLaplacianDyMFoam 2>/dev/null
-_of_overLaplacianDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_overLaplacianDyMFoam overLaplacianDyMFoam
-
-unset -f _of_overPimpleDyMFoam 2>/dev/null
-_of_overPimpleDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_overPimpleDyMFoam overPimpleDyMFoam
-
-unset -f _of_overRhoPimpleDyMFoam 2>/dev/null
-_of_overRhoPimpleDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_overRhoPimpleDyMFoam overRhoPimpleDyMFoam
-
-unset -f _of_overSimpleFoam 2>/dev/null
-_of_overSimpleFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_overSimpleFoam overSimpleFoam
-
-unset -f _of_particleTracks 2>/dev/null
-_of_particleTracks()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_particleTracks particleTracks
-
-unset -f _of_patchSummary 2>/dev/null
-_of_patchSummary()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -expand -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_patchSummary patchSummary
-
-unset -f _of_pdfPlot 2>/dev/null
-_of_pdfPlot()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_pdfPlot pdfPlot
-
-unset -f _of_PDRFoam 2>/dev/null
-_of_PDRFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_PDRFoam PDRFoam
-
-unset -f _of_PDRMesh 2>/dev/null
-_of_PDRMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_PDRMesh PDRMesh
-
-unset -f _of_pimpleDyMFoam 2>/dev/null
-_of_pimpleDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_pimpleDyMFoam pimpleDyMFoam
-
-unset -f _of_pimpleFoam 2>/dev/null
-_of_pimpleFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_pimpleFoam pimpleFoam
-
-unset -f _of_pisoFoam 2>/dev/null
-_of_pisoFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_pisoFoam pisoFoam
-
-unset -f _of_plot3dToFoam 2>/dev/null
-_of_plot3dToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noBlank -noFunctionObjects -singleBlock -srcDoc -doc -help "
-    local optsWithArgs="-case -scale "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_plot3dToFoam plot3dToFoam
-
-unset -f _of_polyDualMesh 2>/dev/null
-_of_polyDualMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-concaveMultiCells -doNotPreserveFaceZones -noFunctionObjects -overwrite -splitAllFaces -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_polyDualMesh polyDualMesh
-
-unset -f _of_porousSimpleFoam 2>/dev/null
-_of_porousSimpleFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_porousSimpleFoam porousSimpleFoam
-
-unset -f _of_postChannel 2>/dev/null
-_of_postChannel()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help "
-    local optsWithArgs="-case -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_postChannel postChannel
-
-unset -f _of_postProcess 2>/dev/null
-_of_postProcess()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -latestTime -list -newTimes -noFunctionObjects -noZero -parallel -profiling -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -dict -field -fields -func -funcs -region -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_postProcess postProcess
-
-unset -f _of_potentialFoam 2>/dev/null
-_of_potentialFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-initialiseUBCs -noFunctionObjects -parallel -withFunctionObjects -writePhi -writep -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -pName -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_potentialFoam potentialFoam
-
-unset -f _of_potentialFreeSurfaceDyMFoam 2>/dev/null
-_of_potentialFreeSurfaceDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_potentialFreeSurfaceDyMFoam potentialFreeSurfaceDyMFoam
-
-unset -f _of_potentialFreeSurfaceFoam 2>/dev/null
-_of_potentialFreeSurfaceFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_potentialFreeSurfaceFoam potentialFreeSurfaceFoam
-
-unset -f _of_reactingFoam 2>/dev/null
-_of_reactingFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_reactingFoam reactingFoam
-
-unset -f _of_reactingMultiphaseEulerFoam 2>/dev/null
-_of_reactingMultiphaseEulerFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_reactingMultiphaseEulerFoam reactingMultiphaseEulerFoam
-
-unset -f _of_reactingParcelFilmFoam 2>/dev/null
-_of_reactingParcelFilmFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_reactingParcelFilmFoam reactingParcelFilmFoam
-
-unset -f _of_reactingParcelFoam 2>/dev/null
-_of_reactingParcelFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_reactingParcelFoam reactingParcelFoam
-
-unset -f _of_reactingTwoPhaseEulerFoam 2>/dev/null
-_of_reactingTwoPhaseEulerFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_reactingTwoPhaseEulerFoam reactingTwoPhaseEulerFoam
-
-unset -f _of_reconstructPar 2>/dev/null
-_of_reconstructPar()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-allRegions -constant -latestTime -newTimes -noFields -noFunctionObjects -noLagrangian -noSets -noZero -withZero -srcDoc -doc -help "
-    local optsWithArgs="-case -fields -lagrangianFields -region -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_reconstructPar reconstructPar
-
-unset -f _of_reconstructParMesh 2>/dev/null
-_of_reconstructParMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-cellDist -constant -fullMatch -latestTime -newTimes -noFunctionObjects -noZero -withZero -srcDoc -doc -help "
-    local optsWithArgs="-case -mergeTol -region -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_reconstructParMesh reconstructParMesh
-
-unset -f _of_redistributePar 2>/dev/null
-_of_redistributePar()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-cellDist -constant -decompose -latestTime -newTimes -noFunctionObjects -noZero -overwrite -parallel -reconstruct -withZero -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -mergeTol -region -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_redistributePar redistributePar
-
-unset -f _of_refineHexMesh 2>/dev/null
-_of_refineHexMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-minSet -noFunctionObjects -overwrite -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_refineHexMesh refineHexMesh
-
-unset -f _of_refinementLevel 2>/dev/null
-_of_refinementLevel()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -readLevel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_refinementLevel refinementLevel
-
-unset -f _of_refineMesh 2>/dev/null
-_of_refineMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-all -noFunctionObjects -overwrite -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -dict -region -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_refineMesh refineMesh
-
-unset -f _of_refineWallLayer 2>/dev/null
-_of_refineWallLayer()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots -useSet "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_refineWallLayer refineWallLayer
-
-unset -f _of_removeFaces 2>/dev/null
-_of_removeFaces()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_removeFaces removeFaces
-
-unset -f _of_renumberMesh 2>/dev/null
-_of_renumberMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -frontWidth -latestTime -noFunctionObjects -noZero -overwrite -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -dict -region -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_renumberMesh renumberMesh
-
-unset -f _of_rhoCentralDyMFoam 2>/dev/null
-_of_rhoCentralDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_rhoCentralDyMFoam rhoCentralDyMFoam
-
-unset -f _of_rhoCentralFoam 2>/dev/null
-_of_rhoCentralFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_rhoCentralFoam rhoCentralFoam
-
-unset -f _of_rhoPimpleDyMFoam 2>/dev/null
-_of_rhoPimpleDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_rhoPimpleDyMFoam rhoPimpleDyMFoam
-
-unset -f _of_rhoPimpleFoam 2>/dev/null
-_of_rhoPimpleFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_rhoPimpleFoam rhoPimpleFoam
-
-unset -f _of_rhoPorousSimpleFoam 2>/dev/null
-_of_rhoPorousSimpleFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_rhoPorousSimpleFoam rhoPorousSimpleFoam
-
-unset -f _of_rhoReactingBuoyantFoam 2>/dev/null
-_of_rhoReactingBuoyantFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_rhoReactingBuoyantFoam rhoReactingBuoyantFoam
-
-unset -f _of_rhoReactingFoam 2>/dev/null
-_of_rhoReactingFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_rhoReactingFoam rhoReactingFoam
-
-unset -f _of_rhoSimpleFoam 2>/dev/null
-_of_rhoSimpleFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_rhoSimpleFoam rhoSimpleFoam
-
-unset -f _of_rotateMesh 2>/dev/null
-_of_rotateMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_rotateMesh rotateMesh
-
-unset -f _of_scalarTransportFoam 2>/dev/null
-_of_scalarTransportFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_scalarTransportFoam scalarTransportFoam
-
-unset -f _of_selectCells 2>/dev/null
-_of_selectCells()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_selectCells selectCells
-
-unset -f _of_setAlphaField 2>/dev/null
-_of_setAlphaField()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_setAlphaField setAlphaField
-
-unset -f _of_setFields 2>/dev/null
-_of_setFields()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -dict -region -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_setFields setFields
-
-unset -f _of_setSet 2>/dev/null
-_of_setSet()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -latestTime -loop -newTimes -noFunctionObjects -noSync -noVTK -noZero -parallel -srcDoc -doc -help "
-    local optsWithArgs="-batch -case -decomposeParDict -region -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_setSet setSet
-
-unset -f _of_setsToZones 2>/dev/null
-_of_setsToZones()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -latestTime -newTimes -noFlipMap -noFunctionObjects -noZero -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_setsToZones setsToZones
-
-unset -f _of_shallowWaterFoam 2>/dev/null
-_of_shallowWaterFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_shallowWaterFoam shallowWaterFoam
-
-unset -f _of_simpleCoalParcelFoam 2>/dev/null
-_of_simpleCoalParcelFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_simpleCoalParcelFoam simpleCoalParcelFoam
-
-unset -f _of_simpleFoam 2>/dev/null
-_of_simpleFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_simpleFoam simpleFoam
-
-unset -f _of_simpleReactingParcelFoam 2>/dev/null
-_of_simpleReactingParcelFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_simpleReactingParcelFoam simpleReactingParcelFoam
-
-unset -f _of_singleCellMesh 2>/dev/null
-_of_singleCellMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_singleCellMesh singleCellMesh
-
-unset -f _of_smapToFoam 2>/dev/null
-_of_smapToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_smapToFoam smapToFoam
-
-unset -f _of_snappyHexMesh 2>/dev/null
-_of_snappyHexMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-checkGeometry -noFunctionObjects -overwrite -parallel -profiling -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -dict -outFile -patches -region -roots -surfaceSimplify "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_snappyHexMesh snappyHexMesh
-
-unset -f _of_snappyRefineMesh 2>/dev/null
-_of_snappyRefineMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_snappyRefineMesh snappyRefineMesh
-
-unset -f _of_solidDisplacementFoam 2>/dev/null
-_of_solidDisplacementFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_solidDisplacementFoam solidDisplacementFoam
-
-unset -f _of_solidEquilibriumDisplacementFoam 2>/dev/null
-_of_solidEquilibriumDisplacementFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_solidEquilibriumDisplacementFoam solidEquilibriumDisplacementFoam
-
-unset -f _of_sonicDyMFoam 2>/dev/null
-_of_sonicDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_sonicDyMFoam sonicDyMFoam
-
-unset -f _of_sonicFoam 2>/dev/null
-_of_sonicFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_sonicFoam sonicFoam
-
-unset -f _of_sonicLiquidFoam 2>/dev/null
-_of_sonicLiquidFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_sonicLiquidFoam sonicLiquidFoam
-
-unset -f _of_splitCells 2>/dev/null
-_of_splitCells()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-geometry -noFunctionObjects -overwrite -srcDoc -doc -help "
-    local optsWithArgs="-case -set -tol "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_splitCells splitCells
-
-unset -f _of_splitMesh 2>/dev/null
-_of_splitMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -overwrite -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_splitMesh splitMesh
-
-unset -f _of_splitMeshRegions 2>/dev/null
-_of_splitMeshRegions()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-cellZones -cellZonesOnly -detectOnly -largestOnly -makeCellZones -noFunctionObjects -overwrite -parallel -prefixRegion -sloppyCellZones -useFaceZones -srcDoc -doc -help "
-    local optsWithArgs="-blockedFaces -case -cellZonesFileOnly -decomposeParDict -insidePoint -region -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_splitMeshRegions splitMeshRegions
-
-unset -f _of_sprayDyMFoam 2>/dev/null
-_of_sprayDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_sprayDyMFoam sprayDyMFoam
-
-unset -f _of_sprayEngineFoam 2>/dev/null
-_of_sprayEngineFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_sprayEngineFoam sprayEngineFoam
-
-unset -f _of_sprayFoam 2>/dev/null
-_of_sprayFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_sprayFoam sprayFoam
-
-unset -f _of_SRFPimpleFoam 2>/dev/null
-_of_SRFPimpleFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_SRFPimpleFoam SRFPimpleFoam
-
-unset -f _of_SRFSimpleFoam 2>/dev/null
-_of_SRFSimpleFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_SRFSimpleFoam SRFSimpleFoam
-
-unset -f _of_star4ToFoam 2>/dev/null
-_of_star4ToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-ascii -noFunctionObjects -solids -srcDoc -doc -help "
-    local optsWithArgs="-case -scale "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_star4ToFoam star4ToFoam
-
-unset -f _of_steadyParticleTracks 2>/dev/null
-_of_steadyParticleTracks()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help "
-    local optsWithArgs="-case -dict -region -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_steadyParticleTracks steadyParticleTracks
-
-unset -f _of_stitchMesh 2>/dev/null
-_of_stitchMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -overwrite -partial -perfect -srcDoc -doc -help "
-    local optsWithArgs="-case -region -toleranceDict "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_stitchMesh stitchMesh
-
-unset -f _of_subsetMesh 2>/dev/null
-_of_subsetMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -overwrite -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -patch -patches -region -resultTime -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_subsetMesh subsetMesh
-
-unset -f _of_surfaceAdd 2>/dev/null
-_of_surfaceAdd()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-mergeRegions -noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -points "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceAdd surfaceAdd
-
-unset -f _of_surfaceBooleanFeatures 2>/dev/null
-_of_surfaceBooleanFeatures()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-invertedSpace -noFunctionObjects -perturb -surf1Baffle -surf2Baffle -srcDoc -doc -help "
-    local optsWithArgs="-case -trim "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceBooleanFeatures surfaceBooleanFeatures
-
-unset -f _of_surfaceCheck 2>/dev/null
-_of_surfaceCheck()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-blockMesh -checkSelfIntersection -noFunctionObjects -splitNonManifold -verbose -srcDoc -doc -help "
-    local optsWithArgs="-case -outputThreshold "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceCheck surfaceCheck
-
-unset -f _of_surfaceClean 2>/dev/null
-_of_surfaceClean()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noClean -noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceClean surfaceClean
-
-unset -f _of_surfaceCoarsen 2>/dev/null
-_of_surfaceCoarsen()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceCoarsen surfaceCoarsen
-
-unset -f _of_surfaceConvert 2>/dev/null
-_of_surfaceConvert()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-clean -group -noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -scale -writePrecision "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceConvert surfaceConvert
-
-unset -f _of_surfaceFeatureConvert 2>/dev/null
-_of_surfaceFeatureConvert()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -scale "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceFeatureConvert surfaceFeatureConvert
-
-unset -f _of_surfaceFeatureExtract 2>/dev/null
-_of_surfaceFeatureExtract()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-srcDoc -doc -help "
-    local optsWithArgs="-case -dict "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceFeatureExtract surfaceFeatureExtract
-
-unset -f _of_surfaceFind 2>/dev/null
-_of_surfaceFind()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -x -y -z "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceFind surfaceFind
-
-unset -f _of_surfaceHookUp 2>/dev/null
-_of_surfaceHookUp()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -dict "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceHookUp surfaceHookUp
-
-unset -f _of_surfaceInertia 2>/dev/null
-_of_surfaceInertia()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -shellProperties -srcDoc -doc -help "
-    local optsWithArgs="-case -density -referencePoint "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceInertia surfaceInertia
-
-unset -f _of_surfaceInflate 2>/dev/null
-_of_surfaceInflate()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-checkSelfIntersection -debug -noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -featureAngle -nSmooth "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceInflate surfaceInflate
-
-unset -f _of_surfaceLambdaMuSmooth 2>/dev/null
-_of_surfaceLambdaMuSmooth()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-srcDoc -doc -help "
-    local optsWithArgs="-featureFile "
-
-    case ${prev} in
-
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceLambdaMuSmooth surfaceLambdaMuSmooth
-
-unset -f _of_surfaceMeshConvert 2>/dev/null
-_of_surfaceMeshConvert()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-clean -noFunctionObjects -tri -srcDoc -doc -help "
-    local optsWithArgs="-case -dict -from -scaleIn -scaleOut -to "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceMeshConvert surfaceMeshConvert
-
-unset -f _of_surfaceMeshConvertTesting 2>/dev/null
-_of_surfaceMeshConvertTesting()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-clean -noFunctionObjects -orient -stdout -surfMesh -testModify -triFace -triSurface -unsorted -srcDoc -doc -help "
-    local optsWithArgs="-case -scale "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceMeshConvertTesting surfaceMeshConvertTesting
-
-unset -f _of_surfaceMeshExport 2>/dev/null
-_of_surfaceMeshExport()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-clean -noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -dict -from -name -scaleIn -scaleOut -to "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceMeshExport surfaceMeshExport
-
-unset -f _of_surfaceMeshImport 2>/dev/null
-_of_surfaceMeshImport()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-clean -noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -dict -from -name -scaleIn -scaleOut -to "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceMeshImport surfaceMeshImport
-
-unset -f _of_surfaceMeshInfo 2>/dev/null
-_of_surfaceMeshInfo()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-areas -noFunctionObjects -xml -srcDoc -doc -help "
-    local optsWithArgs="-case -scale "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceMeshInfo surfaceMeshInfo
-
-unset -f _of_surfaceMeshTriangulate 2>/dev/null
-_of_surfaceMeshTriangulate()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -excludeProcPatches -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -faceZones -patches -region -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceMeshTriangulate surfaceMeshTriangulate
-
-unset -f _of_surfaceOrient 2>/dev/null
-_of_surfaceOrient()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-inside -noFunctionObjects -usePierceTest -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceOrient surfaceOrient
-
-unset -f _of_surfacePatch 2>/dev/null
-_of_surfacePatch()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -dict "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfacePatch surfacePatch
-
-unset -f _of_surfacePointMerge 2>/dev/null
-_of_surfacePointMerge()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfacePointMerge surfacePointMerge
-
-unset -f _of_surfaceRedistributePar 2>/dev/null
-_of_surfaceRedistributePar()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-keepNonMapped -noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceRedistributePar surfaceRedistributePar
-
-unset -f _of_surfaceRefineRedGreen 2>/dev/null
-_of_surfaceRefineRedGreen()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceRefineRedGreen surfaceRefineRedGreen
-
-unset -f _of_surfaceSplitByPatch 2>/dev/null
-_of_surfaceSplitByPatch()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceSplitByPatch surfaceSplitByPatch
-
-unset -f _of_surfaceSplitByTopology 2>/dev/null
-_of_surfaceSplitByTopology()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-srcDoc -doc -help "
-    local optsWithArgs=" "
-
-    case ${prev} in
-
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceSplitByTopology surfaceSplitByTopology
-
-unset -f _of_surfaceSplitNonManifolds 2>/dev/null
-_of_surfaceSplitNonManifolds()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-debug -noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceSplitNonManifolds surfaceSplitNonManifolds
-
-unset -f _of_surfaceSubset 2>/dev/null
-_of_surfaceSubset()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceSubset surfaceSubset
-
-unset -f _of_surfaceToPatch 2>/dev/null
-_of_surfaceToPatch()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -faceSet -tol "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceToPatch surfaceToPatch
-
-unset -f _of_surfaceTransformPoints 2>/dev/null
-_of_surfaceTransformPoints()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case -rollPitchYaw -rotate -scale -translate -yawPitchRoll "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_surfaceTransformPoints surfaceTransformPoints
-
-unset -f _of_temporalInterpolate 2>/dev/null
-_of_temporalInterpolate()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -divisions -fields -interpolationType -region -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_temporalInterpolate temporalInterpolate
-
-unset -f _of_tetgenToFoam 2>/dev/null
-_of_tetgenToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFaceFile -noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_tetgenToFoam tetgenToFoam
-
-unset -f _of_thermoFoam 2>/dev/null
-_of_thermoFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_thermoFoam thermoFoam
-
-unset -f _of_topoSet 2>/dev/null
-_of_topoSet()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -latestTime -newTimes -noFunctionObjects -noSync -noZero -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -dict -region -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_topoSet topoSet
-
-unset -f _of_transformPoints 2>/dev/null
-_of_transformPoints()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -rotateFields -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -rollPitchYaw -roots -rotate -scale -translate -yawPitchRoll "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_transformPoints transformPoints
-
-unset -f _of_twoLiquidMixingFoam 2>/dev/null
-_of_twoLiquidMixingFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_twoLiquidMixingFoam twoLiquidMixingFoam
-
-unset -f _of_twoPhaseEulerFoam 2>/dev/null
-_of_twoPhaseEulerFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_twoPhaseEulerFoam twoPhaseEulerFoam
-
-unset -f _of_uncoupledKinematicParcelFoam 2>/dev/null
-_of_uncoupledKinematicParcelFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -cloud -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_uncoupledKinematicParcelFoam uncoupledKinematicParcelFoam
-
-unset -f _of_viewFactorsGen 2>/dev/null
-_of_viewFactorsGen()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_viewFactorsGen viewFactorsGen
-
-unset -f _of_vtkUnstructuredToFoam 2>/dev/null
-_of_vtkUnstructuredToFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -srcDoc -doc -help "
-    local optsWithArgs="-case "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_vtkUnstructuredToFoam vtkUnstructuredToFoam
-
-unset -f _of_wallFunctionTable 2>/dev/null
-_of_wallFunctionTable()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_wallFunctionTable wallFunctionTable
-
-unset -f _of_writeMeshObj 2>/dev/null
-_of_writeMeshObj()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -patchEdges -patchFaces -srcDoc -doc -help "
-    local optsWithArgs="-case -cell -cellSet -decomposeParDict -face -faceSet -point -region -roots -time "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    -time)
-        COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_writeMeshObj writeMeshObj
-
-unset -f _of_XiDyMFoam 2>/dev/null
-_of_XiDyMFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_XiDyMFoam XiDyMFoam
-
-unset -f _of_XiFoam 2>/dev/null
-_of_XiFoam()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_XiFoam XiFoam
-
-unset -f _of_zipUpMesh 2>/dev/null
-_of_zipUpMesh()
-{
-    local cur="${COMP_WORDS[COMP_CWORD]}"
-    local prev="${COMP_WORDS[COMP_CWORD-1]}"
-
-    local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
-    local optsWithArgs="-case -decomposeParDict -region -roots "
-
-    case ${prev} in
-    -case)
-        COMPREPLY=($(compgen -d -- ${cur}))
-        ;;
-    *Dict)
-        COMPREPLY=($(compgen -f -- ${cur}))
-        ;;
-    -region)
-        local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
-        COMPREPLY=($(compgen -W "$regions" -- ${cur}))
-        ;;
-    *)
-        if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
-        then
-            # Unknown type of arg follows - set to files.
-            # Not always correct but can still navigate path if needed...
-            COMPREPLY=($(compgen -f -- ${cur}))
-        else
-            # Catch-all - present all remaining options
-            opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
-            optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
-            COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
-        fi
-        ;;
-    esac
-
-    return 0
-}
-complete -o nospace -F _of_zipUpMesh zipUpMesh
-
-
-#------------------------------------------------------------------------------
diff --git a/etc/config.sh/completion_cache b/etc/config.sh/completion_cache
new file mode 100644
index 0000000000000000000000000000000000000000..942dbe4e466966b337c7d37a8f8068bacdcddef1
--- /dev/null
+++ b/etc/config.sh/completion_cache
@@ -0,0 +1,259 @@
+#----------------------------------*-sh-*--------------------------------------
+# Cached options for bash completion of OpenFOAM applications.
+# These are the values expected by the '_of_complete_' function
+#
+# Recreate with "foamCreateCompletionCache"
+
+# Global associative array (cached options for OpenFOAM applications)
+declare -gA _of_complete_cache_;
+
+# Clear existing cache.
+_of_complete_cache_=()
+
+#------------------------------------------------------------------------------
+_of_complete_cache_[adiabaticFlameT]="-case | -srcDoc -doc -help"
+_of_complete_cache_[adjointShapeOptimizationFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[ansysToFoam]="-case -scale | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[applyBoundaryLayer]="-case -decomposeParDict -region -roots -ybl | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[attachMesh]="-case | -noFunctionObjects -overwrite -srcDoc -doc -help"
+_of_complete_cache_[autoPatch]="-case | -noFunctionObjects -overwrite -srcDoc -doc -help"
+_of_complete_cache_[blockMesh]="-case -dict -region | -blockTopology -noClean -noFunctionObjects -sets -srcDoc -doc -help"
+_of_complete_cache_[boundaryFoam]="-case | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[boxTurb]="-case | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[buoyantBoussinesqPimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[buoyantBoussinesqSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[buoyantPimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[buoyantSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[cavitatingDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[cavitatingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[cfx4ToFoam]="-case -scale | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[changeDictionary]="-case -decomposeParDict -dict -instance -region -roots -subDict -time | -constant -disablePatchGroups -enableFunctionEntries -latestTime -literalRE -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
+_of_complete_cache_[checkMesh]="-case -decomposeParDict -region -roots -time -writeFields -writeSets | -allGeometry -allTopology -constant -latestTime -meshQuality -newTimes -noFunctionObjects -noTopology -noZero -parallel -writeAllFields -srcDoc -doc -help"
+_of_complete_cache_[chemFoam]="-case | -noFunctionObjects -postProcess -srcDoc -doc -help"
+_of_complete_cache_[chemkinToFoam]="-case | -newFormat -srcDoc -doc -help"
+_of_complete_cache_[chtMultiRegionFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[chtMultiRegionSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[coalChemistryFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[coldEngineFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[collapseEdges]="-case -collapseFaceSet -decomposeParDict -dict -roots -time | -collapseFaces -constant -latestTime -newTimes -noFunctionObjects -noZero -overwrite -parallel -srcDoc -doc -help"
+_of_complete_cache_[combinePatchFaces]="-case -concaveAngle -decomposeParDict -roots | -meshQuality -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
+_of_complete_cache_[compressibleInterDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[compressibleInterFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[compressibleMultiphaseInterFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[createBaffles]="-case -decomposeParDict -dict -region -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
+_of_complete_cache_[createExternalCoupledPatchGeometry]="-case -commsDir -decomposeParDict -region -regions -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[createPatch]="-case -decomposeParDict -dict -region -roots | -noFunctionObjects -overwrite -parallel -writeObj -srcDoc -doc -help"
+_of_complete_cache_[createZeroDirectory]="-case -decomposeParDict -roots -templateDir | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[datToFoam]="-case | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[decomposePar]="-case -decomposeParDict -region -time | -allRegions -cellDist -constant -copyUniform -copyZero -fields -force -ifRequired -latestTime -newTimes -noFunctionObjects -noSets -noZero -srcDoc -doc -help"
+_of_complete_cache_[deformedGeom]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[dnsFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[DPMDyMFoam]="-case -cloudName -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[DPMFoam]="-case -cloud -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[driftFluxFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[dsmcFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[dsmcInitialise]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[electrostaticFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[engineCompRatio]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[engineFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[engineSwirl]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[equilibriumCO]="-case | -srcDoc -doc -help"
+_of_complete_cache_[equilibriumFlameT]="-case | -srcDoc -doc -help"
+_of_complete_cache_[extrude2DMesh]="-case -decomposeParDict -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
+_of_complete_cache_[extrudeMesh]="-case -decomposeParDict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[extrudeToRegionMesh]="-case -decomposeParDict -dict -region -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
+_of_complete_cache_[faceAgglomerate]="-case -decomposeParDict -dict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[financialFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[fireFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[fireToFoam]="-case -scale | -ascii -check -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[flattenMesh]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[fluent3DMeshToFoam]="-case -ignoreCellGroups -ignoreFaceGroups -scale | -cubit -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[fluentMeshToFoam]="-case -scale | -noFunctionObjects -writeSets -writeZones -srcDoc -doc -help"
+_of_complete_cache_[foamDataToFluent]="-case -time | -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help"
+_of_complete_cache_[foamDictionary]="-add -case -decomposeParDict -diff -entry -roots -set | -disableFunctionEntries -expand -includes -keywords -noFunctionObjects -parallel -remove -value -srcDoc -doc -help"
+_of_complete_cache_[foamFormatConvert]="-case -decomposeParDict -region -roots -time | -constant -enableFunctionEntries -latestTime -newTimes -noConstant -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
+_of_complete_cache_[foamHelp]="-case -decomposeParDict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[foamList]="-case -scalarBCs -vectorBCs | -compressibleTurbulenceModels -functionObjects -fvOptions -incompressibleTurbulenceModels -noFunctionObjects -registeredSwitches -switches -unset -srcDoc -doc -help"
+_of_complete_cache_[foamListTimes]="-case -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -processor -rm -withZero -srcDoc -doc -help"
+_of_complete_cache_[foamMeshToFluent]="-case | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[foamToEnsight]="-case -cellZone -decomposeParDict -faceZones -fields -name -patches -region -roots -time -width | -ascii -constant -latestTime -newTimes -noFunctionObjects -noLagrangian -noPatches -noZero -nodeValues -parallel -srcDoc -doc -help"
+_of_complete_cache_[foamToEnsightParts]="-case -index -name -time -width | -ascii -constant -latestTime -newTimes -noFunctionObjects -noLagrangian -noMesh -noZero -srcDoc -doc -help"
+_of_complete_cache_[foamToFireMesh]="-case -scale -time | -ascii -constant -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help"
+_of_complete_cache_[foamToGMV]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[foamToStarMesh]="-case -scale -time | -constant -latestTime -newTimes -noBnd -noFunctionObjects -noZero -srcDoc -doc -help"
+_of_complete_cache_[foamToSurface]="-case -scale -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -tri -srcDoc -doc -help"
+_of_complete_cache_[foamToTecplot360]="-case -cellSet -decomposeParDict -excludePatches -faceSet -fields -region -roots -time | -constant -latestTime -nearCellValue -newTimes -noFaceZones -noFunctionObjects -noInternal -noPointValues -noZero -parallel -srcDoc -doc -help"
+_of_complete_cache_[foamToTetDualMesh]="-case -decomposeParDict -roots -time | -constant -latestTime -noFunctionObjects -noZero -overwrite -parallel -srcDoc -doc -help"
+_of_complete_cache_[foamToVTK]="-case -cellSet -decomposeParDict -excludePatches -faceSet -fields -name -pointSet -region -roots -time | -allPatches -ascii -constant -latestTime -nearCellValue -newTimes -noFaceZones -noFunctionObjects -noInternal -noLagrangian -noLinks -noPointValues -noZero -parallel -poly -surfaceFields -useTimeName -xml -srcDoc -doc -help"
+_of_complete_cache_[foamUpgradeCyclics]="-case -decomposeParDict -region -roots -time | -constant -enableFunctionEntries -latestTime -newTimes -noFunctionObjects -noZero -parallel -test -srcDoc -doc -help"
+_of_complete_cache_[foamyHexMesh]="-case -decomposeParDict -roots | -checkGeometry -conformationOnly -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[foamyQuadMesh]="-case -pointsFile | -noFunctionObjects -overwrite -srcDoc -doc -help"
+_of_complete_cache_[gambitToFoam]="-case -scale | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[gmshToFoam]="-case -region | -keepOrientation -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[icoFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[icoUncoupledKinematicParcelDyMFoam]="-case -cloud -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[icoUncoupledKinematicParcelFoam]="-case -cloud -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[ideasUnvToFoam]="-case | -dump -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[insideCells]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[interCondensatingEvaporatingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[interDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[interFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[interIsoFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[interMixingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[interPhaseChangeDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[interPhaseChangeFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[kivaToFoam]="-case -file -version -zHeadMin | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[laplacianFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[lumpedPointForces]="-case -decomposeParDict -region -roots -time | -constant -latestTime -newTimes -noZero -parallel -vtk -srcDoc -doc -help"
+_of_complete_cache_[lumpedPointMovement]="-case -max -scale -span | -removeLock -slave -srcDoc -doc -help"
+_of_complete_cache_[lumpedPointZones]="-case -region | -verbose -srcDoc -doc -help"
+_of_complete_cache_[magneticFoam]="-case -decomposeParDict -roots | -noB -noFunctionObjects -noH -parallel -srcDoc -doc -help"
+_of_complete_cache_[mapFields]="-case -mapMethod -sourceDecomposeParDict -sourceRegion -sourceTime -targetDecomposeParDict -targetRegion | -consistent -noFunctionObjects -parallelSource -parallelTarget -subtract -srcDoc -doc -help"
+_of_complete_cache_[mapFieldsPar]="-case -decomposeParDict -fields -mapMethod -patchMapMethod -roots -sourceRegion -sourceTime -targetRegion | -consistent -noFunctionObjects -noLagrangian -parallel -subtract -srcDoc -doc -help"
+_of_complete_cache_[mdEquilibrationFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[mdFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[mdInitialise]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[mergeMeshes]="-addRegion -case -decomposeParDict -masterRegion -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
+_of_complete_cache_[mergeOrSplitBaffles]="-case -decomposeParDict -dict -region -roots | -detectOnly -noFunctionObjects -overwrite -parallel -split -srcDoc -doc -help"
+_of_complete_cache_[mhdFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[mirrorMesh]="-case -decomposeParDict -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
+_of_complete_cache_[mixtureAdiabaticFlameT]="-case | -srcDoc -doc -help"
+_of_complete_cache_[modifyMesh]="-case -decomposeParDict -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
+_of_complete_cache_[moveDynamicMesh]="-case -decomposeParDict -region -roots | -checkAMI -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[moveEngineMesh]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[moveMesh]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[MPPICDyMFoam]="-case -cloudName -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[MPPICFoam]="-case -cloud -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[MPPICInterFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[mshToFoam]="-case | -hex -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[multiphaseEulerFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[multiphaseInterDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[multiphaseInterFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[netgenNeutralToFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[noise]="-case -decomposeParDict -dict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[nonNewtonianIcoFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[objToVTK]="-case | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[orientFaceZone]="-case -decomposeParDict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[overInterDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[overLaplacianDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[overPimpleDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[overRhoPimpleDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[overSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[particleTracks]="-case -decomposeParDict -region -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
+_of_complete_cache_[patchSummary]="-case -decomposeParDict -region -roots -time | -constant -expand -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
+_of_complete_cache_[pdfPlot]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[PDRFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[PDRMesh]="-case -decomposeParDict -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
+_of_complete_cache_[pimpleDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[pimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[pisoFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[plot3dToFoam]="-case -scale | -noBlank -noFunctionObjects -singleBlock -srcDoc -doc -help"
+_of_complete_cache_[polyDualMesh]="-case | -concaveMultiCells -doNotPreserveFaceZones -noFunctionObjects -overwrite -splitAllFaces -srcDoc -doc -help"
+_of_complete_cache_[porousSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[postChannel]="-case -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help"
+_of_complete_cache_[postProcess]="-case -decomposeParDict -dict -field -fields -func -funcs -region -roots -time | -constant -latestTime -list -newTimes -noFunctionObjects -noZero -parallel -profiling -srcDoc -doc -help"
+_of_complete_cache_[potentialFoam]="-case -decomposeParDict -pName -roots | -initialiseUBCs -noFunctionObjects -parallel -withFunctionObjects -writePhi -writep -srcDoc -doc -help"
+_of_complete_cache_[potentialFreeSurfaceDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[potentialFreeSurfaceFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[reactingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[reactingMultiphaseEulerFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[reactingParcelFilmFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[reactingParcelFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[reactingTwoPhaseEulerFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[reconstructPar]="-case -fields -lagrangianFields -region -time | -allRegions -constant -latestTime -newTimes -noFields -noFunctionObjects -noLagrangian -noSets -noZero -withZero -srcDoc -doc -help"
+_of_complete_cache_[reconstructParMesh]="-case -mergeTol -region -time | -cellDist -constant -fullMatch -latestTime -newTimes -noFunctionObjects -noZero -withZero -srcDoc -doc -help"
+_of_complete_cache_[redistributePar]="-case -decomposeParDict -mergeTol -region -roots -time | -cellDist -constant -decompose -latestTime -newTimes -noFunctionObjects -noZero -overwrite -parallel -reconstruct -withZero -srcDoc -doc -help"
+_of_complete_cache_[refineHexMesh]="-case -decomposeParDict -region -roots | -minSet -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
+_of_complete_cache_[refinementLevel]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -readLevel -srcDoc -doc -help"
+_of_complete_cache_[refineMesh]="-case -decomposeParDict -dict -region -roots | -all -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
+_of_complete_cache_[refineWallLayer]="-case -decomposeParDict -roots -useSet | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
+_of_complete_cache_[removeFaces]="-case -decomposeParDict -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
+_of_complete_cache_[renumberMesh]="-case -decomposeParDict -dict -region -roots -time | -constant -frontWidth -latestTime -noFunctionObjects -noZero -overwrite -parallel -srcDoc -doc -help"
+_of_complete_cache_[rhoCentralDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[rhoCentralFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[rhoPimpleAdiabaticFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[rhoPimpleDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[rhoPimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[rhoPorousSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[rhoReactingBuoyantFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[rhoReactingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[rhoSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[rotateMesh]="-case -decomposeParDict -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
+_of_complete_cache_[scalarTransportFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[selectCells]="-case | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[setAlphaField]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[setFields]="-case -decomposeParDict -dict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[setSet]="-batch -case -decomposeParDict -region -roots -time | -constant -latestTime -loop -newTimes -noFunctionObjects -noSync -noVTK -noZero -parallel -srcDoc -doc -help"
+_of_complete_cache_[setsToZones]="-case -decomposeParDict -region -roots -time | -constant -latestTime -newTimes -noFlipMap -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
+_of_complete_cache_[shallowWaterFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[simpleCoalParcelFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[simpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[simpleReactingParcelFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[singleCellMesh]="-case -decomposeParDict -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
+_of_complete_cache_[smapToFoam]="-case | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[snappyHexMesh]="-case -decomposeParDict -dict -outFile -patches -region -roots -surfaceSimplify | -checkGeometry -noFunctionObjects -overwrite -parallel -profiling -srcDoc -doc -help"
+_of_complete_cache_[snappyRefineMesh]="-case | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[solidDisplacementFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[solidEquilibriumDisplacementFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[sonicDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[sonicFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[sonicLiquidFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[splitCells]="-case -set -tol | -geometry -noFunctionObjects -overwrite -srcDoc -doc -help"
+_of_complete_cache_[splitMesh]="-case | -noFunctionObjects -overwrite -srcDoc -doc -help"
+_of_complete_cache_[splitMeshRegions]="-blockedFaces -case -cellZonesFileOnly -decomposeParDict -insidePoint -region -roots | -cellZones -cellZonesOnly -detectOnly -largestOnly -makeCellZones -noFunctionObjects -overwrite -parallel -prefixRegion -sloppyCellZones -useFaceZones -srcDoc -doc -help"
+_of_complete_cache_[sprayDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[sprayEngineFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[sprayFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[SRFPimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[SRFSimpleFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[star4ToFoam]="-case -scale | -ascii -noFunctionObjects -solids -srcDoc -doc -help"
+_of_complete_cache_[steadyParticleTracks]="-case -dict -region -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -srcDoc -doc -help"
+_of_complete_cache_[stitchMesh]="-case -region -toleranceDict | -noFunctionObjects -overwrite -partial -perfect -srcDoc -doc -help"
+_of_complete_cache_[subsetMesh]="-case -decomposeParDict -patch -patches -region -resultTime -roots | -noFunctionObjects -overwrite -parallel -srcDoc -doc -help"
+_of_complete_cache_[surfaceAdd]="-case -points | -mergeRegions -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfaceBooleanFeatures]="-case -trim | -invertedSpace -noFunctionObjects -perturb -surf1Baffle -surf2Baffle -srcDoc -doc -help"
+_of_complete_cache_[surfaceCheck]="-case -outputThreshold | -blockMesh -checkSelfIntersection -noFunctionObjects -splitNonManifold -verbose -srcDoc -doc -help"
+_of_complete_cache_[surfaceClean]="-case | -noClean -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfaceCoarsen]="-case | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfaceConvert]="-case -scale -writePrecision | -clean -group -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfaceFeatureConvert]="-case -scale | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfaceFeatureExtract]="-case -dict | -srcDoc -doc -help"
+_of_complete_cache_[surfaceFind]="-case -x -y -z | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfaceHookUp]="-case -dict | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfaceInertia]="-case -density -referencePoint | -noFunctionObjects -shellProperties -srcDoc -doc -help"
+_of_complete_cache_[surfaceInflate]="-case -featureAngle -nSmooth | -checkSelfIntersection -debug -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfaceLambdaMuSmooth]="-featureFile | -srcDoc -doc -help"
+_of_complete_cache_[surfaceMeshConvert]="-case -dict -from -scaleIn -scaleOut -to | -clean -noFunctionObjects -tri -srcDoc -doc -help"
+_of_complete_cache_[surfaceMeshConvertTesting]="-case -scale | -clean -noFunctionObjects -orient -stdout -surfMesh -testModify -triFace -triSurface -unsorted -srcDoc -doc -help"
+_of_complete_cache_[surfaceMeshExport]="-case -dict -from -name -scaleIn -scaleOut -to | -clean -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfaceMeshImport]="-case -dict -from -name -scaleIn -scaleOut -to | -clean -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfaceMeshInfo]="-case -scale | -areas -noFunctionObjects -xml -srcDoc -doc -help"
+_of_complete_cache_[surfaceMeshTriangulate]="-case -decomposeParDict -faceZones -patches -region -roots -time | -constant -excludeProcPatches -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
+_of_complete_cache_[surfaceOrient]="-case | -inside -noFunctionObjects -usePierceTest -srcDoc -doc -help"
+_of_complete_cache_[surfacePatch]="-case -dict | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfacePointMerge]="-case | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfaceRedistributePar]="-case -decomposeParDict -roots | -keepNonMapped -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[surfaceRefineRedGreen]="-case | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfaceSplitByPatch]="-case | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfaceSplitByTopology]=" | -srcDoc -doc -help"
+_of_complete_cache_[surfaceSplitNonManifolds]="-case | -debug -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfaceSubset]="-case | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfaceToPatch]="-case -faceSet -tol | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[surfaceTransformPoints]="-case -rollPitchYaw -rotate -scale -translate -yawPitchRoll | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[temporalInterpolate]="-case -decomposeParDict -divisions -fields -interpolationType -region -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -srcDoc -doc -help"
+_of_complete_cache_[tetgenToFoam]="-case -decomposeParDict -roots | -noFaceFile -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[thermoFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[topoSet]="-case -decomposeParDict -dict -region -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noSync -noZero -parallel -srcDoc -doc -help"
+_of_complete_cache_[transformPoints]="-case -decomposeParDict -region -rollPitchYaw -roots -rotate -scale -translate -yawPitchRoll | -noFunctionObjects -parallel -rotateFields -srcDoc -doc -help"
+_of_complete_cache_[twoLiquidMixingFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[twoPhaseEulerFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[uncoupledKinematicParcelFoam]="-case -cloud -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[viewFactorsGen]="-case -decomposeParDict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[vtkUnstructuredToFoam]="-case | -noFunctionObjects -srcDoc -doc -help"
+_of_complete_cache_[wallFunctionTable]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+_of_complete_cache_[writeMeshObj]="-case -cell -cellSet -decomposeParDict -face -faceSet -point -region -roots -time | -constant -latestTime -newTimes -noFunctionObjects -noZero -parallel -patchEdges -patchFaces -srcDoc -doc -help"
+_of_complete_cache_[XiDyMFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[XiFoam]="-case -decomposeParDict -roots | -noFunctionObjects -parallel -postProcess -srcDoc -doc -help"
+_of_complete_cache_[zipUpMesh]="-case -decomposeParDict -region -roots | -noFunctionObjects -parallel -srcDoc -doc -help"
+
+#------------------------------------------------------------------------------
diff --git a/etc/config.sh/unset b/etc/config.sh/unset
index 95afc82534aba6f01460c3259972c894039c7ef7..fe8b8f18e10267cf5121e0e22c26c3872ad2185d 100644
--- a/etc/config.sh/unset
+++ b/etc/config.sh/unset
@@ -181,16 +181,21 @@ unset -f wmRefresh  2>/dev/null
 unset -f foamVersion 2>/dev/null
 unset -f foamPV     2>/dev/null
 
-# Cleanup bash completions, which look like this:
-#     "complete ... -F _of_APPNAME APPNAME
-# For economy, obtain list first but also add in 'filter_opts' helper
-foamClean="$(complete 2>/dev/null | sed -n -e 's/complete.*-F _of_.* \(..*\)$/\1/p')"
-for cleaned in $foamClean filter_opts
+# Remove old completions, which look like
+#     "complete ... -F _of_complete_ APPNAME
+# For economy, obtain list first
+foamOldDirs="$(complete 2>/dev/null | sed -ne 's/^.*-F _of_.* \(..*\)$/\1/p')"
+for cleaned in $foamOldDirs
 do
-    unset -f _of_$cleaned 2>/dev/null
-    complete -r $cleaned  2>/dev/null
+    complete -r $cleaned 2>/dev/null
 done
 
+# Completion functions
+unset -f foamAddCompletion 2>/dev/null
+unset -f _of_complete_  2>/dev/null
+
+# Completion cache
+unset _of_complete_cache_
 
 #------------------------------------------------------------------------------
 # Intermediate variables (do as last for a clean exit code)
diff --git a/etc/cshrc b/etc/cshrc
index 6c42ebdf61f1679c8c8fb9b347872e34d3477a4b..7b8da52c26df1b5c353a78e11628d0229187d17e 100644
--- a/etc/cshrc
+++ b/etc/cshrc
@@ -219,6 +219,7 @@ _foamEtc config.csh/settings
 
 if ($?prompt) then  # Interactive shell
     _foamEtc config.csh/aliases
+    _foamEtc config.csh/tcsh_completion
 endif
 
 
diff --git a/etc/templates/axisymmetricJet/system/blockMeshDict b/etc/templates/axisymmetricJet/system/blockMeshDict
index 1fcb03846ac67937da9c6784ba609a8063d5b5c0..3bbfc45ed679db41c72f5bc32e7b194527118582 100644
--- a/etc/templates/axisymmetricJet/system/blockMeshDict
+++ b/etc/templates/axisymmetricJet/system/blockMeshDict
@@ -24,7 +24,7 @@ backgroundMesh
     rBcells 50;
 }
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/etc/templates/closedVolume/system/blockMeshDict b/etc/templates/closedVolume/system/blockMeshDict
index 273d50fad2367de42c8eeef10117501a4d748079..db3fd8ee720d601ca5a143bc357c234033b1698e 100644
--- a/etc/templates/closedVolume/system/blockMeshDict
+++ b/etc/templates/closedVolume/system/blockMeshDict
@@ -27,7 +27,7 @@ backgroundMesh
     zCells  20;
 }
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/etc/templates/closedVolumeRotating/system/blockMeshDict b/etc/templates/closedVolumeRotating/system/blockMeshDict
index b7f0c57061c8e696616f012acc6f047b7889fe7b..71e33484d38e6ec5a512d281e013fdcab962cd30 100644
--- a/etc/templates/closedVolumeRotating/system/blockMeshDict
+++ b/etc/templates/closedVolumeRotating/system/blockMeshDict
@@ -58,7 +58,7 @@ geometry
     }
 }
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/etc/templates/closedVolumeRotating/system/blockMeshDict-box b/etc/templates/closedVolumeRotating/system/blockMeshDict-box
index 273d50fad2367de42c8eeef10117501a4d748079..db3fd8ee720d601ca5a143bc357c234033b1698e 100644
--- a/etc/templates/closedVolumeRotating/system/blockMeshDict-box
+++ b/etc/templates/closedVolumeRotating/system/blockMeshDict-box
@@ -27,7 +27,7 @@ backgroundMesh
     zCells  20;
 }
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/etc/templates/compressibleInflowOutflow/system/blockMeshDict b/etc/templates/compressibleInflowOutflow/system/blockMeshDict
index a761d4fecbf635b99c4b2b96adf95ea9564b54a8..a362f0657cf7afd7bce061c517475b62bc38b81f 100644
--- a/etc/templates/compressibleInflowOutflow/system/blockMeshDict
+++ b/etc/templates/compressibleInflowOutflow/system/blockMeshDict
@@ -27,7 +27,7 @@ backgroundMesh
     zCells  20;
 }
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/etc/templates/inflowOutflow/system/blockMeshDict b/etc/templates/inflowOutflow/system/blockMeshDict
index a761d4fecbf635b99c4b2b96adf95ea9564b54a8..a362f0657cf7afd7bce061c517475b62bc38b81f 100644
--- a/etc/templates/inflowOutflow/system/blockMeshDict
+++ b/etc/templates/inflowOutflow/system/blockMeshDict
@@ -27,7 +27,7 @@ backgroundMesh
     zCells  20;
 }
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/etc/templates/inflowOutflowRotating/system/blockMeshDict b/etc/templates/inflowOutflowRotating/system/blockMeshDict
index 6de435522b15d1bf20596aec570c7794a55b1db3..155d6eb364eaf8bb883494599c236e1a83ee4e4c 100644
--- a/etc/templates/inflowOutflowRotating/system/blockMeshDict
+++ b/etc/templates/inflowOutflowRotating/system/blockMeshDict
@@ -58,7 +58,7 @@ geometry
     }
 }
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/etc/templates/inflowOutflowRotating/system/blockMeshDict-box b/etc/templates/inflowOutflowRotating/system/blockMeshDict-box
index a761d4fecbf635b99c4b2b96adf95ea9564b54a8..a362f0657cf7afd7bce061c517475b62bc38b81f 100644
--- a/etc/templates/inflowOutflowRotating/system/blockMeshDict-box
+++ b/etc/templates/inflowOutflowRotating/system/blockMeshDict-box
@@ -27,7 +27,7 @@ backgroundMesh
     zCells  20;
 }
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C
index d9b2e0b3a4da62f726d643eb374d36e0b7d12e10..3a922ed016c5fe9420d575ee6ab68a9dc10cd440 100644
--- a/src/OSspecific/POSIX/POSIX.C
+++ b/src/OSspecific/POSIX/POSIX.C
@@ -88,7 +88,7 @@ static inline bool isBackupName(const Foam::fileName& name)
     {
         return false;
     }
-    else if (name[name.size()-1] == '~')
+    else if (name.back() == '~')
     {
         return true;
     }
diff --git a/src/OSspecific/POSIX/printStack.C b/src/OSspecific/POSIX/printStack.C
index bee02686b3613b0d6ba3fe72082bb5e13d3524f8..4031b91d77abc3496e4c32d987910b06f3aaa546 100644
--- a/src/OSspecific/POSIX/printStack.C
+++ b/src/OSspecific/POSIX/printStack.C
@@ -40,12 +40,11 @@ namespace Foam
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-string pOpen(const string &cmd, label line=0)
+string pOpen(const string& cmd, label line=0)
 {
-    string res = "\n";
+    string res;
 
     FILE *cmdPipe = popen(cmd.c_str(), "r");
-
     if (cmdPipe)
     {
         char *buf = nullptr;
@@ -54,8 +53,7 @@ string pOpen(const string &cmd, label line=0)
         for (label cnt = 0; cnt <= line; cnt++)
         {
             size_t linecap = 0;
-            ssize_t linelen;
-            linelen = ::getline(&buf, &linecap, cmdPipe);
+            ssize_t linelen = ::getline(&buf, &linecap, cmdPipe);
 
             if (linelen < 0)
             {
@@ -65,6 +63,11 @@ string pOpen(const string &cmd, label line=0)
             if (cnt == line)
             {
                 res = string(buf);
+                // Trim trailing newline
+                if (res.size())
+                {
+                    res.resize(res.size()-1);
+                }
                 break;
             }
         }
@@ -77,7 +80,7 @@ string pOpen(const string &cmd, label line=0)
         pclose(cmdPipe);
     }
 
-    return res.substr(0, res.size() - 1);
+    return res;
 }
 
 
diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files
index dba68b7a11a50f280dd8d40094039ee5c9688900..d9f2104c1831186f3e8a24e2e052509245f60f68 100644
--- a/src/OpenFOAM/Make/files
+++ b/src/OpenFOAM/Make/files
@@ -211,7 +211,7 @@ $(functionEntries)/includeEntry/includeEntry.C
 $(functionEntries)/includeEtcEntry/includeEtcEntry.C
 $(functionEntries)/includeFuncEntry/includeFuncEntry.C
 $(functionEntries)/includeIfPresentEntry/includeIfPresentEntry.C
-$(functionEntries)/inputModeEntry/inputModeEntry.C
+$(functionEntries)/inputMode/inputMode.C
 $(functionEntries)/removeEntry/removeEntry.C
 
 IOdictionary = db/IOobjects/IOdictionary
diff --git a/src/OpenFOAM/containers/HashTables/HashTableFwd.H b/src/OpenFOAM/containers/HashTables/HashTableFwd.H
new file mode 100644
index 0000000000000000000000000000000000000000..2b3fe403b1e90f6156abffea546d8dc37df22356
--- /dev/null
+++ b/src/OpenFOAM/containers/HashTables/HashTableFwd.H
@@ -0,0 +1,53 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2017 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
+
+InNamspace
+    Foam
+
+Description
+    Forwards for various hash table types
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef HashTableFwd_H
+#define HashTableFwd_H
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+template<class T, class Key, class Hash> class HashTable;
+template<class T, class Key, class Hash> class HashPtrTable;
+template<class Key, class Hash> class HashSet;
+
+template<class T> class Map;
+template<class T> class PtrMap;
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/db/IOobject/IOobject.C b/src/OpenFOAM/db/IOobject/IOobject.C
index 5ec0b29cf0f60c09abbc6cc8859189751880d32f..1dfeac42536108a40b887f3be44eb6d05153b858 100644
--- a/src/OpenFOAM/db/IOobject/IOobject.C
+++ b/src/OpenFOAM/db/IOobject/IOobject.C
@@ -149,7 +149,7 @@ bool Foam::IOobject::fileNameComponents
         // No '/' found (or empty entirely)
         // => no instance or local
 
-        name = word::validated(path, false);
+        name = word::validate(path);
     }
     else if (first == 0)
     {
@@ -160,7 +160,7 @@ bool Foam::IOobject::fileNameComponents
 
         const std::string ending = path.substr(last+1);
         nameLen = ending.size();  // The raw length of name
-        name = word::validated(ending, false);
+        name = word::validate(ending);
     }
     else
     {
@@ -176,7 +176,7 @@ bool Foam::IOobject::fileNameComponents
 
         const std::string ending = path.substr(last+1);
         nameLen = ending.size();  // The raw length of name
-        name = word::validated(ending, false);
+        name = word::validate(ending);
     }
 
     // Check for valid (and stripped) name, regardless of the debug level
diff --git a/src/OpenFOAM/db/IOobject/IOobject.H b/src/OpenFOAM/db/IOobject/IOobject.H
index b41ef980f26d46c3ffa367bf5774b98c1319fdcc..7b89997c8a53dafeb31fafdeca090400f3b1f258 100644
--- a/src/OpenFOAM/db/IOobject/IOobject.H
+++ b/src/OpenFOAM/db/IOobject/IOobject.H
@@ -174,11 +174,11 @@ protected:
     // Protected Member Functions
 
         //- Construct and return an IFstream for the object.
-        // \Return nullptr if the stream construction failed
+        // \return nullptr if the stream construction failed
         Istream* objectStream();
 
         //- Return an IFstream for the object given the exact file.
-        // \Return nullptr if the stream construction failed
+        // \return nullptr if the stream construction failed
         Istream* objectStream(const fileName& fName);
 
         //- Set the object state to bad
diff --git a/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C b/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C
index 7d639e7b5cb6014e54382458c32cb4c67bfdb3dd..3147e59380e4ddeb68c5bf7cfbb54fb9063dd2c1 100644
--- a/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C
+++ b/src/OpenFOAM/db/IOobject/IOobjectReadHeader.C
@@ -65,7 +65,7 @@ bool Foam::IOobject::readHeader(Istream& is)
      && firstToken.wordToken() == "FoamFile"
     )
     {
-        dictionary headerDict(is);
+        const dictionary headerDict(is);
 
         is.version(headerDict.lookup("version"));
         is.format(headerDict.lookup("format"));
diff --git a/src/OpenFOAM/db/IOobjectList/IOobjectList.C b/src/OpenFOAM/db/IOobjectList/IOobjectList.C
index 981e5ca2e579dcd38079617c1692c6165fcfa44a..f70f3e7ebfcffc107a5d63d45f43488ffcf6606e 100644
--- a/src/OpenFOAM/db/IOobjectList/IOobjectList.C
+++ b/src/OpenFOAM/db/IOobjectList/IOobjectList.C
@@ -154,14 +154,14 @@ Foam::IOobjectList::IOobjectList
     }
 
     // Create a list of file names in this directory
-    fileNameList objNames =
+    const auto objNames =
         readDir(db.path(newInstance, db.dbDir()/local), fileName::FILE);
 
-    forAll(objNames, i)
+    for (const auto& objName : objNames)
     {
         IOobject* objectPtr = new IOobject
         (
-            objNames[i],
+            objName,
             newInstance,
             local,
             db,
@@ -170,8 +170,23 @@ Foam::IOobjectList::IOobjectList
             registerObject
         );
 
-        // Use object with local scope
-        if (objectPtr->typeHeaderOk<IOList<label>>(false))
+        bool ok = false;
+        const bool throwingIOerr = FatalIOError.throwExceptions();
+
+        try
+        {
+            // Use object with local scope and current instance (no searching)
+            ok = objectPtr->typeHeaderOk<IOList<label>>(false, false);
+        }
+        catch (Foam::IOerror& err)
+        {
+            Warning
+                << err << nl << endl;
+        }
+
+        FatalIOError.throwExceptions(throwingIOerr);
+
+        if (ok)
         {
             insert(objectPtr->name(), objectPtr);
         }
diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.C
index 5707d2d5c96d8d87bf14f161984d08735fa38714..333aeca259c72b0a1b8edbc98155725df7aab477 100644
--- a/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.C
+++ b/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.C
@@ -56,8 +56,8 @@ inline void Foam::UIPstream::readFromBuffer(T& t)
 inline void Foam::UIPstream::readFromBuffer
 (
     void* data,
-    size_t count,
-    size_t align
+    const size_t count,
+    const size_t align
 )
 {
     if (align > 1)
@@ -76,6 +76,22 @@ inline void Foam::UIPstream::readFromBuffer
 }
 
 
+inline Foam::Istream& Foam::UIPstream::readStringFromBuffer(std::string& str)
+{
+    size_t len;
+    readFromBuffer(len);
+    // Uses the underlying std::string::operator=()
+    // - no stripInvalid invoked (the sending side should have done that)
+    // - relies on trailing '\0' char (so cannot send anything with an embedded
+    //   nul char)
+    str = &externalBuf_[externalBufPosition_];
+    externalBufPosition_ += len + 1;
+    checkEof();
+
+    return *this;
+}
+
+
 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
 
 Foam::UIPstream::~UIPstream()
@@ -107,7 +123,7 @@ Foam::Istream& Foam::UIPstream::read(token& t)
 
     char c;
 
-    // return on error
+    // Return on error
     if (!read(c))
     {
         t.setBad();
@@ -141,7 +157,7 @@ Foam::Istream& Foam::UIPstream::read(token& t)
         }
 
         // Word
-        case token::WORD :
+        case token::tokenType::WORD :
         {
             word* pval = new word;
             if (read(*pval))
@@ -165,30 +181,26 @@ Foam::Istream& Foam::UIPstream::read(token& t)
         }
 
         // String
-        case token::VERBATIMSTRING :
+        case token::tokenType::VERBATIMSTRING :
         {
             // Recurse to read actual string
             read(t);
-            t.type() = token::VERBATIMSTRING;
+            t.type() = token::tokenType::VERBATIMSTRING;
             return *this;
         }
-        case token::VARIABLE :
+        case token::tokenType::VARIABLE :
         {
             // Recurse to read actual string
             read(t);
-            t.type() = token::VARIABLE;
+            t.type() = token::tokenType::VARIABLE;
             return *this;
         }
-        case token::STRING :
+        case token::tokenType::STRING :
         {
             string* pval = new string;
             if (read(*pval))
             {
                 t = pval;
-                if (c == token::VERBATIMSTRING)
-                {
-                    t.type() = token::VERBATIMSTRING;
-                }
             }
             else
             {
@@ -199,7 +211,7 @@ Foam::Istream& Foam::UIPstream::read(token& t)
         }
 
         // Label
-        case token::LABEL :
+        case token::tokenType::LABEL :
         {
             label val;
             if (read(val))
@@ -214,7 +226,7 @@ Foam::Istream& Foam::UIPstream::read(token& t)
         }
 
         // floatScalar
-        case token::FLOAT_SCALAR :
+        case token::tokenType::FLOAT_SCALAR :
         {
             floatScalar val;
             if (read(val))
@@ -229,7 +241,7 @@ Foam::Istream& Foam::UIPstream::read(token& t)
         }
 
         // doubleScalar
-        case token::DOUBLE_SCALAR :
+        case token::tokenType::DOUBLE_SCALAR :
         {
             doubleScalar val;
             if (read(val))
@@ -272,23 +284,13 @@ Foam::Istream& Foam::UIPstream::read(char& c)
 
 Foam::Istream& Foam::UIPstream::read(word& str)
 {
-    size_t len;
-    readFromBuffer(len);
-    str = &externalBuf_[externalBufPosition_];
-    externalBufPosition_ += len + 1;
-    checkEof();
-    return *this;
+    return readStringFromBuffer(str);
 }
 
 
 Foam::Istream& Foam::UIPstream::read(string& str)
 {
-    size_t len;
-    readFromBuffer(len);
-    str = &externalBuf_[externalBufPosition_];
-    externalBufPosition_ += len + 1;
-    checkEof();
-    return *this;
+    return readStringFromBuffer(str);
 }
 
 
diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.H
index b4aefe4446b7978ffa177eedcbea18d38fd0a960..4913693741f8b24e50f858947f6ec90b5943a3bd 100644
--- a/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.H
+++ b/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.H
@@ -80,10 +80,19 @@ class UIPstream
 
         //- Read a T from the transfer buffer
         template<class T>
-        inline void readFromBuffer(T&);
+        inline void readFromBuffer(T& t);
 
-        //- Read data from the transfer buffer
-        inline void readFromBuffer(void* data, size_t count, size_t align);
+        //- Read count bytes of data from the transfer buffer
+        //  using align byte alignment
+        inline void readFromBuffer
+        (
+            void* data,
+            const size_t count,
+            const size_t align
+        );
+
+        //- Read string length and its content.
+        inline Istream& readStringFromBuffer(std::string& str);
 
 
 public:
@@ -139,28 +148,28 @@ public:
             );
 
             //- Return next token from stream
-            Istream& read(token&);
+            Istream& read(token& t);
 
             //- Read a character
-            Istream& read(char&);
+            Istream& read(char& c);
 
             //- Read a word
-            Istream& read(word&);
+            Istream& read(word& str);
 
-            // Read a string (including enclosing double-quotes)
-            Istream& read(string&);
+            // Read a string
+            Istream& read(string& str);
 
             //- Read a label
-            Istream& read(label&);
+            Istream& read(label& val);
 
             //- Read a floatScalar
-            Istream& read(floatScalar&);
+            Istream& read(floatScalar& val);
 
             //- Read a doubleScalar
-            Istream& read(doubleScalar&);
+            Istream& read(doubleScalar& val);
 
-            //- Read binary block
-            Istream& read(char*, std::streamsize);
+            //- Read binary block with 8-byte alignment.
+            Istream& read(char* data, const std::streamsize count);
 
             //- Rewind and return the stream so that it may be read again
             Istream& rewind();
diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.C
index 8e6a5eb17ada5019ea52033a0f7db1d33c9036c9..6667389b742231d9e691716d6dc487a3503db62a 100644
--- a/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.C
+++ b/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.C
@@ -51,8 +51,8 @@ inline void Foam::UOPstream::writeToBuffer(const char& c)
 inline void Foam::UOPstream::writeToBuffer
 (
     const void* data,
-    size_t count,
-    size_t align
+    const size_t count,
+    const size_t align
 )
 {
     if (!sendBuf_.capacity())
@@ -77,6 +77,13 @@ inline void Foam::UOPstream::writeToBuffer
 }
 
 
+inline void Foam::UOPstream::writeStringToBuffer(const std::string& str)
+{
+    const size_t len = str.size();
+    writeToBuffer(len);
+    writeToBuffer(str.c_str(), len + 1, 1);
+}
+
 
 // * * * * * * * * * * * * * * * * Constructor * * * * * * * * * * * * * * * //
 
@@ -153,14 +160,14 @@ Foam::UOPstream::~UOPstream()
 Foam::Ostream& Foam::UOPstream::write(const token& t)
 {
     // Raw token output only supported for verbatim strings for now
-    if (t.type() == token::VERBATIMSTRING)
+    if (t.type() == token::tokenType::VERBATIMSTRING)
     {
-        write(char(token::VERBATIMSTRING));
+        writeToBuffer(char(token::tokenType::VERBATIMSTRING));
         write(t.stringToken());
     }
-    else if (t.type() == token::VARIABLE)
+    else if (t.type() == token::tokenType::VARIABLE)
     {
-        write(char(token::VARIABLE));
+        writeToBuffer(char(token::tokenType::VARIABLE));
         write(t.stringToken());
     }
     else
@@ -185,7 +192,7 @@ Foam::Ostream& Foam::UOPstream::write(const char c)
 
 Foam::Ostream& Foam::UOPstream::write(const char* str)
 {
-    word nonWhiteChars(string::validate<word>(str));
+    const word nonWhiteChars(string::validate<word>(str));
 
     if (nonWhiteChars.size() == 1)
     {
@@ -204,11 +211,8 @@ Foam::Ostream& Foam::UOPstream::write(const char* str)
 
 Foam::Ostream& Foam::UOPstream::write(const word& str)
 {
-    write(char(token::WORD));
-
-    size_t len = str.size();
-    writeToBuffer(len);
-    writeToBuffer(str.c_str(), len + 1, 1);
+    writeToBuffer(char(token::tokenType::WORD));
+    writeStringToBuffer(str);
 
     return *this;
 }
@@ -216,11 +220,8 @@ Foam::Ostream& Foam::UOPstream::write(const word& str)
 
 Foam::Ostream& Foam::UOPstream::write(const string& str)
 {
-    write(char(token::STRING));
-
-    size_t len = str.size();
-    writeToBuffer(len);
-    writeToBuffer(str.c_str(), len + 1, 1);
+    writeToBuffer(char(token::tokenType::STRING));
+    writeStringToBuffer(str);
 
     return *this;
 }
@@ -234,16 +235,13 @@ Foam::Ostream& Foam::UOPstream::writeQuoted
 {
     if (quoted)
     {
-        write(char(token::STRING));
+        writeToBuffer(char(token::tokenType::STRING));
     }
     else
     {
-        write(char(token::WORD));
+        writeToBuffer(char(token::tokenType::WORD));
     }
-
-    size_t len = str.size();
-    writeToBuffer(len);
-    writeToBuffer(str.c_str(), len + 1, 1);
+    writeStringToBuffer(str);
 
     return *this;
 }
@@ -251,7 +249,7 @@ Foam::Ostream& Foam::UOPstream::writeQuoted
 
 Foam::Ostream& Foam::UOPstream::write(const int32_t val)
 {
-    write(char(token::LABEL));
+    writeToBuffer(char(token::tokenType::LABEL));
     writeToBuffer(val);
     return *this;
 }
@@ -259,7 +257,7 @@ Foam::Ostream& Foam::UOPstream::write(const int32_t val)
 
 Foam::Ostream& Foam::UOPstream::write(const int64_t val)
 {
-    write(char(token::LABEL));
+    writeToBuffer(char(token::tokenType::LABEL));
     writeToBuffer(val);
     return *this;
 }
@@ -267,7 +265,7 @@ Foam::Ostream& Foam::UOPstream::write(const int64_t val)
 
 Foam::Ostream& Foam::UOPstream::write(const floatScalar val)
 {
-    write(char(token::FLOAT_SCALAR));
+    writeToBuffer(char(token::tokenType::FLOAT_SCALAR));
     writeToBuffer(val);
     return *this;
 }
@@ -275,13 +273,17 @@ Foam::Ostream& Foam::UOPstream::write(const floatScalar val)
 
 Foam::Ostream& Foam::UOPstream::write(const doubleScalar val)
 {
-    write(char(token::DOUBLE_SCALAR));
+    writeToBuffer(char(token::tokenType::DOUBLE_SCALAR));
     writeToBuffer(val);
     return *this;
 }
 
 
-Foam::Ostream& Foam::UOPstream::write(const char* data, std::streamsize count)
+Foam::Ostream& Foam::UOPstream::write
+(
+    const char* data,
+    const std::streamsize count
+)
 {
     if (format() != BINARY)
     {
diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.H
index 349ac52104aedfaa0775bae53aa7f37463908a1b..6ee40e03781dc5042ca3b36d08bcaa639d425671 100644
--- a/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.H
+++ b/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.H
@@ -74,13 +74,23 @@ class UOPstream
 
         //- Write a T to the transfer buffer
         template<class T>
-        inline void writeToBuffer(const T&);
+        inline void writeToBuffer(const T& t);
 
         //- Write a char to the transfer buffer
-        inline void writeToBuffer(const char&);
+        inline void writeToBuffer(const char& c);
 
-        //- Write data to the transfer buffer
-        inline void writeToBuffer(const void* data, size_t count, size_t align);
+        //- Write count bytes of data to the transfer buffer
+        //  using align byte alignment
+        inline void writeToBuffer
+        (
+            const void* data,
+            const size_t count,
+            const size_t align
+        );
+
+        //- Write string length and content.
+        //  The content includes the trailing nul char.
+        inline void writeStringToBuffer(const std::string& str);
 
 
 public:
@@ -102,7 +112,7 @@ public:
         );
 
         //- Construct given buffers
-        UOPstream(const int toProcNo, PstreamBuffers&);
+        UOPstream(const int toProcNo, PstreamBuffers& buffers);
 
 
     //- Destructor
@@ -134,42 +144,43 @@ public:
             );
 
             //- Write next token to stream
-            Ostream& write(const token&);
+            Ostream& write(const token& t);
 
-            //- Write character
-            Ostream& write(const char);
+            //- Write single character. Whitespace is suppressed.
+            Ostream& write(const char c);
 
-            //- Write character string
-            Ostream& write(const char*);
+            //- Write the word-characters of a character string.
+            //  Sends as a single char, or as word.
+            Ostream& write(const char* str);
 
             //- Write word
-            Ostream& write(const word&);
+            Ostream& write(const word& str);
 
             //- Write string
-            Ostream& write(const string&);
+            Ostream& write(const string& str);
 
             //- Write std::string surrounded by quotes.
             //  Optional write without quotes.
             Ostream& writeQuoted
             (
-                const std::string&,
+                const std::string& str,
                 const bool quoted=true
             );
 
-            //- Write int32_t
-            virtual Ostream& write(const int32_t);
+            //- Write int32_t as a label
+            virtual Ostream& write(const int32_t val);
 
-            //- Write int64_t
-            Ostream& write(const int64_t);
+            //- Write int64_t as a label
+            Ostream& write(const int64_t val);
 
             //- Write floatScalar
-            Ostream& write(const floatScalar);
+            Ostream& write(const floatScalar val);
 
             //- Write doubleScalar
-            Ostream& write(const doubleScalar);
+            Ostream& write(const doubleScalar val);
 
-            //- Write binary block
-            Ostream& write(const char*, std::streamsize);
+            //- Write binary block with 8-byte alignment.
+            Ostream& write(const char* data, const std::streamsize count);
 
             //- Add indentation characters
             void indent()
@@ -223,7 +234,7 @@ public:
         // Print
 
             //- Print description of IOstream to Ostream
-            void print(Ostream&) const;
+            void print(Ostream& os) const;
 };
 
 
diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H
index 7e71fc543c211a7d1db8a2305023233b33cf9eb5..0b936c9f7eca40bf373c6d109bfd135ee8e7a2ff 100644
--- a/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H
+++ b/src/OpenFOAM/db/IOstreams/Pstreams/UPstream.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2017 OpenFOAM Foundation
-     \\/     M anipulation  | Copyright 2015-2016 OpenCFD Ltd.
+     \\/     M anipulation  | Copyright (C) 2015-2016 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C
index 7bd031d87a49e4a8ea70fa85971aeaed675e2359..40c2d8e5950f39b6bc7d929944eb8d4a33f92c23 100644
--- a/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C
+++ b/src/OpenFOAM/db/IOstreams/Sstreams/ISstream.C
@@ -224,7 +224,7 @@ Foam::Istream& Foam::ISstream::read(token& t)
                 else
                 {
                     t = sPtr;
-                    t.type() = token::VERBATIMSTRING;
+                    t.type() = token::tokenType::VERBATIMSTRING;
                 }
 
                 return *this;
@@ -266,7 +266,7 @@ Foam::Istream& Foam::ISstream::read(token& t)
                 else
                 {
                     t = sPtr;
-                    t.type() = token::VARIABLE;
+                    t.type() = token::tokenType::VARIABLE;
                 }
                 return *this;
             }
@@ -604,13 +604,14 @@ Foam::Istream& Foam::ISstream::readVariable(string& str)
         // Read, counting brackets
         buf[nChar++] = c;
 
+        // Also allow '/' between ${...} blocks for slash-scoping of entries
         while
         (
             get(c)
          && (
                 c == token::BEGIN_BLOCK
              || c == token::END_BLOCK
-             || word::valid(c)
+             || word::valid(c) || c == '/'
             )
         )
         {
@@ -620,7 +621,7 @@ Foam::Istream& Foam::ISstream::readVariable(string& str)
                 buf[errLen] = '\0';
 
                 FatalIOErrorInFunction(*this)
-                    << "word '" << buf << "...'\n"
+                    << "variable '" << buf << "...'\n"
                     << "    is too long (max. " << maxLen << " characters)"
                     << exit(FatalIOError);
 
@@ -656,7 +657,7 @@ Foam::Istream& Foam::ISstream::readVariable(string& str)
                 buf[errLen] = '\0';
 
                 FatalIOErrorInFunction(*this)
-                    << "word '" << buf << "...'\n"
+                    << "variable '" << buf << "...'\n"
                     << "    is too long (max. " << maxLen << " characters)"
                     << exit(FatalIOError);
 
diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C
index 0feb8353408fcdd80c6f71b98ec9da6ea0d333dc..5dc8a3e6bd9078250ae44ea908c37b79cd015444 100644
--- a/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C
+++ b/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C
@@ -31,7 +31,7 @@ License
 
 Foam::Ostream& Foam::OSstream::write(const token& t)
 {
-    if (t.type() == token::VERBATIMSTRING)
+    if (t.type() == token::tokenType::VERBATIMSTRING)
     {
         write(char(token::HASH));
         write(char(token::BEGIN_BLOCK));
@@ -39,9 +39,9 @@ Foam::Ostream& Foam::OSstream::write(const token& t)
         write(char(token::HASH));
         write(char(token::END_BLOCK));
     }
-    else if (t.type() == token::VARIABLE)
+    else if (t.type() == token::tokenType::VARIABLE)
     {
-        writeQuoted( t.stringToken(), false);
+        writeQuoted(t.stringToken(), false);
     }
     return *this;
 }
@@ -81,9 +81,9 @@ Foam::Ostream& Foam::OSstream::write(const string& str)
     os_ << token::BEGIN_STRING;
 
     int backslash = 0;
-    for (string::const_iterator iter = str.begin(); iter != str.end(); ++iter)
+    for (auto iter = str.cbegin(); iter != str.cend(); ++iter)
     {
-        char c = *iter;
+        const char c = *iter;
 
         if (c == '\\')
         {
@@ -132,14 +132,9 @@ Foam::Ostream& Foam::OSstream::writeQuoted
         os_ << token::BEGIN_STRING;
 
         int backslash = 0;
-        for
-        (
-            string::const_iterator iter = str.begin();
-            iter != str.end();
-            ++iter
-        )
+        for (auto iter = str.cbegin(); iter != str.cend(); ++iter)
         {
-            char c = *iter;
+            const char c = *iter;
 
             if (c == '\\')
             {
diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.C
index f9ff715821afa3cef7b0a10bd6b7c76ecc2838a9..cb28408f7dec651c2e0bbe902bab9e6c9c6f677b 100644
--- a/src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.C
+++ b/src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.C
@@ -67,7 +67,7 @@ void Foam::prefixOSstream::print(Ostream& os) const
 
 Foam::Ostream& Foam::prefixOSstream::write(const token& t)
 {
-    if (t.type() == token::VERBATIMSTRING)
+    if (t.type() == token::tokenType::VERBATIMSTRING)
     {
         write(char(token::HASH));
         write(char(token::BEGIN_BLOCK));
@@ -75,7 +75,7 @@ Foam::Ostream& Foam::prefixOSstream::write(const token& t)
         write(char(token::HASH));
         write(char(token::END_BLOCK));
     }
-    else if (t.type() == token::VARIABLE)
+    else if (t.type() == token::tokenType::VARIABLE)
     {
         writeQuoted(t.stringToken(), false);
     }
diff --git a/src/OpenFOAM/db/IOstreams/token/token.C b/src/OpenFOAM/db/IOstreams/token/token.C
index 4246fc80e740c70cbd953beb6c48fbe4e8769f24..17019bda99ddeb9c8ab1ac4e37d3a893312e2b5b 100644
--- a/src/OpenFOAM/db/IOstreams/token/token.C
+++ b/src/OpenFOAM/db/IOstreams/token/token.C
@@ -92,7 +92,7 @@ bool Foam::token::compound::isCompound(const word& name)
 
 Foam::token::compound& Foam::token::transferCompoundToken(const Istream& is)
 {
-    if (type_ == COMPOUND)
+    if (type_ == tokenType::COMPOUND)
     {
         if (compoundTokenPtr_->empty())
         {
diff --git a/src/OpenFOAM/db/IOstreams/token/token.H b/src/OpenFOAM/db/IOstreams/token/token.H
index b883cd376d527cb1a0aeaf01e95b3b0aa02182fd..1de16e5e13a993e556153f224b01ee3a728c6dcd 100644
--- a/src/OpenFOAM/db/IOstreams/token/token.H
+++ b/src/OpenFOAM/db/IOstreams/token/token.H
@@ -197,7 +197,7 @@ public:
 
             // Write
 
-                virtual void write(Ostream&) const = 0;
+                virtual void write(Ostream& os) const = 0;
 
 
         // IOstream Operators
@@ -284,28 +284,47 @@ public:
         inline token();
 
         //- Construct as copy
-        inline token(const token&);
+        inline token(const token& t);
 
         //- Construct punctuation character token
-        inline token(punctuationToken, label lineNumber=0);
+        inline explicit token(punctuationToken p);
 
         //- Construct word token
-        inline token(const word&, label lineNumber=0);
+        inline explicit token(const word& w);
 
         //- Construct string token
-        inline token(const string&, label lineNumber=0);
+        inline explicit token(const string& str);
 
         //- Construct label token
-        inline token(const label, label lineNumber=0);
+        inline explicit token(const label val);
 
         //- Construct floatScalar token
-        inline token(const floatScalar, label lineNumber=0);
+        inline explicit token(const floatScalar val);
 
         //- Construct doubleScalar token
-        inline token(const doubleScalar, label lineNumber=0);
+        inline explicit token(const doubleScalar val);
+
+
+        //- Construct punctuation character token
+        inline token(punctuationToken p, const label lineNumber);
+
+        //- Construct word token
+        inline token(const word& w, const label lineNumber);
+
+        //- Construct string token
+        inline token(const string& str, const label lineNumber);
+
+        //- Construct label token
+        inline token(const label val, const label lineNumber);
+
+        //- Construct floatScalar token
+        inline token(const floatScalar val, const label lineNumber);
+
+        //- Construct doubleScalar token
+        inline token(const doubleScalar val, const label lineNumber);
 
         //- Construct from Istream
-        token(Istream&);
+        token(Istream& is);
 
 
     //- Destructor
@@ -377,43 +396,43 @@ public:
 
         // Assignment
 
-            inline void operator=(const token&);
+            inline void operator=(const token& t);
 
-            inline void operator=(const punctuationToken);
+            inline void operator=(const punctuationToken p);
 
-            inline void operator=(word*);
-            inline void operator=(const word&);
+            inline void operator=(word* wPtr);
+            inline void operator=(const word& w);
 
-            inline void operator=(string*);
-            inline void operator=(const string&);
+            inline void operator=(string* strPtr);
+            inline void operator=(const string& str);
 
-            inline void operator=(const label);
-            inline void operator=(const floatScalar);
-            inline void operator=(const doubleScalar);
+            inline void operator=(const label val);
+            inline void operator=(const floatScalar val);
+            inline void operator=(const doubleScalar val);
 
-            inline void operator=(compound*);
+            inline void operator=(compound* compPtr);
 
 
         // Equality
 
-            inline bool operator==(const token&) const;
-            inline bool operator==(const punctuationToken) const;
-            inline bool operator==(const word&) const;
-            inline bool operator==(const string&) const;
-            inline bool operator==(const label) const;
-            inline bool operator==(const floatScalar) const;
-            inline bool operator==(const doubleScalar) const;
+            inline bool operator==(const token& t) const;
+            inline bool operator==(const punctuationToken p) const;
+            inline bool operator==(const word& w) const;
+            inline bool operator==(const string& str) const;
+            inline bool operator==(const label val) const;
+            inline bool operator==(const floatScalar val) const;
+            inline bool operator==(const doubleScalar val) const;
 
 
         // Inequality
 
-            inline bool operator!=(const token&) const;
-            inline bool operator!=(const punctuationToken) const;
-            inline bool operator!=(const word&) const;
-            inline bool operator!=(const string&) const;
-            inline bool operator!=(const label) const;
-            inline bool operator!=(const floatScalar) const;
-            inline bool operator!=(const doubleScalar) const;
+            inline bool operator!=(const token& t) const;
+            inline bool operator!=(const punctuationToken p) const;
+            inline bool operator!=(const word& w) const;
+            inline bool operator!=(const string& str) const;
+            inline bool operator!=(const label val) const;
+            inline bool operator!=(const floatScalar val) const;
+            inline bool operator!=(const doubleScalar val) const;
 
 
     // IOstream operators
diff --git a/src/OpenFOAM/db/IOstreams/token/tokenI.H b/src/OpenFOAM/db/IOstreams/token/tokenI.H
index 9831e0569551001803544d08216d7f77a8a4617a..32417b4e7507d7fcb32ae525a34f3e97cf88c163 100644
--- a/src/OpenFOAM/db/IOstreams/token/tokenI.H
+++ b/src/OpenFOAM/db/IOstreams/token/tokenI.H
@@ -27,15 +27,20 @@ License
 
 inline void Foam::token::clear()
 {
-    if (type_ == WORD)
+    if (type_ == tokenType::WORD)
     {
         delete wordTokenPtr_;
     }
-    else if (type_ == STRING || type_ == VARIABLE || type_ == VERBATIMSTRING)
+    else if
+    (
+        type_ == tokenType::STRING
+     || type_ == tokenType::VARIABLE
+     || type_ == tokenType::VERBATIMSTRING
+    )
     {
         delete stringTokenPtr_;
     }
-    else if (type_ == COMPOUND)
+    else if (type_ == tokenType::COMPOUND)
     {
         if (compoundTokenPtr_->unique())
         {
@@ -47,7 +52,7 @@ inline void Foam::token::clear()
         }
     }
 
-    type_ = UNDEFINED;
+    type_ = tokenType::UNDEFINED;
 }
 
 
@@ -55,7 +60,7 @@ inline void Foam::token::clear()
 
 inline Foam::token::token()
 :
-    type_(UNDEFINED),
+    type_(tokenType::UNDEFINED),
     lineNumber_(0)
 {}
 
@@ -67,49 +72,85 @@ inline Foam::token::token(const token& t)
 {
     switch (type_)
     {
-        case token::UNDEFINED:
+        case tokenType::UNDEFINED:
         break;
 
-        case PUNCTUATION:
+        case tokenType::PUNCTUATION:
             punctuationToken_ = t.punctuationToken_;
         break;
 
-        case WORD:
+        case tokenType::WORD:
             wordTokenPtr_ = new word(*t.wordTokenPtr_);
         break;
 
-        case STRING:
-        case VARIABLE:
-        case VERBATIMSTRING:
+        case tokenType::STRING:
+        case tokenType::VARIABLE:
+        case tokenType::VERBATIMSTRING:
             stringTokenPtr_ = new string(*t.stringTokenPtr_);
         break;
 
-        case LABEL:
+        case tokenType::LABEL:
             labelToken_ = t.labelToken_;
         break;
 
-        case FLOAT_SCALAR:
+        case tokenType::FLOAT_SCALAR:
             floatScalarToken_ = t.floatScalarToken_;
         break;
 
-        case DOUBLE_SCALAR:
+        case tokenType::DOUBLE_SCALAR:
             doubleScalarToken_ = t.doubleScalarToken_;
         break;
 
-        case COMPOUND:
+        case tokenType::COMPOUND:
             compoundTokenPtr_ = t.compoundTokenPtr_;
             compoundTokenPtr_->refCount::operator++();
         break;
 
-        case token::ERROR:
+        case tokenType::ERROR:
         break;
     }
 }
 
 
+inline Foam::token::token(punctuationToken p)
+:
+    token(p, 0)
+{}
+
+
+inline Foam::token::token(const word& w)
+:
+    token(w, 0)
+{}
+
+
+inline Foam::token::token(const string& str)
+:
+    token(str, 0)
+{}
+
+
+inline Foam::token::token(const label val)
+:
+    token(val, 0)
+{}
+
+
+inline Foam::token::token(const floatScalar val)
+:
+    token(val, 0)
+{}
+
+
+inline Foam::token::token(const doubleScalar val)
+:
+    token(val, 0)
+{}
+
+
 inline Foam::token::token(punctuationToken p, label lineNumber)
 :
-    type_(PUNCTUATION),
+    type_(tokenType::PUNCTUATION),
     punctuationToken_(p),
     lineNumber_(lineNumber)
 {}
@@ -117,40 +158,40 @@ inline Foam::token::token(punctuationToken p, label lineNumber)
 
 inline Foam::token::token(const word& w, label lineNumber)
 :
-    type_(WORD),
+    type_(tokenType::WORD),
     wordTokenPtr_(new word(w)),
     lineNumber_(lineNumber)
 {}
 
 
-inline Foam::token::token(const string& s, label lineNumber)
+inline Foam::token::token(const string& str, label lineNumber)
 :
-    type_(STRING),
-    stringTokenPtr_(new string(s)),
+    type_(tokenType::STRING),
+    stringTokenPtr_(new string(str)),
     lineNumber_(lineNumber)
 {}
 
 
-inline Foam::token::token(const label l, label lineNumber)
+inline Foam::token::token(const label val, label lineNumber)
 :
-    type_(LABEL),
-    labelToken_(l),
+    type_(tokenType::LABEL),
+    labelToken_(val),
     lineNumber_(lineNumber)
 {}
 
 
-inline Foam::token::token(const floatScalar s, label lineNumber)
+inline Foam::token::token(const floatScalar val, label lineNumber)
 :
-    type_(FLOAT_SCALAR),
-    floatScalarToken_(s),
+    type_(tokenType::FLOAT_SCALAR),
+    floatScalarToken_(val),
     lineNumber_(lineNumber)
 {}
 
 
-inline Foam::token::token(const doubleScalar s, label lineNumber)
+inline Foam::token::token(const doubleScalar val, label lineNumber)
 :
-    type_(DOUBLE_SCALAR),
-    doubleScalarToken_(s),
+    type_(tokenType::DOUBLE_SCALAR),
+    doubleScalarToken_(val),
     lineNumber_(lineNumber)
 {}
 
@@ -177,27 +218,27 @@ inline Foam::token::tokenType&  Foam::token::type()
 
 inline bool Foam::token::good() const
 {
-    return (type_ != ERROR && type_ != UNDEFINED);
+    return (type_ != tokenType::ERROR && type_ != tokenType::UNDEFINED);
 }
 
 inline bool Foam::token::undefined() const
 {
-    return (type_ == UNDEFINED);
+    return (type_ == tokenType::UNDEFINED);
 }
 
 inline bool Foam::token::error() const
 {
-    return (type_ == ERROR);
+    return (type_ == tokenType::ERROR);
 }
 
 inline bool Foam::token::isPunctuation() const
 {
-    return (type_ == PUNCTUATION);
+    return (type_ == tokenType::PUNCTUATION);
 }
 
 inline Foam::token::punctuationToken  Foam::token::pToken() const
 {
-    if (type_ == PUNCTUATION)
+    if (type_ == tokenType::PUNCTUATION)
     {
         return punctuationToken_;
     }
@@ -210,12 +251,12 @@ inline Foam::token::punctuationToken  Foam::token::pToken() const
 
 inline bool Foam::token::isWord() const
 {
-    return (type_ == WORD);
+    return (type_ == tokenType::WORD);
 }
 
 inline const Foam::word& Foam::token::wordToken() const
 {
-    if (type_ == WORD)
+    if (type_ == tokenType::WORD)
     {
         return *wordTokenPtr_;
     }
@@ -228,17 +269,27 @@ inline const Foam::word& Foam::token::wordToken() const
 
 inline bool Foam::token::isVariable() const
 {
-    return (type_ == VARIABLE);
+    return (type_ == tokenType::VARIABLE);
 }
 
 inline bool Foam::token::isString() const
 {
-    return (type_ == STRING || type_ == VARIABLE || type_ == VERBATIMSTRING);
+    return
+    (
+        type_ == tokenType::STRING
+     || type_ == tokenType::VARIABLE
+     || type_ == tokenType::VERBATIMSTRING
+    );
 }
 
 inline const Foam::string& Foam::token::stringToken() const
 {
-    if (type_ == STRING || type_ == VARIABLE || type_ == VERBATIMSTRING)
+    if
+    (
+        type_ == tokenType::STRING
+     || type_ == tokenType::VARIABLE
+     || type_ == tokenType::VERBATIMSTRING
+    )
     {
         return *stringTokenPtr_;
     }
@@ -251,12 +302,12 @@ inline const Foam::string& Foam::token::stringToken() const
 
 inline bool Foam::token::isLabel() const
 {
-    return (type_ == LABEL);
+    return (type_ == tokenType::LABEL);
 }
 
 inline Foam::label Foam::token::labelToken() const
 {
-    if (type_ == LABEL)
+    if (type_ == tokenType::LABEL)
     {
         return labelToken_;
     }
@@ -269,12 +320,12 @@ inline Foam::label Foam::token::labelToken() const
 
 inline bool Foam::token::isFloatScalar() const
 {
-    return (type_ == FLOAT_SCALAR);
+    return (type_ == tokenType::FLOAT_SCALAR);
 }
 
 inline Foam::floatScalar Foam::token::floatScalarToken() const
 {
-    if (type_ == FLOAT_SCALAR)
+    if (type_ == tokenType::FLOAT_SCALAR)
     {
         return floatScalarToken_;
     }
@@ -288,12 +339,12 @@ inline Foam::floatScalar Foam::token::floatScalarToken() const
 
 inline bool Foam::token::isDoubleScalar() const
 {
-    return (type_ == DOUBLE_SCALAR);
+    return (type_ == tokenType::DOUBLE_SCALAR);
 }
 
 inline Foam::doubleScalar Foam::token::doubleScalarToken() const
 {
-    if (type_ == DOUBLE_SCALAR)
+    if (type_ == tokenType::DOUBLE_SCALAR)
     {
         return doubleScalarToken_;
     }
@@ -307,16 +358,20 @@ inline Foam::doubleScalar Foam::token::doubleScalarToken() const
 
 inline bool Foam::token::isScalar() const
 {
-    return (type_ == FLOAT_SCALAR || type_ == DOUBLE_SCALAR);
+    return
+    (
+        type_ == tokenType::FLOAT_SCALAR
+     || type_ == tokenType::DOUBLE_SCALAR
+    );
 }
 
 inline Foam::scalar Foam::token::scalarToken() const
 {
-    if (type_ == FLOAT_SCALAR)
+    if (type_ == tokenType::FLOAT_SCALAR)
     {
         return floatScalarToken_;
     }
-    else if (type_ == DOUBLE_SCALAR)
+    else if (type_ == tokenType::DOUBLE_SCALAR)
     {
         return doubleScalarToken_;
     }
@@ -329,12 +384,12 @@ inline Foam::scalar Foam::token::scalarToken() const
 
 inline bool Foam::token::isNumber() const
 {
-    return (type_ == LABEL || isScalar());
+    return (type_ == tokenType::LABEL || isScalar());
 }
 
 inline Foam::scalar Foam::token::number() const
 {
-    if (type_ == LABEL)
+    if (type_ == tokenType::LABEL)
     {
         return labelToken_;
     }
@@ -351,12 +406,12 @@ inline Foam::scalar Foam::token::number() const
 
 inline bool Foam::token::isCompound() const
 {
-    return (type_ == COMPOUND);
+    return (type_ == tokenType::COMPOUND);
 }
 
 inline const Foam::token::compound& Foam::token::compoundToken() const
 {
-    if (type_ == COMPOUND)
+    if (type_ == tokenType::COMPOUND)
     {
         return *compoundTokenPtr_;
     }
@@ -382,7 +437,7 @@ inline Foam::label& Foam::token::lineNumber()
 inline void Foam::token::setBad()
 {
     clear();
-    type_ = ERROR;
+    type_ = tokenType::ERROR;
 }
 
 
@@ -395,41 +450,41 @@ inline void Foam::token::operator=(const token& t)
 
     switch (type_)
     {
-        case token::UNDEFINED:
+        case tokenType::UNDEFINED:
         break;
 
-        case PUNCTUATION:
+        case tokenType::PUNCTUATION:
             punctuationToken_ = t.punctuationToken_;
         break;
 
-        case WORD:
+        case tokenType::WORD:
             wordTokenPtr_ = new word(*t.wordTokenPtr_);
         break;
 
-        case STRING:
-        case VARIABLE:
-        case VERBATIMSTRING:
+        case tokenType::STRING:
+        case tokenType::VARIABLE:
+        case tokenType::VERBATIMSTRING:
             stringTokenPtr_ = new string(*t.stringTokenPtr_);
         break;
 
-        case LABEL:
+        case tokenType::LABEL:
             labelToken_ = t.labelToken_;
         break;
 
-        case FLOAT_SCALAR:
+        case tokenType::FLOAT_SCALAR:
             floatScalarToken_ = t.floatScalarToken_;
         break;
 
-        case DOUBLE_SCALAR:
+        case tokenType::DOUBLE_SCALAR:
             doubleScalarToken_ = t.doubleScalarToken_;
         break;
 
-        case COMPOUND:
+        case tokenType::COMPOUND:
             compoundTokenPtr_ = t.compoundTokenPtr_;
             compoundTokenPtr_->refCount::operator++();
         break;
 
-        case token::ERROR:
+        case tokenType::ERROR:
         break;
     }
 
@@ -439,14 +494,14 @@ inline void Foam::token::operator=(const token& t)
 inline void Foam::token::operator=(const punctuationToken p)
 {
     clear();
-    type_ = PUNCTUATION;
+    type_ = tokenType::PUNCTUATION;
     punctuationToken_ = p;
 }
 
 inline void Foam::token::operator=(word* wPtr)
 {
     clear();
-    type_ = WORD;
+    type_ = tokenType::WORD;
     wordTokenPtr_ = wPtr;
 }
 
@@ -455,44 +510,44 @@ inline void Foam::token::operator=(const word& w)
     operator=(new word(w));
 }
 
-inline void Foam::token::operator=(string* sPtr)
+inline void Foam::token::operator=(string* strPtr)
 {
     clear();
-    type_ = STRING;
-    stringTokenPtr_ = sPtr;
+    type_ = tokenType::STRING;
+    stringTokenPtr_ = strPtr;
 }
 
-inline void Foam::token::operator=(const string& s)
+inline void Foam::token::operator=(const string& str)
 {
-    operator=(new string(s));
+    operator=(new string(str));
 }
 
-inline void Foam::token::operator=(const label l)
+inline void Foam::token::operator=(const label val)
 {
     clear();
-    type_ = LABEL;
-    labelToken_ = l;
+    type_ = tokenType::LABEL;
+    labelToken_ = val;
 }
 
-inline void Foam::token::operator=(const floatScalar s)
+inline void Foam::token::operator=(const floatScalar val)
 {
     clear();
-    type_ = FLOAT_SCALAR;
-    floatScalarToken_ = s;
+    type_ = tokenType::FLOAT_SCALAR;
+    floatScalarToken_ = val;
 }
 
-inline void Foam::token::operator=(const doubleScalar s)
+inline void Foam::token::operator=(const doubleScalar val)
 {
     clear();
-    type_ = DOUBLE_SCALAR;
-    doubleScalarToken_ = s;
+    type_ = tokenType::DOUBLE_SCALAR;
+    doubleScalarToken_ = val;
 }
 
-inline void Foam::token::operator=(Foam::token::compound* cPtr)
+inline void Foam::token::operator=(Foam::token::compound* compPtr)
 {
     clear();
-    type_ = COMPOUND;
-    compoundTokenPtr_ = cPtr;
+    type_ = tokenType::COMPOUND;
+    compoundTokenPtr_ = compPtr;
 }
 
 
@@ -505,33 +560,33 @@ inline bool Foam::token::operator==(const token& t) const
 
     switch (type_)
     {
-        case token::UNDEFINED:
+        case tokenType::UNDEFINED:
             return true;
 
-        case PUNCTUATION:
+        case tokenType::PUNCTUATION:
             return punctuationToken_ == t.punctuationToken_;
 
-        case WORD:
+        case tokenType::WORD:
             return *wordTokenPtr_ == *t.wordTokenPtr_;
 
-        case STRING:
-        case VARIABLE:
-        case VERBATIMSTRING:
+        case tokenType::STRING:
+        case tokenType::VARIABLE:
+        case tokenType::VERBATIMSTRING:
             return *stringTokenPtr_ == *t.stringTokenPtr_;
 
-        case LABEL:
+        case tokenType::LABEL:
             return labelToken_ == t.labelToken_;
 
-        case FLOAT_SCALAR:
+        case tokenType::FLOAT_SCALAR:
             return equal(floatScalarToken_, t.floatScalarToken_);
 
-        case DOUBLE_SCALAR:
+        case tokenType::DOUBLE_SCALAR:
             return equal(doubleScalarToken_, t.doubleScalarToken_);
 
-        case COMPOUND:
+        case tokenType::COMPOUND:
             return compoundTokenPtr_ == t.compoundTokenPtr_;
 
-        case token::ERROR:
+        case tokenType::ERROR:
             return true;
     }
 
@@ -540,36 +595,52 @@ inline bool Foam::token::operator==(const token& t) const
 
 inline bool Foam::token::operator==(const punctuationToken p) const
 {
-    return (type_ == PUNCTUATION && punctuationToken_ == p);
+    return (type_ == tokenType::PUNCTUATION && punctuationToken_ == p);
 }
 
 inline bool Foam::token::operator==(const word& w) const
 {
-    return (type_ == WORD && wordToken() == w);
+    return (type_ == tokenType::WORD && wordToken() == w);
 }
 
-inline bool Foam::token::operator==(const string& s) const
+inline bool Foam::token::operator==(const string& str) const
 {
     return
     (
-        (type_ == STRING || type_ == VARIABLE || type_ == VERBATIMSTRING)
-     && stringToken() == s
+        (
+            type_ == tokenType::STRING
+         || type_ == tokenType::VARIABLE
+         || type_ == tokenType::VERBATIMSTRING
+        )
+     && stringToken() == str
     );
 }
 
-inline bool Foam::token::operator==(const label l) const
+inline bool Foam::token::operator==(const label val) const
 {
-    return (type_ == LABEL && labelToken_ == l);
+    return
+    (
+        type_ == tokenType::LABEL
+     && labelToken_ == val
+    );
 }
 
-inline bool Foam::token::operator==(const floatScalar s) const
+inline bool Foam::token::operator==(const floatScalar val) const
 {
-    return (type_ == FLOAT_SCALAR && equal(floatScalarToken_, s));
+    return
+    (
+        type_ == tokenType::FLOAT_SCALAR
+     && equal(floatScalarToken_, val)
+    );
 }
 
-inline bool Foam::token::operator==(const doubleScalar s) const
+inline bool Foam::token::operator==(const doubleScalar val) const
 {
-    return (type_ == DOUBLE_SCALAR && equal(doubleScalarToken_, s));
+    return
+    (
+        type_ == tokenType::DOUBLE_SCALAR
+     && equal(doubleScalarToken_, val)
+    );
 }
 
 inline bool Foam::token::operator!=(const token& t) const
@@ -587,24 +658,24 @@ inline bool Foam::token::operator!=(const word& w) const
     return !operator==(w);
 }
 
-inline bool Foam::token::operator!=(const string& s) const
+inline bool Foam::token::operator!=(const string& str) const
 {
-    return !operator==(s);
+    return !operator==(str);
 }
 
-inline bool Foam::token::operator!=(const floatScalar s) const
+inline bool Foam::token::operator!=(const label val) const
 {
-    return !operator==(s);
+    return !operator==(val);
 }
 
-inline bool Foam::token::operator!=(const doubleScalar s) const
+inline bool Foam::token::operator!=(const floatScalar val) const
 {
-    return !operator==(s);
+    return !operator==(val);
 }
 
-inline bool Foam::token::operator!=(const label l) const
+inline bool Foam::token::operator!=(const doubleScalar val) const
 {
-    return !operator==(l);
+    return !operator==(val);
 }
 
 
diff --git a/src/OpenFOAM/db/IOstreams/token/tokenIO.C b/src/OpenFOAM/db/IOstreams/token/tokenIO.C
index acf14b96fec6ce949f7a84760aa0229fb02ad360..f451de1796a626335d799b64c3bcbd1df9149a50 100644
--- a/src/OpenFOAM/db/IOstreams/token/tokenIO.C
+++ b/src/OpenFOAM/db/IOstreams/token/tokenIO.C
@@ -33,7 +33,7 @@ License
 
 Foam::token::token(Istream& is)
 :
-    type_(UNDEFINED)
+    type_(tokenType::UNDEFINED)
 {
     is.read(*this);
 }
@@ -52,47 +52,47 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const token& t)
 {
     switch (t.type_)
     {
-        case token::UNDEFINED:
+        case token::tokenType::UNDEFINED:
             os << "UNDEFINED";
             WarningInFunction
                 << "Undefined token" << endl;
         break;
 
-        case token::PUNCTUATION:
+        case token::tokenType::PUNCTUATION:
             os << t.punctuationToken_;
         break;
 
-        case token::WORD:
+        case token::tokenType::WORD:
             os << *t.wordTokenPtr_;
         break;
 
-        case token::STRING:
-        case token::VERBATIMSTRING:
+        case token::tokenType::STRING:
+        case token::tokenType::VERBATIMSTRING:
             os << *t.stringTokenPtr_;
         break;
 
-        case token::VARIABLE:
+        case token::tokenType::VARIABLE:
             // Behaviour differs according to stream type
             os.write(t);
         break;
 
-        case token::LABEL:
+        case token::tokenType::LABEL:
             os << t.labelToken_;
         break;
 
-        case token::FLOAT_SCALAR:
+        case token::tokenType::FLOAT_SCALAR:
             os << t.floatScalarToken_;
         break;
 
-        case token::DOUBLE_SCALAR:
+        case token::tokenType::DOUBLE_SCALAR:
             os << t.doubleScalarToken_;
         break;
 
-        case token::COMPOUND:
+        case token::tokenType::COMPOUND:
             os << *t.compoundTokenPtr_;
         break;
 
-        case token::ERROR:
+        case token::tokenType::ERROR:
             os << "ERROR";
             WarningInFunction
                 << "Error token" << endl;
@@ -141,43 +141,43 @@ ostream& Foam::operator<<(ostream& os, const InfoProxy<token>& ip)
 
     switch (t.type())
     {
-        case token::UNDEFINED:
+        case token::tokenType::UNDEFINED:
             os  << " an undefined token";
         break;
 
-        case token::PUNCTUATION:
+        case token::tokenType::PUNCTUATION:
             os  << " the punctuation token " << '\'' << t.pToken() << '\'';
         break;
 
-        case token::WORD:
+        case token::tokenType::WORD:
             os  << " the word " << '\'' << t.wordToken() << '\'';
         break;
 
-        case token::STRING:
+        case token::tokenType::STRING:
             os  << " the string " << t.stringToken();
         break;
 
-        case token::VARIABLE:
+        case token::tokenType::VARIABLE:
             os  << " the variable " << t.stringToken();
         break;
 
-        case token::VERBATIMSTRING:
+        case token::tokenType::VERBATIMSTRING:
             os  << " the verbatim string " << t.stringToken();
         break;
 
-        case token::LABEL:
+        case token::tokenType::LABEL:
             os  << " the label " << t.labelToken();
         break;
 
-        case token::FLOAT_SCALAR:
+        case token::tokenType::FLOAT_SCALAR:
             os  << " the floatScalar " << t.floatScalarToken();
         break;
 
-        case token::DOUBLE_SCALAR:
+        case token::tokenType::DOUBLE_SCALAR:
             os  << " the doubleScalar " << t.doubleScalarToken();
         break;
 
-        case token::COMPOUND:
+        case token::tokenType::COMPOUND:
         {
             if (t.compoundToken().empty())
             {
@@ -192,7 +192,7 @@ ostream& Foam::operator<<(ostream& os, const InfoProxy<token>& ip)
         }
         break;
 
-        case token::ERROR:
+        case token::tokenType::ERROR:
             os  << " an error";
         break;
 
@@ -213,43 +213,43 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const InfoProxy<token>& ip)
 
     switch (t.type())
     {
-        case token::UNDEFINED:
+        case token::tokenType::UNDEFINED:
             os  << " an undefined token";
         break;
 
-        case token::PUNCTUATION:
+        case token::tokenType::PUNCTUATION:
             os  << " the punctuation token " << '\'' << t.pToken() << '\'';
         break;
 
-        case token::WORD:
+        case token::tokenType::WORD:
             os  << " the word " << '\'' << t.wordToken() << '\'';
         break;
 
-        case token::STRING:
+        case token::tokenType::STRING:
             os  << " the string " << t.stringToken();
         break;
 
-        case token::VARIABLE:
+        case token::tokenType::VARIABLE:
             os  << " the variable " << t.stringToken();
         break;
 
-        case token::VERBATIMSTRING:
+        case token::tokenType::VERBATIMSTRING:
             os  << " the verbatim string " << t.stringToken();
         break;
 
-        case token::LABEL:
+        case token::tokenType::LABEL:
             os  << " the label " << t.labelToken();
         break;
 
-        case token::FLOAT_SCALAR:
+        case token::tokenType::FLOAT_SCALAR:
             os  << " the floatScalar " << t.floatScalarToken();
         break;
 
-        case token::DOUBLE_SCALAR:
+        case token::tokenType::DOUBLE_SCALAR:
             os  << " the doubleScalar " << t.doubleScalarToken();
         break;
 
-        case token::COMPOUND:
+        case token::tokenType::COMPOUND:
         {
             if (t.compoundToken().empty())
             {
@@ -264,7 +264,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const InfoProxy<token>& ip)
         }
         break;
 
-        case token::ERROR:
+        case token::tokenType::ERROR:
             os  << " an error";
         break;
 
diff --git a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.C b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.C
index 9ffe1016205b7d9711ca08571b4d8351ac24fba9..6167956e7096b3167d6a15a26753f2127fbc47ee 100644
--- a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.C
+++ b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.C
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -88,6 +88,18 @@ Foam::ITstream& Foam::dictionaryEntry::stream() const
 }
 
 
+const Foam::dictionary* Foam::dictionaryEntry::dictPtr() const
+{
+    return this;
+}
+
+
+Foam::dictionary* Foam::dictionaryEntry::dictPtr()
+{
+    return this;
+}
+
+
 const Foam::dictionary& Foam::dictionaryEntry::dict() const
 {
     return *this;
diff --git a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H
index c2d552b775068193dfa6c15ca2ba4df7c495a010..06976c789b0f114c5e6c9dc018987e46713012b8 100644
--- a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H
+++ b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntry.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -52,10 +52,8 @@ namespace Foam
 {
 
 // Forward declaration of friend functions and operators
-
 class dictionaryEntry;
-
-Ostream& operator<<(Ostream& os, const dictionaryEntry& de);
+Ostream& operator<<(Ostream& os, const dictionaryEntry& e);
 
 
 /*---------------------------------------------------------------------------*\
@@ -111,13 +109,13 @@ public:
 
     // Member functions
 
-        //- Return the dictionary name (scoped, e.g. dictA::dictB::dictC)
+        //- Return the scoped dictionary name (eg, dictA.dictB.dictC)
         const fileName& name() const
         {
             return dictionary::name();
         }
 
-        //- Return the dictionary name (scoped, e.g. dictA::dictB::dictC)
+        //- Return the scoped dictionary name (eg, dictA.dictB.dictC)
         fileName& name()
         {
             return dictionary::name();
@@ -133,11 +131,12 @@ public:
         //  calling this function generates a FatalError
         ITstream& stream() const;
 
-        //- Return true because this entry is a dictionary
-        bool isDict() const
-        {
-            return true;
-        }
+
+        //- Return pointer to this dictionary
+        virtual const dictionary* dictPtr() const;
+
+        //- Return non-const pointer to this dictionary
+        virtual dictionary* dictPtr();
 
         //- Return dictionary
         const dictionary& dict() const;
@@ -159,7 +158,7 @@ public:
 
     // Ostream operator
 
-        friend Ostream& operator<<(Ostream& os, const dictionaryEntry& de);
+        friend Ostream& operator<<(Ostream& os, const dictionaryEntry& e);
 };
 
 
diff --git a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntryIO.C b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntryIO.C
index 5a4feda30eb15d1e611e3882fe7192c117099c2d..d2cdd07fd99f872714f403e5f5c5be211818e288 100644
--- a/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntryIO.C
+++ b/src/OpenFOAM/db/dictionary/dictionaryEntry/dictionaryEntryIO.C
@@ -23,7 +23,6 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include "keyType.H"
 #include "dictionaryEntry.H"
 #include "IOstreams.H"
 
@@ -66,9 +65,9 @@ void Foam::dictionaryEntry::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * Ostream operator  * * * * * * * * * * * * * * //
 
-Foam::Ostream& Foam::operator<<(Ostream& os, const dictionaryEntry& de)
+Foam::Ostream& Foam::operator<<(Ostream& os, const dictionaryEntry& e)
 {
-    de.write(os);
+    e.write(os);
     return os;
 }
 
diff --git a/src/OpenFOAM/db/dictionary/dictionaryIO.C b/src/OpenFOAM/db/dictionary/dictionaryIO.C
index 836add62f945569134f323a449ca8d7af5a5082f..85e806ca470ce185698732fd6fb42da42c66b5ca 100644
--- a/src/OpenFOAM/db/dictionary/dictionaryIO.C
+++ b/src/OpenFOAM/db/dictionary/dictionaryIO.C
@@ -25,7 +25,6 @@ License
 
 #include "dictionary.H"
 #include "IFstream.H"
-#include "inputModeEntry.H"
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
@@ -49,7 +48,7 @@ Foam::dictionary::dictionary(Istream& is)
     parent_(dictionary::null)
 {
     // Reset input mode as this is a "top-level" dictionary
-    functionEntries::inputModeEntry::clear();
+    entry::resetInputMode();
 
     read(is);
 }
@@ -61,7 +60,7 @@ Foam::dictionary::dictionary(Istream& is, const bool keepHeader)
     parent_(dictionary::null)
 {
     // Reset input mode as this is a "top-level" dictionary
-    functionEntries::inputModeEntry::clear();
+    entry::resetInputMode();
 
     read(is, keepHeader);
 }
@@ -130,7 +129,7 @@ bool Foam::dictionary::read(Istream& is)
 
 bool Foam::dictionary::substituteKeyword(const word& keyword, bool mergeEntry)
 {
-    const word varName = keyword(1, keyword.size()-1);
+    const word varName = keyword.substr(1);
 
     // Lookup the variable name in the given dictionary
     const entry* ePtr = lookupEntryPtr(varName, true, true);
@@ -157,7 +156,7 @@ bool Foam::dictionary::substituteKeyword(const word& keyword, bool mergeEntry)
 Foam::Istream& Foam::operator>>(Istream& is, dictionary& dict)
 {
     // Reset input mode assuming this is a "top-level" dictionary
-    functionEntries::inputModeEntry::clear();
+    entry::resetInputMode();
 
     dict.clear();
     dict.name() = is.name();
diff --git a/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H
index 389e79c7a33d682620e16ba0155477e344768ea2..2e575713b9d0400ca0d1b5edfee77a2ab131d1bf 100644
--- a/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H
+++ b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntry.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2016 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -52,8 +52,7 @@ namespace Foam
 // Forward declaration of friend functions and operators
 
 class dictionaryListEntry;
-
-Ostream& operator<<(Ostream&, const dictionaryListEntry&);
+Ostream& operator<<(Ostream& os, const dictionaryListEntry& e);
 
 
 /*---------------------------------------------------------------------------*\
@@ -66,9 +65,6 @@ class dictionaryListEntry
 {
     // Private Member Functions
 
-        //- Returns size of dictionary without FoamFile
-        static label realSize(const dictionary&);
-
         //- Disallow bitwise copy
         dictionaryListEntry(const dictionaryListEntry&) = delete;
 
@@ -78,13 +74,13 @@ public:
     // Constructors
 
         //- Construct from the parent dictionary and Istream
-        dictionaryListEntry(const dictionary& parentDict, Istream&);
+        dictionaryListEntry(const dictionary& parentDict, Istream& is);
 
         //- Construct as copy for the given parent dictionary
         dictionaryListEntry
         (
             const dictionary& parentDict,
-            const dictionaryListEntry&
+            const dictionaryListEntry& dictEnt
         );
 
         autoPtr<entry> clone(const dictionary& parentDict) const
@@ -96,7 +92,7 @@ public:
     // Member functions
 
         //- Write
-        virtual void write(Ostream&) const;
+        virtual void write(Ostream& os) const;
 
         //- Return info proxy.
         //  Used to print token information to a stream
@@ -108,12 +104,12 @@ public:
 
     // Ostream operator
 
-        friend Ostream& operator<<(Ostream&, const dictionaryListEntry&);
+        friend Ostream& operator<<(Ostream& os, const dictionaryListEntry& e);
 };
 
 
 template<>
-Ostream& operator<<(Ostream&, const InfoProxy<dictionaryListEntry>&);
+Ostream& operator<<(Ostream& os, const InfoProxy<dictionaryListEntry>& ip);
 
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C
index c368e68035ad66ceb4867b3f561f311125ce38f7..53399cc5430b76a89d51f64b0396493188cb408d 100644
--- a/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C
+++ b/src/OpenFOAM/db/dictionary/dictionaryListEntry/dictionaryListEntryIO.C
@@ -24,12 +24,12 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "dictionaryListEntry.H"
-#include "keyType.H"
 #include "IOstreams.H"
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
+// * * * * * * * * * * * * * * * Local Functions * * * * * * * * * * * * * * //
 
-Foam::label Foam::dictionaryListEntry::realSize(const dictionary& dict)
+// File-scope: The dictionary size without the "FoamFile" entry
+static Foam::label realSize(const Foam::dictionary& dict)
 {
     if (dict.size() < 1 || dict.first()->keyword() != "FoamFile")
     {
@@ -127,9 +127,9 @@ void Foam::dictionaryListEntry::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * Ostream operator  * * * * * * * * * * * * * * //
 
-Foam::Ostream& Foam::operator<<(Ostream& os, const dictionaryListEntry& de)
+Foam::Ostream& Foam::operator<<(Ostream& os, const dictionaryListEntry& e)
 {
-    de.write(os);
+    e.write(os);
     return os;
 }
 
diff --git a/src/OpenFOAM/db/dictionary/entry/entry.C b/src/OpenFOAM/db/dictionary/entry/entry.C
index afb5a725229564f7d5e5f213dd74af45beeb2310..81b88563b036c1c2a4a0113a12c8762c83dec6c6 100644
--- a/src/OpenFOAM/db/dictionary/entry/entry.C
+++ b/src/OpenFOAM/db/dictionary/entry/entry.C
@@ -35,6 +35,17 @@ int Foam::entry::disableFunctionEntries
 );
 
 
+Foam::entry::inputMode Foam::entry::globalInputMode = inputMode::MERGE;
+
+
+// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
+
+void Foam::entry::resetInputMode()
+{
+    globalInputMode = inputMode::MERGE;
+}
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 Foam::entry::entry(const keyType& keyword)
diff --git a/src/OpenFOAM/db/dictionary/entry/entry.H b/src/OpenFOAM/db/dictionary/entry/entry.H
index 6bb08646a4b6c8305d7853d35e167f91113f4826..5b73b78c7d65b27555f4e3bba13e5ae00cccdfa3 100644
--- a/src/OpenFOAM/db/dictionary/entry/entry.H
+++ b/src/OpenFOAM/db/dictionary/entry/entry.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -67,6 +67,24 @@ class entry
 :
     public IDLList<entry>::link
 {
+public:
+
+    // Enums/Typedefs
+
+        //- The input mode options
+        enum class inputMode
+        {
+            MERGE,      //!< Merge sub-dictionaries when possible
+            OVERWRITE,  //!< Keep last entry. Silently remove previous ones
+            PROTECT,    //!< Keep initial entry. Silently ignore subsequent ones
+            WARN,       //!< Keep initial entry. Warn about subsequent ones.
+            ERROR,      //!< FatalError for duplicate entries
+            GLOBAL      //!< Use global value from #globalInputMode variable
+        };
+
+
+private:
+
     // Private data
 
         //- Keyword of entry
@@ -85,15 +103,20 @@ class entry
         );
 
         //- Get the next valid keyword.
-        //  Warn when an invalid token is encountered that is not an end-of-block or eof
+        //  Warn when an invalid token is encountered that is not EOF or
+        //  end-of-block
         //  \return True if it is a valid keyType.
         static bool getKeyword(keyType& keyword, Istream& is);
 
 
 public:
 
+    //- Enable or disable use of function entries and variable expansions.
     static int disableFunctionEntries;
 
+    //- The current global input-mode.
+    static inputMode globalInputMode;
+
 
     // Constructors
 
@@ -115,11 +138,19 @@ public:
         virtual autoPtr<entry> clone() const;
 
         //- Construct from Istream and insert into dictionary
-        static bool New(dictionary& parentDict, Istream& is);
+        static bool New
+        (
+            dictionary& parentDict,
+            Istream& is,
+            const inputMode inMode = inputMode::GLOBAL
+        );
 
         //- Construct on freestore from Istream and return
         static autoPtr<entry> New(Istream& is);
 
+        //- Reset the #globalInputMode to %merge
+        static void resetInputMode();
+
 
     //- Destructor
     virtual ~entry()
@@ -152,37 +183,54 @@ public:
         //- Return line number of last token in dictionary
         virtual label endLineNumber() const = 0;
 
+
         //- Return true if this entry is a stream
         virtual bool isStream() const
         {
             return false;
         }
 
-        //- Return token stream if this entry is a primitive entry
+        //- Return token stream, if entry is a primitive entry
         virtual ITstream& stream() const = 0;
 
+
         //- Return true if this entry is a dictionary
         virtual bool isDict() const
         {
-            return false;
+            return this->dictPtr();
+        }
+
+        //- Return pointer to dictionary, if entry is a dictionary.
+        //  Return nullptr if the entry is not a dictionary.
+        virtual const dictionary* dictPtr() const
+        {
+            return nullptr;
         }
 
-        //- Return dictionary if this entry is a dictionary
+        //- Return non-const pointer to dictionary, if entry is a dictionary
+        //  Return nullptr if the entry is not a dictionary.
+        virtual dictionary* dictPtr()
+        {
+            return nullptr;
+        }
+
+        //- Return dictionary, if entry is a dictionary
         virtual const dictionary& dict() const = 0;
 
-        //- Return non-const access to dictionary if this entry is a dictionary
+        //- Return non-const access to dictionary, if entry is a dictionary
         virtual dictionary& dict() = 0;
 
+
         //- Write
-        virtual void write(Ostream&) const = 0;
+        virtual void write(Ostream& os) const = 0;
 
 
     // Member operators
 
-        void operator=(const entry&);
+        void operator=(const entry& e);
 
-        bool operator==(const entry&) const;
-        bool operator!=(const entry&) const;
+        bool operator==(const entry& e) const;
+        bool operator!=(const entry& e) const;
 
 
     // Ostream operator
diff --git a/src/OpenFOAM/db/dictionary/entry/entryIO.C b/src/OpenFOAM/db/dictionary/entry/entryIO.C
index e4a5a1a73b16aed336bafcd27cdc4aba2d547920..b8a75380ab5f36192d7f426e1dfecaa559a553c3 100644
--- a/src/OpenFOAM/db/dictionary/entry/entryIO.C
+++ b/src/OpenFOAM/db/dictionary/entry/entryIO.C
@@ -28,7 +28,6 @@ License
 #include "dictionaryEntry.H"
 #include "functionEntry.H"
 #include "includeEntry.H"
-#include "inputModeEntry.H"
 #include "stringOps.H"
 #include "dictionaryListEntry.H"
 
@@ -88,13 +87,13 @@ bool Foam::entry::getKeyword(keyType& keyword, Istream& is)
     else
     {
         // Otherwise the token is invalid
-        cerr<< "--> FOAM Warning : " << std::endl
+        cerr<< "--> FOAM Warning :" << nl
             << "    From function "
-            << FUNCTION_NAME << std::endl
+            << FUNCTION_NAME << nl
             << "    in file " << __FILE__
-            << " at line " << __LINE__ << std::endl
-            << "    Reading " << is.name().c_str() << std::endl
-            << "    found " << keyToken << std::endl
+            << " at line " << __LINE__ << nl
+            << "    Reading " << is.name().c_str() << nl
+            << "    found " << keyToken << nl
             << "    expected either " << token::END_BLOCK << " or EOF"
             << std::endl;
         return false;
@@ -102,8 +101,31 @@ bool Foam::entry::getKeyword(keyType& keyword, Istream& is)
 }
 
 
-bool Foam::entry::New(dictionary& parentDict, Istream& is)
+bool Foam::entry::New
+(
+    dictionary& parentDict,
+    Istream& is,
+    const entry::inputMode inMode
+)
 {
+    // The inputMode for dealing with duplicate entries
+    const entry::inputMode mode =
+    (
+        inMode == inputMode::GLOBAL
+      ? globalInputMode
+      : inMode
+    );
+
+    // If somehow the global itself is 'global' - this is a severe logic error.
+    if (mode == inputMode::GLOBAL)
+    {
+        FatalIOErrorInFunction
+        (
+            is
+        )   << "Cannot use 'GLOBAL' as an inputMode"
+            << exit(FatalIOError);
+    }
+
     is.fatalCheck(FUNCTION_NAME);
 
     keyType keyword;
@@ -135,191 +157,201 @@ bool Foam::entry::New(dictionary& parentDict, Istream& is)
         else
         {
             // Otherwise the token is invalid
-            cerr<< "--> FOAM Warning : " << std::endl
+            cerr<< "--> FOAM Warning :" << nl
                 << "    From function "
-                << FUNCTION_NAME << std::endl
+                << FUNCTION_NAME << nl
                 << "    in file " << __FILE__
-                << " at line " << __LINE__ << std::endl
-                << "    Reading " << is.name().c_str() << std::endl
-                << "    found " << keyToken << std::endl
+                << " at line " << __LINE__ << nl
+                << "    Reading " << is.name().c_str() << nl
+                << "    found " << keyToken << nl
                 << "    expected either " << token::END_BLOCK << " or EOF"
                 << std::endl;
             return false;
         }
     }
-    else  // Keyword starts entry ...
+    else if (keyword[0] == '#')
     {
-        if (keyword[0] == '#')      // ... Function entry
+        // Function entry
+
+        if (disableFunctionEntries)
+        {
+            return parentDict.add
+            (
+                new functionEntry
+                (
+                    keyword,
+                    parentDict,
+                    is
+                ),
+                false
+            );
+        }
+        else
         {
-            if (disableFunctionEntries)
+            const word functionName(keyword.substr(1), false);
+            return functionEntry::execute(functionName, parentDict, is);
+        }
+    }
+    else if
+    (
+        !disableFunctionEntries
+     && keyword[0] == '$'
+    )
+    {
+        // Substitution entry
+
+        token nextToken(is);
+        is.putBack(nextToken);
+
+        if (keyword.size() > 2 && keyword[1] == token::BEGIN_BLOCK)
+        {
+            // Recursive substitution mode.
+            // Content between {} is replaced with expansion.
+            // Then let standard variable expansion deal with rest.
+            string expanded = keyword.substr(2, keyword.size()-3);
+
+            // Substitute dictionary and environment variables.
+            // Do not allow empty substitutions.
+            stringOps::inplaceExpand(expanded, parentDict, true, false);
+
+            // Restore the '$' prefix.
+            // Use replace since operator= is private
+            keyword.std::string::replace(1, keyword.size()-1, expanded);
+        }
+
+        if (nextToken == token::BEGIN_BLOCK)
+        {
+            const word varName = keyword.substr(1);
+
+            // Lookup the variable name in the given dictionary
+            const entry* ePtr = parentDict.lookupScopedEntryPtr
+            (
+                varName,
+                true,
+                true
+            );
+
+            if (ePtr)
             {
+                // Read as primitiveEntry
+                const keyType newKeyword(ePtr->stream());
+
                 return parentDict.add
                 (
-                    new functionEntry
-                    (
-                        keyword,
-                        parentDict,
-                        is
-                    ),
+                    new dictionaryEntry(newKeyword, parentDict, is),
                     false
                 );
             }
             else
             {
-                const word functionName(keyword.substr(1), false);
-                return functionEntry::execute(functionName, parentDict, is);
+                FatalIOErrorInFunction(is)
+                    << "Attempt to use undefined variable " << varName
+                    << " as keyword"
+                    << exit(FatalIOError);
+                return false;
             }
         }
-        else if
-        (
-           !disableFunctionEntries
-         && keyword[0] == '$'
-        )                           // ... Substitution entry
+        else
         {
-            token nextToken(is);
-            is.putBack(nextToken);
+            // Deal with duplicate entries (at least partially)
+            const bool mergeEntry =
+            (
+                mode == inputMode::MERGE
+             || mode == inputMode::OVERWRITE
+            );
 
-            if (keyword.size() > 2 && keyword[1] == token::BEGIN_BLOCK)
-            {
-                // Recursive substitution mode.
-                // Content between {} is replaced with expansion.
-                // Then let standard variable expansion deal with rest.
-                string expanded = keyword.substr(2, keyword.size()-3);
+            parentDict.substituteScopedKeyword(keyword, mergeEntry);
+        }
 
-                // Substitute dictionary and environment variables.
-                // Do not allow empty substitutions.
-                stringOps::inplaceExpand(expanded, parentDict, true, false);
+        return true;
+    }
+    else
+    {
+        // Normal entry
 
-                // Restore the '$' prefix. Use replace since operator= is private
+        token nextToken(is);
+        is.putBack(nextToken);
 
-                keyword.std::string::replace(1, keyword.size()-1, expanded);
-            }
+        if (nextToken == token::END_LIST)
+        {
+            FatalIOErrorInFunction(is)
+                << "Unexpected token encountered for "
+                << keyword << " - " << nextToken.info()
+                << exit(FatalIOError);
+            return false;
+        }
 
-            if (nextToken == token::BEGIN_BLOCK)
-            {
-                const word varName = keyword.substr(1);
+        // How to manage duplicate entries
+        bool mergeEntry = false;
 
-                // lookup the variable name in the given dictionary
-                const entry* ePtr = parentDict.lookupScopedEntryPtr
-                (
-                    varName,
-                    true,
-                    true
-                );
+        // See (using exact match) if entry already present
+        entry* existingPtr = parentDict.lookupEntryPtr
+        (
+            keyword,
+            false,
+            false
+        );
 
-                if (ePtr)
+        if (existingPtr)
+        {
+            if (mode == inputMode::MERGE)
+            {
+                mergeEntry = true;
+            }
+            else if (mode == inputMode::OVERWRITE)
+            {
+                // Clear existing dictionary so merge acts like overwrite
+                if (existingPtr->isDict())
+                {
+                    existingPtr->dict().clear();
+                }
+                mergeEntry = true;
+            }
+            else if (mode == inputMode::PROTECT)
+            {
+                // Read and discard the entry.
+                // Disable function/variable expansion to avoid side-effects
+                const int oldFlag = entry::disableFunctionEntries;
+                entry::disableFunctionEntries = 1;
+
+                if (nextToken == token::BEGIN_BLOCK)
                 {
-                    // Read as primitiveEntry
-                    const keyType newKeyword(ePtr->stream());
-
-                    return parentDict.add
-                    (
-                        new dictionaryEntry(newKeyword, parentDict, is),
-                        false
-                    );
+                    dictionaryEntry dummy("dummy", parentDict, is);
                 }
                 else
                 {
-                    FatalIOErrorInFunction(is)
-                        << "Attempt to use undefined variable " << varName
-                        << " as keyword"
-                        << exit(FatalIOError);
-                    return false;
+                    primitiveEntry  dummy("dummy", parentDict, is);
                 }
-            }
-            else
-            {
-                // Deal with duplicate entries (at least partially)
-                const bool mergeEntry =
-                (
-                    functionEntries::inputModeEntry::merge()
-                 || functionEntries::inputModeEntry::overwrite()
-                );
 
-                parentDict.substituteScopedKeyword(keyword, mergeEntry);
+                entry::disableFunctionEntries = oldFlag;
+                return true;
             }
-
-            return true;
-        }
-        else                        // ... Data entries
-        {
-            token nextToken(is);
-            is.putBack(nextToken);
-
-            if (nextToken == token::END_LIST)
+            else if (mode == inputMode::ERROR)
             {
                 FatalIOErrorInFunction(is)
-                    << "Unexpected token encountered for "
-                    << keyword << " - " << nextToken.info()
+                    << "duplicate entry: " << keyword
                     << exit(FatalIOError);
+
                 return false;
             }
+        }
 
-            // Deal with duplicate entries
-            bool mergeEntry = false;
 
-            // See (using exact match) if entry already present
-            entry* existingPtr = parentDict.lookupEntryPtr
+        if (nextToken == token::BEGIN_BLOCK)
+        {
+            return parentDict.add
             (
-                keyword,
-                false,
-                false
+                new dictionaryEntry(keyword, parentDict, is),
+                mergeEntry
+            );
+        }
+        else
+        {
+            return parentDict.add
+            (
+                new primitiveEntry(keyword, parentDict, is),
+                mergeEntry
             );
-
-            if (existingPtr)
-            {
-                if (functionEntries::inputModeEntry::merge())
-                {
-                    mergeEntry = true;
-                }
-                else if (functionEntries::inputModeEntry::overwrite())
-                {
-                    // clear dictionary so merge acts like overwrite
-                    if (existingPtr->isDict())
-                    {
-                        existingPtr->dict().clear();
-                    }
-                    mergeEntry = true;
-                }
-                else if (functionEntries::inputModeEntry::protect())
-                {
-                    // read and discard the entry
-                    if (nextToken == token::BEGIN_BLOCK)
-                    {
-                        dictionaryEntry dummy(keyword, parentDict, is);
-                    }
-                    else
-                    {
-                        primitiveEntry  dummy(keyword, parentDict, is);
-                    }
-                    return true;
-                }
-                else if (functionEntries::inputModeEntry::error())
-                {
-                    FatalIOErrorInFunction(is)
-                        << "duplicate entry: " << keyword
-                        << exit(FatalIOError);
-
-                    return false;
-                }
-            }
-
-            if (nextToken == token::BEGIN_BLOCK)
-            {
-                return parentDict.add
-                (
-                    new dictionaryEntry(keyword, parentDict, is),
-                    mergeEntry
-                );
-            }
-            else
-            {
-                return parentDict.add
-                (
-                    new primitiveEntry(keyword, parentDict, is),
-                    mergeEntry
-                );
-            }
         }
     }
 }
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C
index bc5a1e65eaac532fa8cdc300b9612609cab62dcb..a7e2e2c949299f0492ca77b2474ed1c01fc1169f 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C
+++ b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.C
@@ -35,22 +35,22 @@ namespace Foam
 {
 namespace functionEntries
 {
-    defineTypeNameAndDebug(calcEntry, 0);
-
-    addToMemberFunctionSelectionTable
+    addNamedToMemberFunctionSelectionTable
     (
         functionEntry,
         calcEntry,
         execute,
-        dictionaryIstream
+        dictionaryIstream,
+        calc
     );
 
-    addToMemberFunctionSelectionTable
+    addNamedToMemberFunctionSelectionTable
     (
         functionEntry,
         calcEntry,
         execute,
-        primitiveEntryIstream
+        primitiveEntryIstream,
+        calc
     );
 
 }
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.H
index e1083db42a48683f629c25e1fd9b96761404ed33..769b33e9d3b3a336ecf3f0529a1d6765e29f3f6b 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.H
+++ b/src/OpenFOAM/db/dictionary/functionEntries/calcEntry/calcEntry.H
@@ -70,34 +70,18 @@ class calcEntry
 :
     public functionEntry
 {
-
-    // Private Member Functions
-
-        //- Disallow default bitwise copy construct
-        calcEntry(const calcEntry&);
-
-        //- Disallow default bitwise assignment
-        void operator=(const calcEntry&);
-
-
 public:
 
-    //- Runtime type information
-    ClassName("calc");
-
-
-    // Member Functions
-
-        //- Execute the functionEntry in a sub-dict context
-        static bool execute(dictionary& parentDict, Istream&);
+    //- Execute in a primitiveEntry context
+    static bool execute
+    (
+        const dictionary& parentDict,
+        primitiveEntry& thisEntry,
+        Istream& is
+    );
 
-        //- Execute the functionEntry in a primitiveEntry context
-        static bool execute
-        (
-            const dictionary& parentDict,
-            primitiveEntry&,
-            Istream&
-        );
+    //- Execute in a sub-dict context
+    static bool execute(dictionary& parentDict, Istream& is);
 
 };
 
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C
index 66e510a38f8217484843d86e0c4d8113d36b0057..2afbb7183182ec1beaf3281a5692fa2e2e06fbd9 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C
+++ b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.C
@@ -38,22 +38,23 @@ namespace functionEntries
 {
     defineTypeNameAndDebug(codeStream, 0);
 
-    addToMemberFunctionSelectionTable
+    addNamedToMemberFunctionSelectionTable
     (
         functionEntry,
         codeStream,
         execute,
-        dictionaryIstream
+        dictionaryIstream,
+        codeStream
     );
 
-    addToMemberFunctionSelectionTable
+    addNamedToMemberFunctionSelectionTable
     (
         functionEntry,
         codeStream,
         execute,
-        primitiveEntryIstream
+        primitiveEntryIstream,
+        codeStream
     );
-
 }
 }
 
@@ -175,7 +176,7 @@ Foam::functionEntries::codeStream::getFunction
     // create library if required
     if (!lib)
     {
-        bool create =
+        const bool create =
             Pstream::master()
          || (regIOobject::fileModificationSkew <= 0);   // not NFS
 
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.H b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.H
index eeb8ce9b2e2942e5c9b103a66525b2bce6497643..172e84519bca5748b6b2e3df9ea38b71752d60dc 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.H
+++ b/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.H
@@ -118,10 +118,8 @@ class codeStream
         //- Interpreter function type
         typedef void (*streamingFunctionType)(Ostream&, const dictionary&);
 
-    // Private Member Functions
 
-        //- Helper function: parent (of parent etc.) of dictionary up to the top
-        static const dictionary& topDict(const dictionary&);
+    // Private Member Functions
 
         //- Helper function: access IOobject for master-only-reading
         //  functionality
@@ -139,10 +137,10 @@ class codeStream
 
 
         //- Disallow default bitwise copy construct
-        codeStream(const codeStream&);
+        codeStream(const codeStream&) = delete;
 
         //- Disallow default bitwise assignment
-        void operator=(const codeStream&);
+        void operator=(const codeStream&) = delete;
 
 
 public:
@@ -165,14 +163,14 @@ public:
     // Member Functions
 
         //- Execute the functionEntry in a sub-dict context
-        static bool execute(dictionary& parentDict, Istream&);
+        static bool execute(dictionary& parentDict, Istream& is);
 
         //- Execute the functionEntry in a primitiveEntry context
         static bool execute
         (
             const dictionary& parentDict,
-            primitiveEntry&,
-            Istream&
+            primitiveEntry& entry,
+            Istream& is
         );
 
 };
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H
index 0c9bd6604e5ebc18b23cd365215ba335da1fb025..4d118c79ff200f28474036e1a2f02cb680da056c 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H
+++ b/src/OpenFOAM/db/dictionary/functionEntries/functionEntry/functionEntry.H
@@ -58,7 +58,7 @@ namespace Foam
 class dictionary;
 
 /*---------------------------------------------------------------------------*\
-                           Class functionEntry Declaration
+                        Class functionEntry Declaration
 \*---------------------------------------------------------------------------*/
 
 class functionEntry
@@ -71,10 +71,10 @@ class functionEntry
         static token readLine(const word& key, Istream& is);
 
         //- Disallow default bitwise copy construct
-        functionEntry(const functionEntry&);
+        functionEntry(const functionEntry&) = delete;
 
         //- Disallow default bitwise assignment
-        void operator=(const functionEntry&);
+        void operator=(const functionEntry&) = delete;
 
 
 public:
@@ -82,7 +82,7 @@ public:
     // Constructors
 
         //- Construct from keyword, parent dictionary and Istream
-        functionEntry(const word&, const dictionary&, Istream&);
+        functionEntry(const word& key, const dictionary& dict, Istream& is);
 
 
     // Member Function Selectors
@@ -105,7 +105,7 @@ public:
         (
             const word& functionName,
             dictionary& parentDict,
-            Istream&
+            Istream& is
         );
 
         declareMemberFunctionSelectionTable
@@ -127,12 +127,12 @@ public:
         (
             const word& functionName,
             const dictionary& parentDict,
-            primitiveEntry&,
-            Istream&
+            primitiveEntry& entry,
+            Istream& is
         );
 
         //- Write
-        virtual void write(Ostream&) const;
+        virtual void write(Ostream& os) const;
 };
 
 
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.C
index 42e1083c1708611346ba2a1ab4b87e95ebb092a8..9f25f28e0430e446f1d649ae8a576364c184fc8b 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.C
+++ b/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.C
@@ -31,15 +31,6 @@ License
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
-const Foam::word Foam::functionEntries::includeEntry::typeName
-(
-    Foam::functionEntries::includeEntry::typeName_()
-);
-
-// Don't lookup the debug switch here as the debug switch dictionary
-// might include includeEntry
-int Foam::functionEntries::includeEntry::debug(0);
-
 bool Foam::functionEntries::includeEntry::log(false);
 
 
@@ -47,50 +38,50 @@ namespace Foam
 {
 namespace functionEntries
 {
-    addToMemberFunctionSelectionTable
+    addNamedToMemberFunctionSelectionTable
     (
         functionEntry,
         includeEntry,
         execute,
-        dictionaryIstream
+        dictionaryIstream,
+        include
     );
 
-    addToMemberFunctionSelectionTable
+    addNamedToMemberFunctionSelectionTable
     (
         functionEntry,
         includeEntry,
         execute,
-        primitiveEntryIstream
+        primitiveEntryIstream,
+        include
     );
 }
 }
 
 // * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * * //
 
-Foam::fileName Foam::functionEntries::includeEntry::includeFileName
+Foam::fileName Foam::functionEntries::includeEntry::resolveFile
 (
     Istream& is,
     const dictionary& dict
 )
 {
     fileName fName(is);
-    // Substitute dictionary and environment variables. Allow empty
-    // substitutions.
+    // Substitute dictionary and environment variables.
+    // Allow empty substitutions.
     stringOps::inplaceExpand(fName, dict, true, true);
 
     if (fName.empty() || fName.isAbsolute())
     {
         return fName;
     }
-    else
-    {
-        // relative name
-        return fileName(is.name()).path()/fName;
-    }
+
+    // Relative name
+    return fileName(is.name()).path()/fName;
 }
 
 
-Foam::fileName Foam::functionEntries::includeEntry::includeFileName
+Foam::fileName Foam::functionEntries::includeEntry::resolveFile
 (
     const fileName& dir,
     const fileName& f,
@@ -98,19 +89,17 @@ Foam::fileName Foam::functionEntries::includeEntry::includeFileName
 )
 {
     fileName fName(f);
-    // Substitute dictionary and environment variables. Allow empty
-    // substitutions.
+    // Substitute dictionary and environment variables.
+    // Allow empty substitutions.
     stringOps::inplaceExpand(fName, dict, true, true);
 
     if (fName.empty() || fName.isAbsolute())
     {
         return fName;
     }
-    else
-    {
-        // relative name
-        return dir/fName;
-    }
+
+    // Relative name
+    return dir/fName;
 }
 
 
@@ -122,11 +111,8 @@ bool Foam::functionEntries::includeEntry::execute
     Istream& is
 )
 {
-    const fileName rawFName(is);
-    const fileName fName
-    (
-        includeFileName(is.name().path(), rawFName, parentDict)
-    );
+    const fileName rawName(is);
+    const fileName fName = resolveFile(is.name().path(), rawName, parentDict);
 
 
     // Read contents of file into parentDict
@@ -147,7 +133,7 @@ bool Foam::functionEntries::includeEntry::execute
             (
                 dynamic_cast<const regIOobject&>(top)
             );
-            //Info<< rio.name() << " : adding depenency on included file "
+            //Info<< rio.name() << " : adding dependency on included file "
             //    << fName << endl;
 
             rio.addWatch(fName);
@@ -162,7 +148,7 @@ bool Foam::functionEntries::includeEntry::execute
         (
             is
         )   << "Cannot open include file "
-            << (ifs.name().size() ? ifs.name() : rawFName)
+            << (ifs.name().size() ? ifs.name() : rawName)
             << " while reading dictionary " << parentDict.name()
             << exit(FatalIOError);
 
@@ -178,12 +164,8 @@ bool Foam::functionEntries::includeEntry::execute
     Istream& is
 )
 {
-    const fileName rawFName(is);
-    const fileName fName
-    (
-        includeFileName(is.name().path(), rawFName, parentDict)
-    );
-
+    const fileName rawName(is);
+    const fileName fName = resolveFile(is.name().path(), rawName, parentDict);
 
     // Read contents of file into parentDict
     IFstream ifs(fName);
@@ -203,7 +185,7 @@ bool Foam::functionEntries::includeEntry::execute
             (
                 dynamic_cast<const regIOobject&>(top)
             );
-            //Info<< rio.name() << " : adding depenency on included file "
+            //Info<< rio.name() << " : adding dependency on included file "
             //    << fName << endl;
 
             rio.addWatch(fName);
@@ -218,7 +200,7 @@ bool Foam::functionEntries::includeEntry::execute
         (
             is
         )   << "Cannot open include file "
-            << (ifs.name().size() ? ifs.name() : rawFName)
+            << (ifs.name().size() ? ifs.name() : rawName)
             << " while reading dictionary " << parentDict.name()
             << exit(FatalIOError);
 
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.H
index b26236f77c88743520292657d6ef860a3ba93992..bbdc122017364e22a7cef829b5e6066cd71a1f6f 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.H
+++ b/src/OpenFOAM/db/dictionary/functionEntries/includeEntry/includeEntry.H
@@ -64,52 +64,40 @@ class includeEntry
 :
     public functionEntry
 {
-    // Private Member Functions
-
-        //- Disallow default bitwise copy construct
-        includeEntry(const includeEntry&);
-
-        //- Disallow default bitwise assignment
-        void operator=(const includeEntry&);
-
 protected:
 
     // Protected Member Functions
 
         //- Read the include fileName from Istream, expand and return
-        static fileName includeFileName(Istream&, const dictionary&);
+        static fileName resolveFile(Istream& is, const dictionary& dict);
 
         //- Expand include fileName and return
-        static fileName includeFileName
+        static fileName resolveFile
         (
             const fileName& dir,
-            const fileName&,
-            const dictionary&
+            const fileName& f,
+            const dictionary& dict
         );
 
 public:
 
     // Static data members
 
-        //- Report which file is included to stdout
+        //- Report to stdout which file is included
         static bool log;
 
 
-    //- Runtime type information
-    ClassName("include");
-
-
     // Member Functions
 
-        //- Execute the functionEntry in a sub-dict context
-        static bool execute(dictionary& parentDict, Istream&);
+        //- Include file in a sub-dict context
+        static bool execute(dictionary& parentDict, Istream& is);
 
-        //- Execute the functionEntry in a primitiveEntry context
+        //- Include file in a primitiveEntry context
         static bool execute
         (
             const dictionary& parentDict,
-            primitiveEntry&,
-            Istream&
+            primitiveEntry& entry,
+            Istream& is
         );
 
 };
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.C
index 3598ab5441c1738b0159f215b70a2f92132f50a7..c9e12d0e12334974aac937fbaa27cca4622d9410 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.C
+++ b/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.C
@@ -31,15 +31,6 @@ License
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
-const Foam::word Foam::functionEntries::includeEtcEntry::typeName
-(
-    Foam::functionEntries::includeEtcEntry::typeName_()
-);
-
-// Don't lookup the debug switch here as the debug switch dictionary
-// might include includeEtcEntry
-int Foam::functionEntries::includeEtcEntry::debug(0);
-
 bool Foam::functionEntries::includeEtcEntry::log(false);
 
 
@@ -47,27 +38,29 @@ namespace Foam
 {
 namespace functionEntries
 {
-    addToMemberFunctionSelectionTable
+    addNamedToMemberFunctionSelectionTable
     (
         functionEntry,
         includeEtcEntry,
         execute,
-        dictionaryIstream
+        dictionaryIstream,
+        includeEtc
     );
 
-    addToMemberFunctionSelectionTable
+    addNamedToMemberFunctionSelectionTable
     (
         functionEntry,
         includeEtcEntry,
         execute,
-        primitiveEntryIstream
+        primitiveEntryIstream,
+        includeEtc
     );
 }
 }
 
 // * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * * //
 
-Foam::fileName Foam::functionEntries::includeEtcEntry::includeEtcFileName
+Foam::fileName Foam::functionEntries::includeEtcEntry::resolveFile
 (
     const fileName& f,
     const dictionary& dict
@@ -83,11 +76,9 @@ Foam::fileName Foam::functionEntries::includeEtcEntry::includeEtcFileName
     {
         return fName;
     }
-    else
-    {
-        // Search the etc directories for the file
-        return findEtcFile(fName);
-    }
+
+    // Search the etc directories for the file
+    return Foam::findEtcFile(fName);
 }
 
 
@@ -99,11 +90,8 @@ bool Foam::functionEntries::includeEtcEntry::execute
     Istream& is
 )
 {
-    const fileName rawFName(is);
-    const fileName fName
-    (
-        includeEtcFileName(rawFName, parentDict)
-    );
+    const fileName rawName(is);
+    const fileName fName(resolveFile(rawName, parentDict));
     IFstream ifs(fName);
 
     if (ifs)
@@ -121,7 +109,7 @@ bool Foam::functionEntries::includeEtcEntry::execute
         (
             is
         )   << "Cannot open etc file "
-            << (ifs.name().size() ? ifs.name() : rawFName)
+            << (ifs.name().size() ? ifs.name() : rawName)
             << " while reading dictionary " << parentDict.name()
             << exit(FatalIOError);
 
@@ -137,11 +125,8 @@ bool Foam::functionEntries::includeEtcEntry::execute
     Istream& is
 )
 {
-    const fileName rawFName(is);
-    const fileName fName
-    (
-        includeEtcFileName(rawFName, parentDict)
-    );
+    const fileName rawName(is);
+    const fileName fName(resolveFile(rawName, parentDict));
     IFstream ifs(fName);
 
     if (ifs)
@@ -159,7 +144,7 @@ bool Foam::functionEntries::includeEtcEntry::execute
         (
             is
         )   << "Cannot open etc file "
-            << (ifs.name().size() ? ifs.name() : rawFName)
+            << (ifs.name().size() ? ifs.name() : rawName)
             << " while reading dictionary " << parentDict.name()
             << exit(FatalIOError);
 
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.H
index b58e905b5c0c929d566cb130165fe2e3ff8dee27..4920ff7db01e472d32fde5e6d0d286e0f4b33578 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.H
+++ b/src/OpenFOAM/db/dictionary/functionEntries/includeEtcEntry/includeEtcEntry.H
@@ -79,45 +79,29 @@ class includeEtcEntry
 :
     public functionEntry
 {
-    // Private Member Functions
-
-        //- Disallow default bitwise copy construct
-        includeEtcEntry(const includeEtcEntry&);
-
-        //- Disallow default bitwise assignment
-        void operator=(const includeEtcEntry&);
-
-        //- Expand include fileName and return
-        static fileName includeEtcFileName
-        (
-            const fileName&,
-            const dictionary&
-        );
+    //- Expand include fileName and return
+    static fileName resolveFile(const fileName& f, const dictionary& dict);
 
 
 public:
 
     // Static data members
 
-        //- Report which file is included to stdout
+        //- Report to stdout which file is included
         static bool log;
 
 
-    //- Runtime type information
-    ClassName("includeEtc");
-
-
     // Member Functions
 
-        //- Execute the functionEntry in a sub-dict context
-        static bool execute(dictionary& parentDict, Istream&);
+        //- Include file in a sub-dict context
+        static bool execute(dictionary& parentDict, Istream& is);
 
-        //- Execute the functionEntry in a primitiveEntry context
+        //- Include file in a primitiveEntry context
         static bool execute
         (
             const dictionary& parentDict,
-            primitiveEntry&,
-            Istream&
+            primitiveEntry& entry,
+            Istream& is
         );
 };
 
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.C
index 79644653a981e6a785ba28f6455b1b96a4e307c7..288c1889044eaf3c10d7240f2eb51117c7767e80 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.C
+++ b/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.C
@@ -33,14 +33,13 @@ namespace Foam
 {
 namespace functionEntries
 {
-    defineTypeNameAndDebug(includeFuncEntry, 0);
-
-    addToMemberFunctionSelectionTable
+    addNamedToMemberFunctionSelectionTable
     (
         functionEntry,
         includeFuncEntry,
         execute,
-        dictionaryIstream
+        dictionaryIstream,
+        includeFunc
     );
 }
 }
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.H
index f5eae2e556bd90c00c9427da86a0061baf54cec5..08ac1f5509b45bada58b0dc52e2f4660a451ba47 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.H
+++ b/src/OpenFOAM/db/dictionary/functionEntries/includeFuncEntry/includeFuncEntry.H
@@ -83,17 +83,10 @@ class includeFuncEntry
 :
     public functionEntry
 {
-
 public:
 
-    //- Runtime type information
-    ClassName("includeFunc");
-
-
-    // Member Functions
-
-        //- Execute the functionEntry in a sub-dict context
-        static bool execute(dictionary& parentDict, Istream&);
+    //- Run function in a sub-dict context
+    static bool execute(dictionary& parentDict, Istream& is);
 };
 
 
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.C
index 59b4e443b8583437db00048af28bbb4a5da0617e..369e3b925b16f55656f91cdb32d9c1432194cebb 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.C
+++ b/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.C
@@ -31,33 +31,26 @@ License
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
-const Foam::word Foam::functionEntries::includeIfPresentEntry::typeName
-(
-    Foam::functionEntries::includeIfPresentEntry::typeName_()
-);
-
-// Don't lookup the debug switch here as the debug switch dictionary
-// might include includeIfPresentEntry
-int Foam::functionEntries::includeIfPresentEntry::debug(0);
-
 namespace Foam
 {
 namespace functionEntries
 {
-    addToMemberFunctionSelectionTable
+    addNamedToMemberFunctionSelectionTable
     (
         functionEntry,
         includeIfPresentEntry,
         execute,
-        dictionaryIstream
+        dictionaryIstream,
+        includeIfPresent
     );
 
-    addToMemberFunctionSelectionTable
+    addNamedToMemberFunctionSelectionTable
     (
         functionEntry,
         includeIfPresentEntry,
         execute,
-        primitiveEntryIstream
+        primitiveEntryIstream,
+        includeIfPresent
     );
 }
 }
@@ -70,7 +63,7 @@ bool Foam::functionEntries::includeIfPresentEntry::execute
     Istream& is
 )
 {
-    const fileName fName(includeFileName(is, parentDict));
+    const fileName fName(resolveFile(is, parentDict));
     IFstream ifs(fName);
 
     if (ifs)
@@ -105,7 +98,7 @@ bool Foam::functionEntries::includeIfPresentEntry::execute
     Istream& is
 )
 {
-    const fileName fName(includeFileName(is, parentDict));
+    const fileName fName(resolveFile(is, parentDict));
     IFstream ifs(fName);
 
     if (ifs)
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.H
index 4c217e5d1fab0488bd6dcbb309629cd2ebf26c58..a6d581e6089661a391afd05f043ad20d9a2ba5e0 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.H
+++ b/src/OpenFOAM/db/dictionary/functionEntries/includeIfPresentEntry/includeIfPresentEntry.H
@@ -58,32 +58,18 @@ class includeIfPresentEntry
 :
     public includeEntry
 {
-    // Private Member Functions
-
-        //- Disallow default bitwise copy construct
-        includeIfPresentEntry(const includeIfPresentEntry&);
-
-        //- Disallow default bitwise assignment
-        void operator=(const includeIfPresentEntry&);
-
 public:
 
-    //- Runtime type information
-    ClassName("includeIfPresent");
-
-
-    // Member Functions
-
-        //- Execute the functionEntry in a sub-dict context
-        static bool execute(dictionary& parentDict, Istream&);
+    //- Include (if present) in a sub-dict context
+    static bool execute(dictionary& parentDict, Istream& is);
 
-        //- Execute the functionEntry in a primitiveEntry context
-        static bool execute
-        (
-            const dictionary& parentDict,
-            primitiveEntry&,
-            Istream&
-        );
+    //- Include (if present) in a primitiveEntry context
+    static bool execute
+    (
+        const dictionary& parentDict,
+        primitiveEntry& entry,
+        Istream& is
+    );
 
 };
 
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/inputMode/inputMode.C b/src/OpenFOAM/db/dictionary/functionEntries/inputMode/inputMode.C
new file mode 100644
index 0000000000000000000000000000000000000000..bdd92de36e96121d44b74938784d5f3d73010b15
--- /dev/null
+++ b/src/OpenFOAM/db/dictionary/functionEntries/inputMode/inputMode.C
@@ -0,0 +1,93 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2017 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "inputMode.H"
+#include "dictionary.H"
+#include "addToMemberFunctionSelectionTable.H"
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+namespace Foam
+{
+namespace functionEntries
+{
+    addNamedToMemberFunctionSelectionTable
+    (
+        functionEntry,
+        inputMode,
+        execute,
+        dictionaryIstream,
+        inputMode
+    );
+}
+}
+
+
+const Foam::Enum
+<
+    Foam::entry::inputMode
+>
+Foam::functionEntries::inputMode::selectableNames
+{
+    { entry::inputMode::MERGE,  "merge" },
+    { entry::inputMode::OVERWRITE, "overwrite" },
+    { entry::inputMode::PROTECT, "protect" },
+    { entry::inputMode::WARN, "warn" },
+    { entry::inputMode::ERROR, "error" },
+    // Aliases
+    { entry::inputMode::MERGE, "default" },
+};
+
+
+// * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
+
+bool Foam::functionEntries::inputMode::execute
+(
+    dictionary& unused,
+    Istream& is
+)
+{
+    const word modeName(is);
+
+    // Behaviour like Enum lookupOrFailsafe()
+    if (selectableNames.hasEnum(modeName))
+    {
+        entry::globalInputMode = selectableNames[modeName];
+    }
+    else
+    {
+        WarningInFunction
+            << "Unsupported inputMode '" << modeName
+            << "' ... defaulting to 'merge'"
+            << endl;
+
+        entry::resetInputMode();
+    }
+
+    return true;
+}
+
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/inputModeEntry/inputModeEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/inputMode/inputMode.H
similarity index 59%
rename from src/OpenFOAM/db/dictionary/functionEntries/inputModeEntry/inputModeEntry.H
rename to src/OpenFOAM/db/dictionary/functionEntries/inputMode/inputMode.H
index 66c98243ade466db489fdbc213fb90402690dce9..c670d9230dcc61218e1521ea60a6d91bf90c2973 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/inputModeEntry/inputModeEntry.H
+++ b/src/OpenFOAM/db/dictionary/functionEntries/inputMode/inputMode.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2016 OpenFOAM Foundation
-     \\/     M anipulation  |
+     \\/     M anipulation  | Copyright (C) 2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -22,11 +22,11 @@ License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
 Class
-    Foam::functionEntries::inputModeEntry
+    Foam::functionEntries::inputMode
 
 Description
-    Specify the input mode when reading dictionaries, expects
-    a single word to follow.
+    Specify the global input mode when reading further dictionaries,
+    expects a single word to follow.
 
     An example of \c \#inputMode directive:
     \verbatim
@@ -47,17 +47,17 @@ Description
       - \par default
         The default treatment - currently identical to \b merge.
 
-      Note that the clear() method resets to the default mode (merge).
-
 SourceFiles
-    inputModeEntry.C
+    inputMode.C
 
 \*---------------------------------------------------------------------------*/
 
-#ifndef inputModeEntry_H
-#define inputModeEntry_H
+#ifndef inputMode_H
+#define inputMode_H
 
+#include "entry.H"
 #include "functionEntry.H"
+#include "Enum.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -67,64 +67,20 @@ namespace functionEntries
 {
 
 /*---------------------------------------------------------------------------*\
-                        Class inputModeEntry Declaration
+                          Class inputMode Declaration
 \*---------------------------------------------------------------------------*/
 
-class inputModeEntry
+class inputMode
 :
     public functionEntry
 {
-        //- The input mode options
-        enum inputMode
-        {
-            MERGE,
-            OVERWRITE,
-            PROTECT,
-            WARN,
-            ERROR
-        };
-
-        //- The current input mode
-        static inputMode mode_;
-
-
-    // Private Member Functions
-
-        //- Read the mode as a word and set enum appropriately
-        static void setMode(Istream& is);
-
-        //- Disallow default bitwise copy construct
-        inputModeEntry(const inputModeEntry&) = delete;
-
-        //- Disallow default bitwise assignment
-        void operator=(const inputModeEntry&) = delete;
-
-
 public:
 
-    //- Runtime type information
-    ClassName("inputMode");
-
-
-    // Member Functions
-
-        //- Execute the functionEntry in a sub-dict context
-        static bool execute(dictionary& parentDict, Istream& is);
-
-        //- Reset the inputMode to %default (ie, %merge)
-        static void clear();
-
-        //- Return true if the inputMode is %merge
-        static bool merge();
-
-        //- Return true if the inputMode is %overwrite
-        static bool overwrite();
-
-        //- Return true if the inputMode is %protect
-        static bool protect();
+    //- Text representations of the selectable input modes
+    static const Enum<entry::inputMode> selectableNames;
 
-        //- Return true if the inputMode is %error
-        static bool error();
+    //- Change the global input-mode.
+    static bool execute(dictionary& unused, Istream& is);
 };
 
 
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/inputModeEntry/inputModeEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/inputModeEntry/inputModeEntry.C
deleted file mode 100644
index fbb6787ca1b8a982a6d56cc9d15d3d59e6f9df7c..0000000000000000000000000000000000000000
--- a/src/OpenFOAM/db/dictionary/functionEntries/inputModeEntry/inputModeEntry.C
+++ /dev/null
@@ -1,138 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-\*---------------------------------------------------------------------------*/
-
-#include "inputModeEntry.H"
-#include "dictionary.H"
-#include "addToMemberFunctionSelectionTable.H"
-
-// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
-
-const Foam::word Foam::functionEntries::inputModeEntry::typeName
-(
-    Foam::functionEntries::inputModeEntry::typeName_()
-);
-
-// Don't lookup the debug switch here as the debug switch dictionary
-// might include inputModeEntries
-int Foam::functionEntries::inputModeEntry::debug(0);
-
-Foam::functionEntries::inputModeEntry::inputMode
-    Foam::functionEntries::inputModeEntry::mode_(MERGE);
-
-namespace Foam
-{
-namespace functionEntries
-{
-    addToMemberFunctionSelectionTable
-    (
-        functionEntry,
-        inputModeEntry,
-        execute,
-        dictionaryIstream
-    );
-}
-}
-
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
-
-// we could combine this into execute() directly, but leave it here for now
-void Foam::functionEntries::inputModeEntry::setMode(Istream& is)
-{
-    clear();
-
-    const word mode(is);
-    if (mode == "merge" || mode == "default")
-    {
-        mode_ = MERGE;
-    }
-    else if (mode == "overwrite")
-    {
-        mode_ = OVERWRITE;
-    }
-    else if (mode == "protect")
-    {
-        mode_ = PROTECT;
-    }
-    else if (mode == "warn")
-    {
-        mode_ = WARN;
-    }
-    else if (mode == "error")
-    {
-        mode_ = ERROR;
-    }
-    else
-    {
-        WarningInFunction
-            << "unsupported input mode '" << mode
-            << "' ... defaulting to 'merge'"
-            << endl;
-    }
-}
-
-
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
-bool Foam::functionEntries::inputModeEntry::execute
-(
-    dictionary& unused,
-    Istream& is
-)
-{
-    setMode(is);
-    return true;
-}
-
-
-void Foam::functionEntries::inputModeEntry::clear()
-{
-    mode_ = MERGE;
-}
-
-
-bool Foam::functionEntries::inputModeEntry::merge()
-{
-    return mode_ == MERGE;
-}
-
-
-bool Foam::functionEntries::inputModeEntry::overwrite()
-{
-    return mode_ == OVERWRITE;
-}
-
-
-bool Foam::functionEntries::inputModeEntry::protect()
-{
-    return mode_ == PROTECT;
-}
-
-bool Foam::functionEntries::inputModeEntry::error()
-{
-    return mode_ == ERROR;
-}
-
-
-// ************************************************************************* //
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.C b/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.C
index e43c1f31f351137a7fbdc8999df494adb0e8f671..a0c413edd891362966282ce97acb92678c47b394 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.C
+++ b/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.C
@@ -31,25 +31,17 @@ License
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
-const Foam::word Foam::functionEntries::removeEntry::typeName
-(
-    Foam::functionEntries::removeEntry::typeName_()
-);
-
-// Don't lookup the debug switch here as the debug switch dictionary
-// might include removeEntry
-int Foam::functionEntries::removeEntry::debug(0);
-
 namespace Foam
 {
 namespace functionEntries
 {
-    addToMemberFunctionSelectionTable
+    addNamedToMemberFunctionSelectionTable
     (
         functionEntry,
         removeEntry,
         execute,
-        dictionaryIstream
+        dictionaryIstream,
+        remove
     );
 }
 }
diff --git a/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.H b/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.H
index 8508141f64dbd0cba9bed55967785a1ae1f502b7..5e8fbdd8361f05a16376d88abdf8aba17aaae7ba 100644
--- a/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.H
+++ b/src/OpenFOAM/db/dictionary/functionEntries/removeEntry/removeEntry.H
@@ -64,25 +64,10 @@ class removeEntry
 :
     public functionEntry
 {
-    // Private Member Functions
-
-        //- Disallow default bitwise copy construct
-        removeEntry(const removeEntry&) = delete;
-
-        //- Disallow default bitwise assignment
-        void operator=(const removeEntry&) = delete;
-
-
 public:
 
-    //- Runtime type information
-    ClassName("remove");
-
-
-    // Member Functions
-
-        //- Execute the functionEntry in a sub-dict context
-        static bool execute(dictionary& parentDict, Istream& is);
+    //- Remove entries from the current sub-dict context
+    static bool execute(dictionary& parentDict, Istream& is);
 };
 
 
diff --git a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C
index b36c7d4770a052fee40e3d639506270cf2062f9c..37cc203083eef07396ab05c0175de11f7a38769c 100644
--- a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C
+++ b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.C
@@ -32,9 +32,9 @@ License
 
 void Foam::primitiveEntry::append(const UList<token>& varTokens)
 {
-    forAll(varTokens, i)
+    for (const token& tok : varTokens)
     {
-        newElmt(tokenIndex()++) = varTokens[i];
+        newElmt(tokenIndex()++) = tok;
     }
 }
 
diff --git a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H
index b5cebed502ea9c427a265d1ba567c27ade124fc5..38e9412a8df789c25c8964d751565cdd5d72c01c 100644
--- a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H
+++ b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntry.H
@@ -160,7 +160,7 @@ public:
             return true;
         }
 
-        //- Return token stream if this entry is a primitive entry
+        //- Return token stream for this primitive entry
         ITstream& stream() const;
 
         //- This entry is not a dictionary,
diff --git a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C
index 1b9870347b628ef2379790861c0c3611e0cd1a67..6a040941e741c2e2b90fb694203ddc742db6544c 100644
--- a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C
+++ b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C
@@ -227,10 +227,16 @@ void Foam::primitiveEntry::write(Ostream& os, const bool contentsOnly) const
         os.writeKeyword(keyword());
     }
 
-    for (label i=0; i<size(); ++i)
+    bool space = false;  // Separate from previous tokens with a space
+    for (const token& t : *this)
     {
-        const token& t = operator[](i);
-        if (t.type() == token::VERBATIMSTRING)
+        if (space)
+        {
+            os  << token::SPACE;
+        }
+        space = true;  // Prefix any following tokens
+
+        if (t.type() == token::tokenType::VERBATIMSTRING)
         {
             // Bypass token output operator to avoid losing verbatimness.
             // Handle in Ostreams themselves
@@ -240,11 +246,6 @@ void Foam::primitiveEntry::write(Ostream& os, const bool contentsOnly) const
         {
             os  << t;
         }
-
-        if (i < size()-1)
-        {
-            os  << token::SPACE;
-        }
     }
 
     if (!contentsOnly)
diff --git a/src/OpenFOAM/db/error/IOerror.C b/src/OpenFOAM/db/error/IOerror.C
index 4e2fab2e0e87ee69f71566b229b37c35c1537c83..4ddaa2473ff46383073ef8bb0f411f70a40cb81a 100644
--- a/src/OpenFOAM/db/error/IOerror.C
+++ b/src/OpenFOAM/db/error/IOerror.C
@@ -30,7 +30,7 @@ License
 #include "JobInfo.H"
 #include "Pstream.H"
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 Foam::IOerror::IOerror(const string& title)
 :
@@ -50,10 +50,14 @@ Foam::IOerror::IOerror(const dictionary& errDict)
 {}
 
 
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
 Foam::IOerror::~IOerror() throw()
 {}
 
 
+// * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
+
 Foam::OSstream& Foam::IOerror::operator()
 (
     const char* functionName,
@@ -167,6 +171,8 @@ Foam::IOerror::operator Foam::dictionary() const
 }
 
 
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
 void Foam::IOerror::exit(const int)
 {
     if (!throwExceptions_ && JobInfo::constructed)
@@ -254,32 +260,32 @@ void Foam::IOerror::abort()
 }
 
 
-Foam::Ostream& Foam::operator<<(Ostream& os, const IOerror& ioErr)
+Foam::Ostream& Foam::operator<<(Ostream& os, const IOerror& err)
 {
     if (!os.bad())
     {
-        os  << endl
-            << ioErr.title().c_str() << endl
-            << ioErr.message().c_str() << endl << endl;
+        os  << nl
+            << err.title().c_str() << nl
+            << err.message().c_str() << nl << endl;
 
-        os  << "file: " << ioErr.ioFileName().c_str();
+        os  << "file: " << err.ioFileName().c_str();
 
-        if (ioErr.ioStartLineNumber() >= 0 && ioErr.ioEndLineNumber() >= 0)
+        if (err.ioStartLineNumber() >= 0 && err.ioEndLineNumber() >= 0)
         {
-            os  << " from line " << ioErr.ioStartLineNumber()
-                << " to line " << ioErr.ioEndLineNumber() << '.';
+            os  << " from line " << err.ioStartLineNumber()
+                << " to line " << err.ioEndLineNumber() << '.';
         }
-        else if (ioErr.ioStartLineNumber() >= 0)
+        else if (err.ioStartLineNumber() >= 0)
         {
-            os  << " at line " << ioErr.ioStartLineNumber() << '.';
+            os  << " at line " << err.ioStartLineNumber() << '.';
         }
 
-        if (IOerror::level >= 2 && ioErr.sourceFileLineNumber())
+        if (IOerror::level >= 2 && err.sourceFileLineNumber())
         {
-            os  << endl << endl
-                << "    From function " << ioErr.functionName().c_str() << endl
-                << "    in file " << ioErr.sourceFileName().c_str()
-                << " at line " << ioErr.sourceFileLineNumber() << '.';
+            os  << nl << nl
+                << "    From function " << err.functionName().c_str() << endl
+                << "    in file " << err.sourceFileName().c_str()
+                << " at line " << err.sourceFileLineNumber() << '.';
         }
     }
 
@@ -292,4 +298,5 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const IOerror& ioErr)
 
 Foam::IOerror Foam::FatalIOError("--> FOAM FATAL IO ERROR: ");
 
+
 // ************************************************************************* //
diff --git a/src/OpenFOAM/db/error/error.C b/src/OpenFOAM/db/error/error.C
index e0dbff97d8c7b9f8226ee0cadf421a96b7bec357..cc0907d2221e9434c695a9f0435fb1206ddca33f 100644
--- a/src/OpenFOAM/db/error/error.C
+++ b/src/OpenFOAM/db/error/error.C
@@ -31,7 +31,8 @@ License
 #include "Pstream.H"
 #include "OSspecific.H"
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 Foam::error::error(const string& title)
 :
@@ -88,12 +89,16 @@ Foam::error::error(const error& err)
 }
 
 
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
 Foam::error::~error() throw()
 {
     delete messageStreamPtr_;
 }
 
 
+// * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
+
 Foam::OSstream& Foam::error::operator()
 (
     const char* functionName,
@@ -156,6 +161,8 @@ Foam::error::operator Foam::dictionary() const
 }
 
 
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
+
 Foam::string Foam::error::message() const
 {
     return messageStreamPtr_->str();
@@ -249,18 +256,20 @@ void Foam::error::abort()
 }
 
 
-Foam::Ostream& Foam::operator<<(Ostream& os, const error& fErr)
+// * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
+
+Foam::Ostream& Foam::operator<<(Ostream& os, const error& err)
 {
-    os  << endl
-        << fErr.title().c_str() << endl
-        << fErr.message().c_str();
+    os  << nl
+        << err.title().c_str() << endl
+        << err.message().c_str();
 
-    if (error::level >= 2 && fErr.sourceFileLineNumber())
+    if (error::level >= 2 && err.sourceFileLineNumber())
     {
-        os  << endl << endl
-            << "    From function " << fErr.functionName().c_str() << endl
-            << "    in file " << fErr.sourceFileName().c_str()
-            << " at line " << fErr.sourceFileLineNumber() << '.';
+        os  << nl << nl
+            << "    From function " << err.functionName().c_str() << endl
+            << "    in file " << err.sourceFileName().c_str()
+            << " at line " << err.sourceFileLineNumber() << '.';
     }
 
     return os;
@@ -272,4 +281,5 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const error& fErr)
 
 Foam::error Foam::FatalError("--> FOAM FATAL ERROR: ");
 
+
 // ************************************************************************* //
diff --git a/src/OpenFOAM/db/error/error.H b/src/OpenFOAM/db/error/error.H
index df42bf1ce0c8180e2deea96aa8a34528d100b02d..961bd3cd4dc9ea41eb4765520dd92e776e24c0e3 100644
--- a/src/OpenFOAM/db/error/error.H
+++ b/src/OpenFOAM/db/error/error.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011-2015 OpenFOAM Foundation
-     \\/     M anipulation  | Copyright (C) 2015 OpenCFD Ltd.
+     \\/     M anipulation  | Copyright (C) 2015-2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -30,7 +30,7 @@ Description
 
     The error class is globally instantiated with a title string. Errors,
     messages and other data are piped to the messageStream class in the
-    standard manner.  Manipulators are supplied for exit and abort which may
+    standard manner.  Manipulators are supplied for exit and abort that may
     terminate the program or throw an exception depending on whether the
     exception handling has been switched on (off by default).
 
@@ -57,7 +57,7 @@ namespace Foam
 
 // Forward declaration of friend functions and operators
 class error;
-Ostream& operator<<(Ostream&, const error&);
+Ostream& operator<<(Ostream& os, const error& err);
 
 
 /*---------------------------------------------------------------------------*\
@@ -90,10 +90,10 @@ public:
         error(const string& title);
 
         //- Construct from dictionary
-        error(const dictionary&);
+        error(const dictionary& errDict);
 
         //- Construct as copy
-        error(const error&);
+        error(const error& err);
 
 
     //- Destructor
@@ -104,29 +104,48 @@ public:
 
         string message() const;
 
-        const string& functionName() const
+        inline const string& functionName() const
         {
             return functionName_;
         }
 
-        const string& sourceFileName() const
+        inline const string& sourceFileName() const
         {
             return sourceFileName_;
         }
 
-        label sourceFileLineNumber() const
+        inline label sourceFileLineNumber() const
         {
             return sourceFileLineNumber_;
         }
 
-        void throwExceptions()
+        //- Return the current exception throwing (on or off)
+        inline bool throwing() const
         {
-            throwExceptions_ = true;
+            return throwExceptions_;
         }
 
-        void dontThrowExceptions()
+        //- Activate/deactivate exception throwing
+        //  \return the previous throwing state
+        inline bool throwExceptions(bool doThrow)
         {
-            throwExceptions_ = false;
+            const bool prev = throwExceptions_;
+            throwExceptions_ = doThrow;
+            return prev;
+        }
+
+        //- Activate exception throwing
+        //  \return the previous throwing state
+        inline bool throwExceptions()
+        {
+            return throwExceptions(true);
+        }
+
+        //- Deactivate exception throwing
+        //  \return the previous throwing state
+        inline bool dontThrowExceptions()
+        {
+            return throwExceptions(false);
         }
 
         //- Convert to OSstream
@@ -157,16 +176,16 @@ public:
             return operator OSstream&();
         }
 
-        //- Create and return a dictionary
+        //- Create and return a dictionary representation of the error
         operator dictionary() const;
 
 
         //- Helper function to print a stack (if OpenFOAM IO not yet
         //  initialised)
-        static void safePrintStack(std::ostream&);
+        static void safePrintStack(std::ostream& os);
 
         //- Helper function to print a stack
-        static void printStack(Ostream&);
+        static void printStack(Ostream& os);
 
         //- Exit : can be called for any error to exit program.
         //  Prints stack before exiting.
@@ -179,13 +198,13 @@ public:
 
     // Ostream operator
 
-        friend Ostream& operator<<(Ostream&, const error&);
+        friend Ostream& operator<<(Ostream& os, const error& err);
 };
 
 
 // Forward declaration of friend functions and operators
 class IOerror;
-Ostream& operator<<(Ostream&, const IOerror&);
+Ostream& operator<<(Ostream& os, const IOerror& err);
 
 
 /*---------------------------------------------------------------------------*\
@@ -212,7 +231,7 @@ public:
         IOerror(const string& title);
 
         //- Construct from dictionary
-        IOerror(const dictionary&);
+        IOerror(const dictionary& errDict);
 
 
     //- Destructor
@@ -221,17 +240,17 @@ public:
 
     // Member functions
 
-        const string& ioFileName() const
+        inline const string& ioFileName() const
         {
             return ioFileName_;
         }
 
-        label ioStartLineNumber() const
+        inline label ioStartLineNumber() const
         {
             return ioStartLineNumber_;
         }
 
-        label ioEndLineNumber() const
+        inline label ioEndLineNumber() const
         {
             return ioEndLineNumber_;
         }
@@ -279,7 +298,7 @@ public:
             const string& msg
         );
 
-        //- Create and return a dictionary
+        //- Create and return a dictionary representation of the error
         operator dictionary() const;
 
 
@@ -292,7 +311,7 @@ public:
 
     // Ostream operator
 
-        friend Ostream& operator<<(Ostream&, const IOerror&);
+        friend Ostream& operator<<(Ostream& os, const IOerror& err);
 };
 
 
diff --git a/src/OpenFOAM/db/error/messageStream.C b/src/OpenFOAM/db/error/messageStream.C
index 661d24960247b1961f0dd0ce93c8cc043392cec2..c0b9e7219bce2a760e3b30f2a76102b29b5504bc 100644
--- a/src/OpenFOAM/db/error/messageStream.C
+++ b/src/OpenFOAM/db/error/messageStream.C
@@ -90,8 +90,8 @@ Foam::OSstream& Foam::messageStream::operator()
 {
     OSstream& os = operator OSstream&();
 
-    os  << endl
-        << "    From function " << functionName << endl
+    os  << nl
+        << "    From function " << functionName << nl
         << "    in file " << sourceFileName
         << " at line " << sourceFileLineNumber << endl
         << "    ";
@@ -194,7 +194,7 @@ Foam::messageStream::operator Foam::OSstream&()
 {
     if (level)
     {
-        bool collect = (severity_ == INFO || severity_ == WARNING);
+        const bool collect = (severity_ == INFO || severity_ == WARNING);
 
         // Report the error
         if (!Pstream::master() && collect)
diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C
index 4326acf5be858c2e2f5be274eff32e046e90e6c4..fea664c7419b64d10c678fc89ccabd10ed709e12 100644
--- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C
+++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.C
@@ -210,7 +210,7 @@ bool Foam::functionObjectList::readFunctionObject
         {
             if (argLevel == 0)
             {
-                funcName = funcNameArgs(start, i - start);
+                funcName = funcNameArgs.substr(start, i - start);
                 start = i+1;
             }
             ++argLevel;
@@ -226,7 +226,7 @@ bool Foam::functionObjectList::readFunctionObject
                         Tuple2<word, string>
                         (
                             argName,
-                            funcNameArgs(start, i - start)
+                            funcNameArgs.substr(start, i - start)
                         )
                     );
                     namedArg = false;
@@ -235,7 +235,10 @@ bool Foam::functionObjectList::readFunctionObject
                 {
                     args.append
                     (
-                        string::validate<word>(funcNameArgs(start, i - start))
+                        word::validate
+                        (
+                            funcNameArgs.substr(start, i - start)
+                        )
                     );
                 }
                 start = i+1;
@@ -252,7 +255,11 @@ bool Foam::functionObjectList::readFunctionObject
         }
         else if (c == '=')
         {
-            argName = string::validate<word>(funcNameArgs(start, i - start));
+            argName = word::validate
+            (
+                funcNameArgs.substr(start, i - start)
+            );
+
             start = i+1;
             namedArg = true;
         }
@@ -323,7 +330,7 @@ bool Foam::functionObjectList::readFunctionObject
 
     // Merge this functionObject dictionary into functionsDict
     dictionary funcArgsDict;
-    funcArgsDict.add(string::validate<word>(funcNameArgs), funcDict);
+    funcArgsDict.add(word::validate(funcNameArgs), funcDict);
     functionsDict.merge(funcArgsDict);
 
     return true;
@@ -334,15 +341,15 @@ bool Foam::functionObjectList::readFunctionObject
 
 Foam::functionObjectList::functionObjectList
 (
-    const Time& t,
+    const Time& runTime,
     const bool execution
 )
 :
     PtrList<functionObject>(),
     digests_(),
     indices_(),
-    time_(t),
-    parentDict_(t.controlDict()),
+    time_(runTime),
+    parentDict_(runTime.controlDict()),
     stateDictPtr_(),
     execution_(execution),
     updated_(false)
@@ -351,7 +358,7 @@ Foam::functionObjectList::functionObjectList
 
 Foam::functionObjectList::functionObjectList
 (
-    const Time& t,
+    const Time& runTime,
     const dictionary& parentDict,
     const bool execution
 )
@@ -359,7 +366,7 @@ Foam::functionObjectList::functionObjectList
     PtrList<functionObject>(),
     digests_(),
     indices_(),
-    time_(t),
+    time_(runTime),
     parentDict_(parentDict),
     stateDictPtr_(),
     execution_(execution),
@@ -745,8 +752,10 @@ bool Foam::functionObjectList::read()
             {
                 autoPtr<functionObject> foPtr;
 
-                FatalError.throwExceptions();
-                FatalIOError.throwExceptions();
+                // Throw FatalError, FatalIOError as exceptions
+                const bool throwingError = FatalError.throwExceptions();
+                const bool throwingIOerr = FatalIOError.throwExceptions();
+
                 try
                 {
                     // New functionObject
@@ -777,8 +786,10 @@ bool Foam::functionObjectList::read()
                     WarningInFunction
                         << "Caught FatalError " << err << nl << endl;
                 }
-                FatalError.dontThrowExceptions();
-                FatalIOError.dontThrowExceptions();
+
+                // Restore previous exception throwing state
+                FatalError.throwExceptions(throwingError);
+                FatalIOError.throwExceptions(throwingIOerr);
 
                 if (foPtr.valid())
                 {
diff --git a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H
index 2a3efb45ed3d2e7beb6b0826e1919236ade85c16..c90318727b9bff4165809a885ce4d19c591eeb08 100644
--- a/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H
+++ b/src/OpenFOAM/db/functionObjects/functionObjectList/functionObjectList.H
@@ -130,7 +130,7 @@ public:
 
         //- Construct from Time, a dictionary with "functions" entry
         //  and the execution setting.
-        //  \param[in]  t - the other Time instance to construct from
+        //  \param[in]  runTime - the other Time instance to construct from
         //  \param[in]  parentDict - the parent dictionary containing
         //    a "functions" entry, which can either be a list or a dictionary
         //    of functionObject specifications.
diff --git a/src/OpenFOAM/db/objectRegistry/objectRegistry.C b/src/OpenFOAM/db/objectRegistry/objectRegistry.C
index 2f048ea71c7a5835a1a5999803f2b7f1c783cdb5..4a6c60c612eb0e3f438107c87325930447e0c5db 100644
--- a/src/OpenFOAM/db/objectRegistry/objectRegistry.C
+++ b/src/OpenFOAM/db/objectRegistry/objectRegistry.C
@@ -55,7 +55,7 @@ Foam::objectRegistry::objectRegistry
     (
         IOobject
         (
-            string::validate<word>(t.caseName()),
+            word::validate(t.caseName()),
             t.path(),
             t,
             IOobject::NO_READ,
diff --git a/src/OpenFOAM/dimensionSet/dimensionSetIO.C b/src/OpenFOAM/dimensionSet/dimensionSetIO.C
index 768acc8efc8569248b2c03789ab7cf0b45bb3a22..39773831605c2194f8fe17b6ccef45a97b62b720 100644
--- a/src/OpenFOAM/dimensionSet/dimensionSetIO.C
+++ b/src/OpenFOAM/dimensionSet/dimensionSetIO.C
@@ -140,7 +140,7 @@ void Foam::dimensionSet::tokeniser::splitWord(const word& w)
         {
             if (i > start)
             {
-                word subWord = w(start, i-start);
+                const word subWord = w.substr(start, i-start);
                 if (isdigit(subWord[0]) || subWord[0] == token::SUBTRACT)
                 {
                     push(token(readScalar(IStringStream(subWord)())));
@@ -158,7 +158,7 @@ void Foam::dimensionSet::tokeniser::splitWord(const word& w)
                 }
                 else
                 {
-                    push(token::punctuationToken(w[i]));
+                    push(token(token::punctuationToken(w[i])));
                 }
             }
             start = i+1;
@@ -166,7 +166,7 @@ void Foam::dimensionSet::tokeniser::splitWord(const word& w)
     }
     if (start < w.size())
     {
-        word subWord = w(start, w.size()-start);
+        const word subWord = w.substr(start);
         if (isdigit(subWord[0]) || subWord[0] == token::SUBTRACT)
         {
             push(token(readScalar(IStringStream(subWord)())));
@@ -524,9 +524,9 @@ Foam::Istream& Foam::dimensionSet::read
         do
         {
             word symbolPow = nextToken.wordToken();
-            if (symbolPow[symbolPow.size()-1] == token::END_SQR)
+            if (symbolPow.back() == token::END_SQR)
             {
-                symbolPow = symbolPow(0, symbolPow.size()-1);
+                symbolPow.resize(symbolPow.size()-1);
                 continueParsing = false;
             }
 
@@ -537,8 +537,8 @@ Foam::Istream& Foam::dimensionSet::read
             size_t index = symbolPow.find('^');
             if (index != string::npos)
             {
-                word symbol = symbolPow(0, index);
-                word exp = symbolPow(index+1, symbolPow.size()-index+1);
+                const word symbol = symbolPow.substr(0, index);
+                const word exp = symbolPow.substr(index+1);
                 scalar exponent = readScalar(IStringStream(exp)());
 
                 dimensionedScalar s;
@@ -580,9 +580,9 @@ Foam::Istream& Foam::dimensionSet::read
     {
         // Read first five dimensions
         exponents_[dimensionSet::MASS] = nextToken.number();
-        for (int Dimension=1; Dimension<dimensionSet::CURRENT; Dimension++)
+        for (int d=1; d < dimensionSet::CURRENT; ++d)
         {
-            is >> exponents_[Dimension];
+            is >> exponents_[d];
         }
 
         // Read next token
diff --git a/src/OpenFOAM/global/argList/argList.C b/src/OpenFOAM/global/argList/argList.C
index b3b68fc87251bdae1b4b3e5dc1c247590d531e6e..87c8c30f03eba0aa22db99281531f8ebf4409f45 100644
--- a/src/OpenFOAM/global/argList/argList.C
+++ b/src/OpenFOAM/global/argList/argList.C
@@ -480,6 +480,7 @@ Foam::argList::argList
 
     // Check arguments and options, argv[0] was already handled
     int nArgs = 1;
+    HashTable<string>::const_iterator optIter;
     for (int argI = 1; argI < args_.size(); ++argI)
     {
         argListStr_ += ' ';
@@ -489,15 +490,20 @@ Foam::argList::argList
         {
             const char *optionName = &args_[argI][1];
 
-            if
+            if (!*optionName)
+            {
+                Warning
+                    <<"Ignoring lone '-' on the command-line" << endl;
+            }
+            else if
             (
                 (
-                    validOptions.found(optionName)
-                 && !validOptions[optionName].empty()
+                    (optIter = validOptions.cfind(optionName)).found()
+                 && !optIter.object().empty()
                 )
              || (
-                    validParOptions.found(optionName)
-                 && !validParOptions[optionName].empty()
+                    (optIter = validParOptions.cfind(optionName)).found()
+                 && !optIter.object().empty()
                 )
             )
             {
diff --git a/src/OpenFOAM/matrices/solution/solution.C b/src/OpenFOAM/matrices/solution/solution.C
index 5abac0fa3e2e33f360e2a5104132136f84f994c3..982c3398b65d84a6c6ace821cd038b232661d90c 100644
--- a/src/OpenFOAM/matrices/solution/solution.C
+++ b/src/OpenFOAM/matrices/solution/solution.C
@@ -76,16 +76,13 @@ void Foam::solution::read(const dictionary& dict)
                 const word& e = entryNames[i];
                 scalar value = readScalar(relaxDict.lookup(e));
 
-                if (e(0, 1) == "p")
+                if (e.startsWith("p"))
                 {
                     fieldRelaxDict_.add(e, value);
                 }
-                else if (e.length() >= 3)
+                else if (e.startsWith("rho"))
                 {
-                    if (e(0, 3) == "rho")
-                    {
-                        fieldRelaxDict_.add(e, value);
-                    }
+                    fieldRelaxDict_.add(e, value);
                 }
 
             }
diff --git a/src/OpenFOAM/primitives/chars/wchar/wchar.H b/src/OpenFOAM/primitives/chars/wchar/wchar.H
index e6cc3e182ec61bff4278b0f8b7eb7e336f7571ab..480a580119c510cad3e6e301137a32f25de0fa6b 100644
--- a/src/OpenFOAM/primitives/chars/wchar/wchar.H
+++ b/src/OpenFOAM/primitives/chars/wchar/wchar.H
@@ -53,13 +53,13 @@ class Ostream;
 // * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
 
 //- Output wide character (Unicode) as UTF-8
-Ostream& operator<<(Ostream&, const wchar_t);
+Ostream& operator<<(Ostream& os, const wchar_t wc);
 
 //- Output wide character (Unicode) string as UTF-8
-Ostream& operator<<(Ostream&, const wchar_t*);
+Ostream& operator<<(Ostream& os, const wchar_t* wstr);
 
 //- Output wide character (Unicode) string as UTF-8
-Ostream& operator<<(Ostream&, const std::wstring&);
+Ostream& operator<<(Ostream& os, const std::wstring& wstr);
 
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/primitives/chars/wchar/wcharIO.C b/src/OpenFOAM/primitives/chars/wchar/wcharIO.C
index fc710a52dd38901c60cd106cf83f4831f8e5ae25..ed88e5703ffe1c4ea39d70f66f5854b5b55c07d5 100644
--- a/src/OpenFOAM/primitives/chars/wchar/wcharIO.C
+++ b/src/OpenFOAM/primitives/chars/wchar/wcharIO.C
@@ -116,12 +116,7 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const wchar_t* wstr)
 
 Foam::Ostream& Foam::operator<<(Ostream& os, const std::wstring& wstr)
 {
-    for
-    (
-        std::wstring::const_iterator iter = wstr.begin();
-        iter != wstr.end();
-        ++iter
-    )
+    for (auto iter = wstr.cbegin(); iter != wstr.cend(); ++iter)
     {
         os  << *iter;
     }
diff --git a/src/OpenFOAM/primitives/strings/fileName/fileName.C b/src/OpenFOAM/primitives/strings/fileName/fileName.C
index 87ddec68b7c3c1cdab8df0fa3462ff721ad7c661..097da220f61fc6f5017cf473bda0e4e145d14e02 100644
--- a/src/OpenFOAM/primitives/strings/fileName/fileName.C
+++ b/src/OpenFOAM/primitives/strings/fileName/fileName.C
@@ -104,30 +104,26 @@ Foam::fileName& Foam::fileName::toAbsolute()
 }
 
 
-bool Foam::fileName::clean()
+bool Foam::fileName::clean(std::string& str)
 {
-    // The top slash - we are never allowed to go above it
-    string::size_type top = this->find('/');
+    // Start with the top slash found - we are never allowed to go above it
+    char prev = '/';
+    auto top = str.find(prev);
 
     // No slashes - nothing to do
-    if (top == string::npos)
+    if (top == std::string::npos)
     {
         return false;
     }
 
-    // Start with the '/' found:
-    char prev = '/';
-    string::size_type nChar  = top+1;
-    string::size_type maxLen = this->size();
-
-    for
-    (
-        string::size_type src = nChar;
-        src < maxLen;
-        /*nil*/
-    )
+    // Number of output characters
+    std::string::size_type nChar = top+1;
+
+    const string::size_type maxLen = str.size();
+
+    for (string::size_type src = nChar; src < maxLen; /*nil*/)
     {
-        char c = operator[](src++);
+        const char c = str[src++];
 
         if (prev == '/')
         {
@@ -137,28 +133,27 @@ bool Foam::fileName::clean()
                 continue;
             }
 
-            // Could be '/./' or '/../'
+            // Could be "/./", "/../" or a trailing "/."
             if (c == '.')
             {
-                // Found trailing '/.' - skip it
+                // Trailing "/." - skip it
                 if (src >= maxLen)
                 {
-                    continue;
+                    break;
                 }
 
-
                 // Peek at the next character
-                char c1 = operator[](src);
+                const char c1 = str[src];
 
-                // Found '/./' - skip it
+                // Found "/./" - skip it
                 if (c1 == '/')
                 {
-                    src++;
+                    ++src;
                     continue;
                 }
 
-                // It is '/..' or '/../'
-                if (c1 == '.' && (src+1 >= maxLen || operator[](src+1) == '/'))
+                // Trailing "/.." or intermediate "/../"
+                if (c1 == '.' && (src+1 >= maxLen || str[src+1] == '/'))
                 {
                     string::size_type parent;
 
@@ -168,7 +163,7 @@ bool Foam::fileName::clean()
                     if
                     (
                         nChar > 2
-                     && (parent = this->rfind('/', nChar-2)) != string::npos
+                     && (parent = str.rfind('/', nChar-2)) != string::npos
                      && parent >= top
                     )
                     {
@@ -184,47 +179,60 @@ bool Foam::fileName::clean()
                 }
             }
         }
-        operator[](nChar++) = prev = c;
+        str[nChar++] = prev = c;
     }
 
     // Remove trailing slash
-    if (nChar > 1 && operator[](nChar-1) == '/')
+    if (nChar > 1 && str[nChar-1] == '/')
     {
         nChar--;
     }
 
-    this->resize(nChar);
+    str.resize(nChar);
 
     return (nChar != maxLen);
 }
 
 
+bool Foam::fileName::clean()
+{
+    return fileName::clean(*this);
+}
+
+
 Foam::fileName Foam::fileName::clean() const
 {
-    fileName fName(*this);
-    fName.clean();
-    return fName;
+    fileName cleaned(*this);
+    fileName::clean(cleaned);
+    return cleaned;
 }
 
 
-Foam::word Foam::fileName::name() const
+std::string Foam::fileName::name(const std::string& str)
 {
-    const size_type i = rfind('/');
+    const auto beg = str.rfind('/');
 
-    if (i == npos)
+    if (beg == npos)
     {
-        return *this;
+        return str;
     }
     else
     {
-        return substr(i+1);
+        return str.substr(beg+1);
     }
 }
 
 
-Foam::word Foam::fileName::nameLessExt() const
+Foam::word Foam::fileName::name() const
+{
+    return fileName::name(*this);
+}
+
+
+std::string Foam::fileName::nameLessExt(const std::string& str)
 {
-    size_type beg = rfind('/');
+    size_type beg = str.rfind('/');
+    size_type dot = str.rfind('.');
 
     if (beg == npos)
     {
@@ -235,7 +243,6 @@ Foam::word Foam::fileName::nameLessExt() const
         ++beg;
     }
 
-    size_type dot = rfind('.');
     if (dot != npos && dot <= beg)
     {
         dot = npos;
@@ -243,18 +250,24 @@ Foam::word Foam::fileName::nameLessExt() const
 
     if (dot == npos)
     {
-        return substr(beg, npos);
+        return str.substr(beg);
     }
     else
     {
-        return substr(beg, dot - beg);
+        return str.substr(beg, dot - beg);
     }
 }
 
 
-Foam::fileName Foam::fileName::path() const
+Foam::word Foam::fileName::nameLessExt() const
 {
-    const size_type i = rfind('/');
+    return nameLessExt(*this);
+}
+
+
+std::string Foam::fileName::path(const std::string& str)
+{
+    const auto i = str.rfind('/');
 
     if (i == npos)
     {
@@ -262,7 +275,7 @@ Foam::fileName Foam::fileName::path() const
     }
     else if (i)
     {
-        return substr(0, i);
+        return str.substr(0, i);
     }
     else
     {
@@ -271,9 +284,15 @@ Foam::fileName Foam::fileName::path() const
 }
 
 
+Foam::fileName Foam::fileName::path() const
+{
+    return path(*this);
+}
+
+
 Foam::fileName Foam::fileName::lessExt() const
 {
-    const size_type i = find_ext();
+    const auto i = find_ext();
 
     if (i == npos)
     {
@@ -330,7 +349,7 @@ Foam::wordList Foam::fileName::components(const char delimiter) const
     // Avoid empty trailing element
     if (beg < size())
     {
-        wrdList.append(substr(beg, npos));
+        wrdList.append(substr(beg));
     }
 
     // Transfer to wordList
diff --git a/src/OpenFOAM/primitives/strings/fileName/fileName.H b/src/OpenFOAM/primitives/strings/fileName/fileName.H
index 19cd295120f4a066f73c28ba22af9824b8ad4f77..841c0e35b2b4e74fdea39c59b5271744f0f09fdc 100644
--- a/src/OpenFOAM/primitives/strings/fileName/fileName.H
+++ b/src/OpenFOAM/primitives/strings/fileName/fileName.H
@@ -108,7 +108,7 @@ public:
         inline fileName(const fileName& fn);
 
         //- Construct as copy of word
-        inline fileName(const word& s);
+        inline fileName(const word& w);
 
         //- Construct as copy of string
         inline fileName(const string& s, const bool doStripInvalid=true);
@@ -135,26 +135,42 @@ public:
         //- Is this character valid for a fileName?
         inline static bool valid(char c);
 
-        //- Cleanup file name
+        //- Cleanup filename
         //
-        // * Removes repeated slashes
+        // Removes trailing \c /
+        //   \verbatim
+        //       /                 -->   /
+        //       /abc/             -->   /abc
+        //   \endverbatim
+        //
+        // Removes repeated slashes
+        //   \verbatim
         //       /abc////def        -->   /abc/def
+        //   \endverbatim
         //
-        // * Removes '/./'
-        //       /abc/def/./ghi/.   -->   /abc/def/./ghi
+        // Removes \c /./ (current directory)
+        //   \verbatim
+        //       /abc/def/./ghi/.   -->   /abc/def/ghi
         //       abc/def/./         -->   abc/def
+        //       ./abc/             -->   ./abc
+        //   \endverbatim
         //
-        // * Removes '/../'
+        // Removes \c /../ (parent directory)
+        //   \verbatim
         //       /abc/def/../ghi/jkl/nmo/..   -->   /abc/ghi/jkl
         //       abc/../def/ghi/../jkl        -->   abc/../def/jkl
+        //   \endverbatim
         //
-        // * Removes trailing '/'
-        //
-        // \return True if any contents changed
+        // \return True if the content changed
+        static bool clean(std::string& str);
+
+
+        //- Cleanup filename inplace
+        //  \return True if any contents changed
         bool clean();
 
-        //- Cleanup file name
-        //  eg, remove repeated slashes, etc.
+        //- Cleanup filename
+        //  \return cleaned copy of fileName
         fileName clean() const;
 
 
@@ -164,6 +180,9 @@ public:
         //  LINK (only if followLink=false)
         Type type(const bool followLink = true) const;
 
+        //- Return true if string starts with a '/'
+        inline static bool isAbsolute(const std::string& str);
+
         //- Return true if file name is absolute (starts with a '/')
         inline bool isAbsolute() const;
 
@@ -174,19 +193,28 @@ public:
       // Decomposition
 
         //- Return basename (part beyond last /), including its extension
+        //  The result normally coresponds to a Foam::word
         //
         // Behaviour compared to /usr/bin/basename:
         // \verbatim
         //    input           name()    basename
         //    -----           ------    --------
         //    "foo"           "foo"     "foo"
+        //    "/"             ""        "/"
         //    "/foo"          "foo"     "foo"
         //    "foo/bar"       "bar"     "bar"
         //    "/foo/bar"      "bar"     "bar"
         //    "/foo/bar/"     ""        "bar"
         // \endverbatim
+        static std::string name(const std::string& str);
+
+        //- Return basename (part beyond last /), including its extension
         word name() const;
 
+        //- Return basename, without extension
+        //  The result normally coresponds to a Foam::word
+        static std::string nameLessExt(const std::string& str);
+
         //- Return basename, without extension
         word nameLessExt() const;
 
@@ -199,17 +227,22 @@ public:
         }
 
         //- Return directory path name (part before last /)
+        //  The result normally coresponds to a Foam::fileName
         //
         //  Behaviour compared to /usr/bin/dirname:
         //  \verbatim
         //    input           path()          dirname
         //    -----           ------          -------
         //    "foo"           "."             "."
+        //    "/"             "/"             "/"
         //    "/foo"          "/"             "foo"
         //    "foo/bar"       "foo"           "foo"
         //    "/foo/bar"      "/foo"          "/foo"
         //    "/foo/bar/"     "/foo/bar/"     "/foo"
         // \endverbatim
+        static std::string path(const std::string& str);
+
+        //- Return directory path name (part before last /)
         fileName path() const;
 
         //- Return file name without extension (part before last .)
@@ -242,11 +275,11 @@ public:
         //  \verbatim
         //    Input           components()
         //    -----           ------
-        //    "foo"           1("foo")
-        //    "/foo"          1("foo")
-        //    "foo/bar"       2("foo", "bar")
-        //    "/foo/bar"      2("foo", "bar")
-        //    "/foo/bar/"     2("foo", "bar")
+        //    "foo"           ("foo")
+        //    "/foo"          ("foo")
+        //    "foo/bar"       ("foo", "bar")
+        //    "/foo/bar"      ("foo", "bar")
+        //    "/foo/bar/"     ("foo", "bar")
         //  \endverbatim
         wordList components(const char delimiter = '/') const;
 
diff --git a/src/OpenFOAM/primitives/strings/fileName/fileNameI.H b/src/OpenFOAM/primitives/strings/fileName/fileNameI.H
index b1199263056a8ca5b1fca44bdc93af252bcf6cbf..c3c82cc65d0a619501947ce4d3521a3f2648889a 100644
--- a/src/OpenFOAM/primitives/strings/fileName/fileNameI.H
+++ b/src/OpenFOAM/primitives/strings/fileName/fileNameI.H
@@ -3,7 +3,7 @@
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
     \\  /    A nd           | Copyright (C) 2011 OpenFOAM Foundation
-     \\/     M anipulation  | Copyright (C) 2016 OpenCFD Ltd.
+     \\/     M anipulation  | Copyright (C) 2016-2017 OpenCFD Ltd.
 -------------------------------------------------------------------------------
 License
     This file is part of OpenFOAM.
@@ -23,12 +23,13 @@ License
 
 \*---------------------------------------------------------------------------*/
 
+#include <iostream>  // for std::cerr
+
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
 inline void Foam::fileName::stripInvalid()
 {
-    // skip stripping unless debug is active to avoid
-    // costly operations
+    // Skip stripping unless debug is active (to avoid costly operations)
     if (debug && string::stripInvalid<fileName>(*this))
     {
         std::cerr
@@ -115,6 +116,12 @@ inline bool Foam::fileName::valid(char c)
 }
 
 
+inline bool Foam::fileName::isAbsolute(const std::string& str)
+{
+    return !str.empty() && str[0] == '/';
+}
+
+
 inline bool Foam::fileName::isAbsolute() const
 {
     return !empty() && operator[](0) == '/';
diff --git a/src/OpenFOAM/primitives/strings/keyType/keyType.H b/src/OpenFOAM/primitives/strings/keyType/keyType.H
index 82713fd9ffeb440cdd9a49868bcf4794abd4c70b..0f9d6139433c5f29b57e5439ee8db8d218a516f3 100644
--- a/src/OpenFOAM/primitives/strings/keyType/keyType.H
+++ b/src/OpenFOAM/primitives/strings/keyType/keyType.H
@@ -111,6 +111,11 @@ public:
 
     // Member functions
 
+        //- Is this character valid for a keyType?
+        //  This is largely identical with what word accepts, but also
+        //  permit brace-brackets, which are valid for some regexs.
+        inline static bool valid(char c);
+
         //- Treat as a pattern rather than a literal string?
         inline bool isPattern() const;
 
diff --git a/src/OpenFOAM/primitives/strings/keyType/keyTypeI.H b/src/OpenFOAM/primitives/strings/keyType/keyTypeI.H
index 964f48cbb033bb7e59db0fcec83b944dcb8281d6..575bb834b1634c9a19e735a6571d36f67fc36744 100644
--- a/src/OpenFOAM/primitives/strings/keyType/keyTypeI.H
+++ b/src/OpenFOAM/primitives/strings/keyType/keyTypeI.H
@@ -23,6 +23,21 @@ License
 
 \*---------------------------------------------------------------------------*/
 
+// * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
+
+inline bool Foam::keyType::valid(char c)
+{
+    return
+    (
+        !isspace(c)
+     && c != '"'   // string quote
+     && c != '\''  // string quote
+     && c != '/'   // path separator
+     && c != ';'   // end statement
+    );
+}
+
+
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 inline Foam::keyType::keyType()
diff --git a/src/OpenFOAM/primitives/strings/lists/CStringList.H b/src/OpenFOAM/primitives/strings/lists/CStringList.H
index 42d762a6f01f345bde1ca4f92a66639d1ef63198..30a21a4fcbeee16486a5e84156df1e2329edf859 100644
--- a/src/OpenFOAM/primitives/strings/lists/CStringList.H
+++ b/src/OpenFOAM/primitives/strings/lists/CStringList.H
@@ -128,7 +128,7 @@ public:
         inline size_t length() const;
 
         //- The flattened character content, with interspersed nul-chars
-        inline char* data() const;
+        inline const char* data() const;
 
 
     // Edit
diff --git a/src/OpenFOAM/primitives/strings/lists/CStringListI.H b/src/OpenFOAM/primitives/strings/lists/CStringListI.H
index d91a9de6460283fe0ba78b5839df5ac31c7be70a..197633691e410ce6d8120216db3d01ae2d1fa84c 100644
--- a/src/OpenFOAM/primitives/strings/lists/CStringListI.H
+++ b/src/OpenFOAM/primitives/strings/lists/CStringListI.H
@@ -46,8 +46,8 @@ inline Foam::CStringList::CStringList()
 :
     argc_(0),
     len_(0),
-    argv_(0),
-    data_(0)
+    argv_(nullptr),
+    data_(nullptr)
 {}
 
 
@@ -69,12 +69,12 @@ inline void Foam::CStringList::clear()
     if (data_)
     {
         delete[] data_;
-        data_ = 0;
+        data_ = nullptr;
     }
     if (argv_)
     {
         delete[] argv_;
-        argv_ = 0;
+        argv_ = nullptr;
     }
 }
 
@@ -97,7 +97,7 @@ inline char** Foam::CStringList::strings() const
 }
 
 
-inline char* Foam::CStringList::data() const
+inline const char* Foam::CStringList::data() const
 {
     return data_;
 }
diff --git a/src/OpenFOAM/primitives/strings/lists/CStringListTemplates.C b/src/OpenFOAM/primitives/strings/lists/CStringListTemplates.C
index 8a5d383dbf13f2b6fa9c6aeb92d4d01b173d4e0b..8c2fad816ecfc54db6930f291f746d226b29c91c 100644
--- a/src/OpenFOAM/primitives/strings/lists/CStringListTemplates.C
+++ b/src/OpenFOAM/primitives/strings/lists/CStringListTemplates.C
@@ -31,10 +31,7 @@ Foam::CStringList::CStringList
     const UList<StringType>& input
 )
 :
-    argc_(0),
-    len_(0),
-    argv_(0),
-    data_(0)
+    CStringList()
 {
     reset(input);
 }
@@ -50,42 +47,38 @@ void Foam::CStringList::reset
 {
     clear();
 
-    argc_ = input.size();
-    forAll(input, argI)
+    if (input.empty())
     {
-        len_ += input[argI].size();
-        ++len_;  // nul terminator for C-strings
+        // Special handling of an empty list
+        argv_ = new char*[1];
+        argv_[0] = nullptr;     // Final nullptr terminator
+        return;
     }
 
-    argv_ = new char*[argc_+1];
-    argv_[argc_] = nullptr; // extra terminator
+    // Count overall required string length, including each trailing nul char
+    for (const auto& str : input)
+    {
+        len_ += str.size() + 1;
+    }
+    --len_; // No final nul in overall count
 
-    if (argc_ > 0)
+    argv_ = new char*[input.size()+1];  // Extra +1 for terminating nullptr
+    data_ = new char[len_+1];           // Extra +1 for terminating nul char
+
+    // Copy contents
+    char* ptr = data_;
+    for (const auto& str : input)
     {
-        // allocation includes final nul terminator,
-        // but overall count does not
-        data_ = new char[len_--];
+        argv_[argc_++] = ptr;   // The start of this string
 
-        char* ptr = data_;
-        forAll(input, argI)
+        for (auto iter = str.cbegin(); iter != str.cend(); ++iter)
         {
-            argv_[argI] = ptr;
-
-            const std::string& str =
-                static_cast<const std::string&>(input[argI]);
-
-            for
-            (
-                std::string::const_iterator iter = str.begin();
-                iter != str.end();
-                ++iter
-            )
-            {
-                *(ptr++) = *iter;
-            }
-            *(ptr++) = '\0';
+            *(ptr++) = *iter;
         }
+        *(ptr++) = '\0';
     }
+
+    argv_[argc_] = nullptr;     // Final nullptr terminator
 }
 
 
diff --git a/src/OpenFOAM/primitives/strings/lists/SubStrings.H b/src/OpenFOAM/primitives/strings/lists/SubStrings.H
new file mode 100644
index 0000000000000000000000000000000000000000..3e37fd7edd517ed6a5a743193fe559263be97ec1
--- /dev/null
+++ b/src/OpenFOAM/primitives/strings/lists/SubStrings.H
@@ -0,0 +1,127 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+   \\    /   O peration     |
+    \\  /    A nd           | Copyright (C) 2017 OpenCFD Ltd.
+     \\/     M anipulation  |
+-------------------------------------------------------------------------------
+License
+    This file is part of OpenFOAM.
+
+    OpenFOAM is free software: you can redistribute it and/or modify it
+    under the terms of the GNU General Public License as published by
+    the Free Software Foundation, either version 3 of the License, or
+    (at your option) any later version.
+
+    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
+    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
+    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
+    for more details.
+
+    You should have received a copy of the GNU General Public License
+    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
+
+Class
+    Foam::SubStrings
+
+Description
+    Sub-ranges of a string with a structure similar to std::match_results,
+    but without the underlying regular expression matching.
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef SubStrings_H
+#define SubStrings_H
+
+#include <string>
+#include <regex>
+#include <vector>
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+                         Class SubStrings Declaration
+\*---------------------------------------------------------------------------*/
+
+template<class String>
+class SubStrings
+:
+    public std::vector<std::sub_match<typename String::const_iterator>>
+{
+public:
+
+    // Typedefs
+
+        //- The element type
+        using value_type =
+            typename std::sub_match<typename String::const_iterator>;
+
+        //- The const_iterator for the underlying string type
+        using string_iterator = typename String::const_iterator;
+
+
+    // Constructors
+
+        //- Construct null
+        SubStrings()
+        {}
+
+
+    // Member Functions
+
+        //- The total length of all sub-elements.
+        //  Use size() for the number elements.
+        std::string::size_type length() const
+        {
+            std::string::size_type len = 0;
+
+            for (const auto& elem : *this)
+            {
+                len += elem.length();
+            }
+
+            return len;
+        }
+
+
+        //- Append sub-string defined by begin/end iterators
+        void append(string_iterator b, string_iterator e)
+        {
+            value_type range;
+            range.first = b;
+            range.second = e;
+            range.matched = true;
+
+            this->push_back(range);
+        }
+
+
+        //- Const reference to the first element,
+        //  for consistency with other OpenFOAM containers
+        auto first() const -> decltype(this->front())
+        {
+            return this->front();
+        }
+
+
+        //- Const reference to the last element,
+        //  for consistency with other OpenFOAM containers
+        auto last() const -> decltype(this->back())
+        {
+            return this->back();
+        }
+
+};
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/primitives/strings/string/string.C b/src/OpenFOAM/primitives/strings/string/string.C
index dff562641182c6ed17f01b3d1836560df23cc230..b16b30f66defb2d22491a8507338b5a03f3a03ef 100644
--- a/src/OpenFOAM/primitives/strings/string/string.C
+++ b/src/OpenFOAM/primitives/strings/string/string.C
@@ -101,17 +101,17 @@ bool Foam::string::hasExt(const wordRe& ending) const
 
 Foam::string::size_type Foam::string::count(const char c) const
 {
-    size_type cCount = 0;
+    size_type nChar = 0;
 
-    for (const_iterator iter = cbegin(); iter != cend(); ++iter)
+    for (auto iter = cbegin(); iter != cend(); ++iter)
     {
         if (*iter == c)
         {
-            ++cCount;
+            ++nChar;
         }
     }
 
-    return cCount;
+    return nChar;
 }
 
 
@@ -119,14 +119,14 @@ Foam::string& Foam::string::replace
 (
     const string& oldStr,
     const string& newStr,
-    size_type start
+    const size_type start
 )
 {
-    size_type newStart = start;
+    size_type pos = start;
 
-    if ((newStart = find(oldStr, newStart)) != npos)
+    if ((pos = find(oldStr, pos)) != npos)
     {
-        std::string::replace(newStart, oldStr.size(), newStr);
+        std::string::replace(pos, oldStr.size(), newStr);
     }
 
     return *this;
@@ -137,17 +137,22 @@ Foam::string& Foam::string::replaceAll
 (
     const string& oldStr,
     const string& newStr,
-    size_type start
+    const size_type start
 )
 {
-    if (oldStr.size())
-    {
-        size_type newStart = start;
+    const size_type lenOld = oldStr.size();
+    const size_type lenNew = newStr.size();
 
-        while ((newStart = find(oldStr, newStart)) != npos)
+    if (lenOld)
+    {
+        for
+        (
+            size_type pos = start;
+            (pos = find(oldStr, pos)) != npos;
+            pos += lenNew
+        )
         {
-            std::string::replace(newStart, oldStr.size(), newStr);
-            newStart += newStr.size();
+            std::string::replace(pos, lenOld, newStr);
         }
     }
 
@@ -168,19 +173,14 @@ bool Foam::string::removeRepeated(const char character)
 
     if (character && find(character) != npos)
     {
-        string::size_type nChar=0;
-        iterator iter2 = begin();
+        string::size_type nChar = 0;
+        iterator outIter = begin();
 
         char prev = 0;
 
-        for
-        (
-            string::const_iterator iter1 = iter2;
-            iter1 != end();
-            iter1++
-        )
+        for (auto iter = cbegin(); iter != cend(); ++iter)
         {
-            char c = *iter1;
+            const char c = *iter;
 
             if (prev == c && c == character)
             {
@@ -188,11 +188,12 @@ bool Foam::string::removeRepeated(const char character)
             }
             else
             {
-                *iter2 = prev = c;
-                ++iter2;
+                *outIter = prev = c;
+                ++outIter;
                 ++nChar;
             }
         }
+
         resize(nChar);
     }
 
@@ -210,16 +211,14 @@ Foam::string Foam::string::removeRepeated(const char character) const
 
 bool Foam::string::removeTrailing(const char character)
 {
-    bool changed = false;
-
-    string::size_type nChar = size();
+    const string::size_type nChar = size();
     if (character && nChar > 1 && operator[](nChar-1) == character)
     {
         resize(nChar-1);
-        changed = true;
+        return true;
     }
 
-    return changed;
+    return false;
 }
 
 
@@ -245,10 +244,8 @@ bool Foam::string::removeStart(const std::string& text)
         this->erase(0, txtLen);
         return true;
     }
-    else
-    {
-        return false;
-    }
+
+    return false;
 }
 
 
@@ -266,10 +263,8 @@ bool Foam::string::removeEnd(const std::string& text)
         this->resize(strLen - txtLen);
         return true;
     }
-    else
-    {
-        return false;
-    }
+
+    return false;
 }
 
 
diff --git a/src/OpenFOAM/primitives/strings/string/string.H b/src/OpenFOAM/primitives/strings/string/string.H
index e624a68456709d7149fef7501215fe1e4d8a04d7..b739965c39dc0ad7e4939b34199666526f1b813f 100644
--- a/src/OpenFOAM/primitives/strings/string/string.H
+++ b/src/OpenFOAM/primitives/strings/string/string.H
@@ -190,22 +190,22 @@ public:
         //- Avoid masking the normal std::string replace
         using std::string::replace;
 
-        //- Replace first occurence of sub-string oldStr with newStr
-        //  starting at start
+        //- Replace first occurence of sub-string oldStr with newStr,
+        //  beginning at start
         string& replace
         (
             const string& oldStr,
             const string& newStr,
-            size_type start = 0
+            const size_type start = 0
         );
 
-        //- Replace all occurences of sub-string oldStr with newStr
-        //  starting at start
+        //- Replace all occurences of sub-string oldStr with newStr,
+        //  beginning at start. This is a no-op if oldStr is empty.
         string& replaceAll
         (
             const string& oldStr,
             const string& newStr,
-            size_type start = 0
+            const size_type start = 0
         );
 
         //- Expand initial tildes and all occurences of environment variables
@@ -224,20 +224,23 @@ public:
         //  Foam::findEtcFile
         string& expand(const bool allowEmpty = false);
 
-        //- Remove repeated characters returning true if string changed
+        //- Remove repeated characters
+        //  \return True if string changed
         bool removeRepeated(const char character);
 
         //- Return string with repeated characters removed
         string removeRepeated(const char character) const;
 
-        //- Remove trailing character returning true if string changed
+        //- Remove trailing character, unless string is a single character
+        //  \return True if string changed
         bool removeTrailing(const char character);
 
-        //- Return string with trailing character removed
+        //- Return string with trailing character removed,
+        //  unless string is a single character
         string removeTrailing(const char character) const;
 
         //- Remove the given text from the start of the string.
-        //  Always true if the removal occurred or the given text is empty.
+        //  \return True if the removal occurred or the given text is empty.
         bool removeStart(const std::string& text);
 
         //- Remove the given text from the end of the string.
diff --git a/src/OpenFOAM/primitives/strings/string/stringI.H b/src/OpenFOAM/primitives/strings/string/stringI.H
index bae33b3342f081d77271b2a9bb74156cd19f05bf..96520dd7585fa0bdc51a18d42fa0134335fcfcf0 100644
--- a/src/OpenFOAM/primitives/strings/string/stringI.H
+++ b/src/OpenFOAM/primitives/strings/string/stringI.H
@@ -23,7 +23,6 @@ License
 
 \*---------------------------------------------------------------------------*/
 
-#include <iostream>
 
 // * * * * * * * * * * * * Protected Member Functions  * * * * * * * * * * * //
 
@@ -76,21 +75,18 @@ inline Foam::string::string(const std::string& str)
 {}
 
 
-// Copy character array
 inline Foam::string::string(const char* str)
 :
     std::string(str)
 {}
 
 
-// Construct from a given number of characters in a character array
 inline Foam::string::string(const char* str, const size_type len)
 :
     std::string(str, len)
 {}
 
 
-// Construct from a single character
 inline Foam::string::string(const char c)
 :
     std::string(1, c)
@@ -102,13 +98,14 @@ inline Foam::string::string(const char c)
 template<class String>
 inline bool Foam::string::valid(const std::string& str)
 {
-    for (const_iterator iter = str.begin(); iter != str.end(); ++iter)
+    for (auto iter = str.cbegin(); iter != str.cend(); ++iter)
     {
         if (!String::valid(*iter))
         {
             return false;
         }
     }
+
     return true;
 }
 
@@ -118,27 +115,22 @@ inline bool Foam::string::stripInvalid(std::string& str)
 {
     if (!valid<String>(str))
     {
-        size_type nValid = 0;
-        iterator iter2 = str.begin();
-
-        for
-        (
-            const_iterator iter1 = iter2;
-            iter1 != const_cast<const std::string&>(str).end();
-            iter1++
-        )
+        size_type nChar = 0;
+        iterator outIter = str.begin();
+
+        for (auto iter = str.cbegin(); iter != str.cend(); ++iter)
         {
-            const char c = *iter1;
+            const char c = *iter;
 
             if (String::valid(c))
             {
-                *iter2 = c;
-                ++iter2;
-                ++nValid;
+                *outIter = c;
+                ++outIter;
+                ++nChar;
             }
         }
 
-        str.resize(nValid);
+        str.resize(nChar);
 
         return true;
     }
@@ -151,7 +143,7 @@ template<class String>
 inline bool Foam::string::meta(const std::string& str, const char quote)
 {
     int escaped = 0;
-    for (const_iterator iter = str.begin(); iter != str.end(); ++iter)
+    for (auto iter = str.cbegin(); iter != str.cend(); ++iter)
     {
         const char c = *iter;
         if (quote && c == quote)
@@ -181,10 +173,10 @@ Foam::string::quotemeta(const std::string& str, const char quote)
     }
 
     string sQuoted;
-    sQuoted.reserve(2*str.length());
+    sQuoted.reserve(2*str.size());
 
     int escaped = 0;
-    for (const_iterator iter = str.begin(); iter != str.end(); ++iter)
+    for (auto iter = str.cbegin(); iter != str.cend(); ++iter)
     {
         const char c = *iter;
         if (c == quote)
@@ -203,7 +195,7 @@ Foam::string::quotemeta(const std::string& str, const char quote)
         sQuoted += c;
     }
 
-    sQuoted.resize(sQuoted.length());
+    sQuoted.resize(sQuoted.size());
 
     return sQuoted;
 }
@@ -212,9 +204,22 @@ Foam::string::quotemeta(const std::string& str, const char quote)
 template<class String>
 inline String Foam::string::validate(const std::string& str)
 {
-    string ss = str;
-    stripInvalid<String>(ss);
-    return ss;
+    String out;
+    out.resize(str.size());
+
+    size_type count = 0;
+    for (auto iter = str.cbegin(); iter != str.cend(); ++iter)
+    {
+        const char c = *iter;
+        if (String::valid(c))
+        {
+            out[count++] = c;
+        }
+    }
+
+    out.resize(count);
+
+    return out;
 }
 
 
@@ -257,4 +262,5 @@ inline unsigned Foam::string::hash::operator()
     return Hasher(str.data(), str.size(), seed);
 }
 
+
 // ************************************************************************* //
diff --git a/src/OpenFOAM/primitives/strings/stringOps/stringOps.C b/src/OpenFOAM/primitives/strings/stringOps/stringOps.C
index ea6d81ef0448b65fa46642a1bbaeb249cd396998..b3c35d95413387a2eb112ca2c51b6b91c8005c6c 100644
--- a/src/OpenFOAM/primitives/strings/stringOps/stringOps.C
+++ b/src/OpenFOAM/primitives/strings/stringOps/stringOps.C
@@ -123,12 +123,12 @@ Foam::string& Foam::stringOps::inplaceExpand
             }
             else
             {
-                string::iterator iter = s.begin() + begVar + 1;
+                string::const_iterator iter = s.cbegin() + begVar + 1;
 
                 // more generous in accepting keywords than for env variables
                 while
                 (
-                    iter != s.end()
+                    iter != s.cend()
                  &&
                     (
                         std::isalnum(*iter)
@@ -180,8 +180,7 @@ Foam::string& Foam::stringOps::inplaceExpand
                 }
 
 
-                HashTable<string, word, string::hash>::const_iterator fnd =
-                    mapping.find(varName);
+                auto fnd = mapping.cfind(varName);
 
                 if (fnd.found())
                 {
@@ -290,7 +289,9 @@ Foam::string Foam::stringOps::getVariable
             string::size_type altPos = 0;
 
             // check for parameter:-word or parameter:+word
-            int altType = findParameterAlternative(name, altPos, name.size()-1);
+            const int altType =
+                findParameterAlternative(name, altPos, name.size()-1);
+
             if (altType)
             {
                 value = getEnv
@@ -414,13 +415,13 @@ Foam::string& Foam::stringOps::inplaceExpand
             }
             else
             {
-                string::iterator iter = s.begin() + begVar + 1;
+                string::const_iterator iter = s.cbegin() + begVar + 1;
                 string::size_type endVar = begVar;
 
                 // more generous in accepting keywords than for env variables
                 while
                 (
-                    iter != s.end()
+                    iter != s.cend()
                  &&
                     (
                         std::isalnum(*iter)
@@ -552,12 +553,12 @@ Foam::string& Foam::stringOps::inplaceExpand
             }
             else
             {
-                string::iterator iter = s.begin() + begVar + 1;
+                string::const_iterator iter = s.cbegin() + begVar + 1;
 
                 // more generous in accepting keywords than for env variables
                 while
                 (
-                    iter != s.end()
+                    iter != s.cend()
                  &&
                     (
                         std::isalnum(*iter)
@@ -700,11 +701,11 @@ Foam::string& Foam::stringOps::inplaceExpand
             }
             else
             {
-                string::iterator iter = s.begin() + begVar + 1;
+                string::const_iterator iter = s.cbegin() + begVar + 1;
 
                 while
                 (
-                    iter != s.end()
+                    iter != s.cend()
                  && (std::isalnum(*iter) || *iter == '_')
                 )
                 {
diff --git a/src/OpenFOAM/primitives/strings/stringOps/stringOps.H b/src/OpenFOAM/primitives/strings/stringOps/stringOps.H
index 66e87623e50dba05a396a8faf191143059c8746d..0d7d459f596895a3341e45b4d79fcd3dfe848a22 100644
--- a/src/OpenFOAM/primitives/strings/stringOps/stringOps.H
+++ b/src/OpenFOAM/primitives/strings/stringOps/stringOps.H
@@ -30,12 +30,14 @@ Description
 
 SourceFiles
     stringOps.C
+    stringOpsTemplates.C
 
 \*---------------------------------------------------------------------------*/
 #ifndef stringOps_H
 #define stringOps_H
 
 #include "string.H"
+#include "SubStrings.H"
 #include "word.H"
 #include "dictionary.H"
 #include "HashTable.H"
@@ -302,14 +304,21 @@ namespace stringOps
     Foam::word name(const std::string& fmt, const PrimitiveType& val);
 
 
-} // End namespace stringOps
+    //- Split a string into sub-strings at the delimiter character.
+    //  An empty sub-strings are suppressed.
+    template<class StringType>
+    Foam::SubStrings<StringType> split
+    (
+        const StringType& str,
+        const char delimiter
+    );
 
+} // End namespace stringOps
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 } // End namespace Foam
 
-
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 #ifdef NoRepository
diff --git a/src/OpenFOAM/primitives/strings/stringOps/stringOpsTemplates.C b/src/OpenFOAM/primitives/strings/stringOps/stringOpsTemplates.C
index a8f70303006ca95985ac0b837c9f97a14a3e92f6..1b0aa62e9fd2d5561e11cb0abda4d8f44166ff53 100644
--- a/src/OpenFOAM/primitives/strings/stringOps/stringOpsTemplates.C
+++ b/src/OpenFOAM/primitives/strings/stringOps/stringOpsTemplates.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2016 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2016-2017 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -65,4 +65,36 @@ Foam::word Foam::stringOps::name
 }
 
 
+template<class StringType>
+Foam::SubStrings<StringType> Foam::stringOps::split
+(
+    const StringType& str,
+    const char delimiter
+)
+{
+    Foam::SubStrings<StringType> lst;
+    lst.reserve(20);
+
+    std::string::size_type beg = 0, end = 0;
+
+    while ((end = str.find(delimiter, beg)) != std::string::npos)
+    {
+        if (beg < end)
+        {
+            // (Non-empty) intermediate element
+            lst.append(str.cbegin() + beg, str.cbegin() + end);
+        }
+        beg = end + 1;
+    }
+
+    // (Non-empty) trailing element
+    if (beg < str.size())
+    {
+        lst.append(str.cbegin() + beg, str.cbegin() + str.size());
+    }
+
+    return lst;
+}
+
+
 // ************************************************************************* //
diff --git a/src/OpenFOAM/primitives/strings/word/word.C b/src/OpenFOAM/primitives/strings/word/word.C
index 3d829ae61e73ae46e41f02feaea182aa94b6592a..932f10af4cb83c5070e7edf82830de83b8005c50 100644
--- a/src/OpenFOAM/primitives/strings/word/word.C
+++ b/src/OpenFOAM/primitives/strings/word/word.C
@@ -35,52 +35,28 @@ const Foam::word Foam::word::null;
 
 // * * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * //
 
-Foam::word Foam::word::validated(const std::string& s, const bool prefix)
+Foam::word Foam::word::validate(const std::string& s, const bool prefix)
 {
+    word out;
+    out.resize(s.size() + (prefix ? 1 : 0));
+
     std::string::size_type count = 0;
-    bool extra = false;
 
-    // Count number of valid characters and detect if the first character
-    // happens to be a digit, which we'd like to avoid having since this
-    // will cause parse issues when read back later.
-    for (std::string::const_iterator it = s.cbegin(); it != s.cend(); ++it)
+    // As per validate, but optionally detect if the first character
+    // is a digit, which we'd like to avoid having since this will
+    // cause parse issues when read back later.
+    for (auto iter = s.cbegin(); iter != s.cend(); ++iter)
     {
-        const char c = *it;
+        const char c = *iter;
 
         if (word::valid(c))
         {
-            if (prefix && !count && isdigit(c))
+            if (!count && prefix && isdigit(c))
             {
                 // First valid character was a digit - prefix with '_'
-                extra = true;
-                ++count;
+                out[count++] = '_';
             }
 
-            ++count;
-        }
-    }
-
-    if (count == s.size() && !extra)
-    {
-        return word(s, false);  // Already checked, can just return as word
-    }
-
-    word out;
-    out.resize(count);
-    count = 0;
-
-    // Copy valid content.
-    if (extra)
-    {
-        out[count++] = '_';
-    }
-
-    for (std::string::const_iterator it = s.cbegin(); it != s.cend(); ++it)
-    {
-        const char c = *it;
-
-        if (word::valid(c))
-        {
             out[count++] = c;
         }
     }
diff --git a/src/OpenFOAM/primitives/strings/word/word.H b/src/OpenFOAM/primitives/strings/word/word.H
index 0661255341cc1b4ba11e235935c75aa12eb97889..b92d7209342b33015644dd1088d7077700f0e65c 100644
--- a/src/OpenFOAM/primitives/strings/word/word.H
+++ b/src/OpenFOAM/primitives/strings/word/word.H
@@ -64,6 +64,7 @@ class word
     // Private Member Functions
 
         //- Strip invalid characters from this word
+        //  Trips an abort on invalid characters for debug 2 or greater
         inline void stripInvalid();
 
 
@@ -112,10 +113,10 @@ public:
         //- Is this character valid for a word?
         inline static bool valid(char c);
 
-        //- Construct a validated word, in which all invalid characters have
-        //  been stripped out. Normally also prefix any leading digit
-        //  with '_' to have words that work nicely as dictionary keywords.
-        static word validated(const std::string& s, const bool prefix=true);
+        //- Construct validated word (no invalid characters).
+        //  Optionally prefix any leading digit with '_' to have words
+        //  that work nicely as dictionary keywords.
+        static word validate(const std::string& s, const bool prefix=false);
 
 
       // File-like functions
diff --git a/src/OpenFOAM/primitives/strings/word/wordI.H b/src/OpenFOAM/primitives/strings/word/wordI.H
index eb170970143a7aa2771d7c69c77eddbf36018c6f..2fa48801a7309bdeb6961434769182136c6b4eb1 100644
--- a/src/OpenFOAM/primitives/strings/word/wordI.H
+++ b/src/OpenFOAM/primitives/strings/word/wordI.H
@@ -24,12 +24,13 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include <cctype>
+#include <iostream>  // for std::cerr
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
 inline void Foam::word::stripInvalid()
 {
-    // skip stripping unless debug is active (to avoid costly operations)
+    // Skip stripping unless debug is active (to avoid costly operations)
     if (debug && string::stripInvalid<word>(*this))
     {
         std::cerr
diff --git a/src/OpenFOAM/primitives/strings/wordRe/wordRe.H b/src/OpenFOAM/primitives/strings/wordRe/wordRe.H
index 4df4325efda64be0beb6e2ba74d759ee323ef53a..8195abb90ecc732da936202161f89d083257939b 100644
--- a/src/OpenFOAM/primitives/strings/wordRe/wordRe.H
+++ b/src/OpenFOAM/primitives/strings/wordRe/wordRe.H
@@ -107,6 +107,11 @@ public:
         //- Is this a meta character?
         inline static bool meta(const char c);
 
+        //- Is this character valid for a wordRe?
+        //  This is largely identical with what word accepts, but also
+        //  permit brace-brackets, which are valid for some regexs.
+        inline static bool valid(char c);
+
         //- Test string for regular expression meta characters
         inline static bool isPattern(const std::string& str);
 
diff --git a/src/OpenFOAM/primitives/strings/wordRe/wordReI.H b/src/OpenFOAM/primitives/strings/wordRe/wordReI.H
index b01c590554682b995dbb7236cc7afdd24ab9b346..658df00695f479913f9caafae3c11fd603b6daf0 100644
--- a/src/OpenFOAM/primitives/strings/wordRe/wordReI.H
+++ b/src/OpenFOAM/primitives/strings/wordRe/wordReI.H
@@ -31,6 +31,12 @@ inline bool Foam::wordRe::meta(const char c)
 }
 
 
+inline bool Foam::wordRe::valid(char c)
+{
+    return keyType::valid(c);
+}
+
+
 inline bool Foam::wordRe::isPattern(const std::string& str)
 {
     return string::meta<regExp>(str);
diff --git a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/outletMappedUniformInletHeatAddition/outletMappedUniformInletHeatAdditionFvPatchField.H b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/outletMappedUniformInletHeatAddition/outletMappedUniformInletHeatAdditionFvPatchField.H
index bf38df03a1f77dd7da17a895c3dfa03102dcef41..a885abcc23be9b9d88ab25d252e945c866b63224 100644
--- a/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/outletMappedUniformInletHeatAddition/outletMappedUniformInletHeatAdditionFvPatchField.H
+++ b/src/TurbulenceModels/compressible/turbulentFluidThermoModels/derivedFvPatchFields/outletMappedUniformInletHeatAddition/outletMappedUniformInletHeatAdditionFvPatchField.H
@@ -125,8 +125,7 @@ public:
             const dictionary&
         );
 
-        //- Construct by mapping given outletMappedUniformInletHeatAdditionFvPatchField
-        //  onto a new patch
+        //- Construct by mapping onto a new patch
         outletMappedUniformInletHeatAdditionFvPatchField
         (
             const outletMappedUniformInletHeatAdditionFvPatchField&,
diff --git a/src/TurbulenceModels/schemes/DEShybrid/DEShybrid.H b/src/TurbulenceModels/schemes/DEShybrid/DEShybrid.H
index b6e2ea466f049f32037ffdce942f9a5d7e8864b8..2b2ed70887d18159acaa5f6a164a8a0e5da8c576 100644
--- a/src/TurbulenceModels/schemes/DEShybrid/DEShybrid.H
+++ b/src/TurbulenceModels/schemes/DEShybrid/DEShybrid.H
@@ -76,14 +76,14 @@ Description
         .
         .
         div(phi,U)      Gauss DEShybrid
-            linear                        // scheme 1
-            linearUpwind grad(U)          // scheme 2
-            0.65                          // DES coefficient, typically = 0.65
-            30                            // Reference velocity scale
-            2                             // Reference length scale
-            0                             // Minimum sigma limit (0-1)
-            1                             // Maximum sigma limit (0-1)
-            1.0e-03;                      // Limiter of B function, typically 1.0e-03
+            linear                    // scheme 1
+            linearUpwind grad(U)      // scheme 2
+            0.65                      // DES coefficient, typically = 0.65
+            30                        // Reference velocity scale
+            2                         // Reference length scale
+            0                         // Minimum sigma limit (0-1)
+            1                         // Maximum sigma limit (0-1)
+            1.0e-03;                  // Limiter of B function, typically 1e-03
         .
         .
     }
@@ -98,8 +98,9 @@ Notes
     solvers by default.  In order to use the scheme, add the library as a
     run-time loaded library in the \$FOAM\_CASE/system/controlDict
     dictionary, e.g.:
-
+    \verbatim
         libs ("libturbulenceModelSchemes.so");
+    \endverbatim
 
 SourceFiles
     DEShybrid.C
@@ -122,7 +123,7 @@ namespace Foam
 {
 
 /*---------------------------------------------------------------------------*\
-                          class DEShybrid Declaration
+                          Class DEShybrid Declaration
 \*---------------------------------------------------------------------------*/
 
 template<class Type>
@@ -199,7 +200,11 @@ class DEShybrid
             const volScalarField g(tanh(pow4(B)));
             const volScalarField A
             (
-                 CH2_*max(scalar(0), CDES_*delta/max(lTurb*g, 1.0e-15*L0_) - 0.5)
+                CH2_*max
+                (
+                    scalar(0),
+                    CDES_*delta/max(lTurb*g, 1.0e-15*L0_) - 0.5
+                )
             );
 
             const volScalarField factor
@@ -266,37 +271,37 @@ public:
             if (U0_.value() <= 0)
             {
                 FatalErrorInFunction
-                    << "U0 coefficient must be greater than 0. "
+                    << "U0 coefficient must be > 0. "
                     << "Current value: " << U0_ << exit(FatalError);
             }
             if (L0_.value() <= 0)
             {
                 FatalErrorInFunction
-                    << "L0 coefficient must be greater than 0. "
+                    << "L0 coefficient must be > 0. "
                     << "Current value: " << L0_ << exit(FatalError);
             }
             if (sigmaMin_ < 0)
             {
                 FatalErrorInFunction
-                    << "sigmaMin coefficient must be greater than or equal to 0. "
+                    << "sigmaMin coefficient must be >= 0. "
                     << "Current value: " << sigmaMin_ << exit(FatalError);
             }
             if (sigmaMax_ < 0)
             {
                 FatalErrorInFunction
-                    << "sigmaMax coefficient must be greater than or equal to 0. "
+                    << "sigmaMax coefficient must be >= 0. "
                     << "Current value: " << sigmaMax_ << exit(FatalError);
             }
             if (sigmaMin_ > 1)
             {
                 FatalErrorInFunction
-                    << "sigmaMin coefficient must be less than or equal to 1. "
+                    << "sigmaMin coefficient must be <= 1. "
                     << "Current value: " << sigmaMin_ << exit(FatalError);
             }
             if (sigmaMax_ > 1)
             {
                 FatalErrorInFunction
-                    << "sigmaMax coefficient must be less than or equal to 1. "
+                    << "sigmaMax coefficient must be <= 1. "
                     << "Current value: " << sigmaMax_ << exit(FatalError);
             }
         }
@@ -331,37 +336,37 @@ public:
             if (U0_.value() <= 0)
             {
                 FatalErrorInFunction
-                    << "U0 coefficient must be greater than 0. "
+                    << "U0 coefficient must be > 0. "
                     << "Current value: " << U0_ << exit(FatalError);
             }
             if (L0_.value() <= 0)
             {
                 FatalErrorInFunction
-                    << "L0 coefficient must be greater than 0. "
+                    << "L0 coefficient must be > 0. "
                     << "Current value: " << U0_ << exit(FatalError);
             }
             if (sigmaMin_ < 0)
             {
                 FatalErrorInFunction
-                    << "sigmaMin coefficient must be greater than or equal to 0. "
+                    << "sigmaMin coefficient must be >= 0. "
                     << "Current value: " << sigmaMin_ << exit(FatalError);
             }
             if (sigmaMax_ < 0)
             {
                 FatalErrorInFunction
-                    << "sigmaMax coefficient must be greater than or equal to 0. "
+                    << "sigmaMax coefficient must be >= 0. "
                     << "Current value: " << sigmaMax_ << exit(FatalError);
             }
             if (sigmaMin_ > 1)
             {
                 FatalErrorInFunction
-                    << "sigmaMin coefficient must be less than or equal to 1. "
+                    << "sigmaMin coefficient must be <= 1. "
                     << "Current value: " << sigmaMin_ << exit(FatalError);
             }
             if (sigmaMax_ > 1)
             {
                 FatalErrorInFunction
-                    << "sigmaMax coefficient must be less than or equal to 1. "
+                    << "sigmaMax coefficient must be <= 1. "
                     << "Current value: " << sigmaMax_ << exit(FatalError);
             }
         }
diff --git a/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C b/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C
index 65330eee0505e8ef8078e26dd6059896825f19fa..cbdbcd0b9b3ca926166da02852d846201e65567e 100644
--- a/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C
+++ b/src/TurbulenceModels/turbulenceModels/RAS/v2f/v2f.C
@@ -75,7 +75,12 @@ tmp<volScalarField> v2f<BasicTurbulenceModel>::Ls() const
                     max
                     (
                         this->nu(),
-                        dimensionedScalar("zero", this->nu()().dimensions(), 0.0)
+                        dimensionedScalar
+                        (
+                            "zero",
+                            this->nu()().dimensions(),
+                            0.0
+                        )
                     )
                 )/epsilon_
             )
diff --git a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C
index 2154d2cc948a7f3112980d486b88e336f6f1706d..83222a222bf485c6c4ca133f845ec1d258c1d24e 100644
--- a/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C
+++ b/src/combustionModels/FSD/reactionRateFlameAreaModels/reactionRateFlameArea/reactionRateFlameAreaNew.C
@@ -34,16 +34,15 @@ Foam::autoPtr<Foam::reactionRateFlameArea> Foam::reactionRateFlameArea::New
     const combustionModel& combModel
 )
 {
-    word reactionRateFlameAreaType
+    const word modelType
     (
         dict.lookup("reactionRateFlameArea")
     );
 
     Info<< "Selecting reaction rate flame area correlation "
-        << reactionRateFlameAreaType << endl;
+        << modelType << endl;
 
-    auto cstrIter =
-        dictionaryConstructorTablePtr_->cfind(reactionRateFlameAreaType);
+    auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
 
     if (!cstrIter.found())
     {
@@ -51,15 +50,13 @@ Foam::autoPtr<Foam::reactionRateFlameArea> Foam::reactionRateFlameArea::New
         (
             dict
         )   << "Unknown reactionRateFlameArea type "
-            << reactionRateFlameAreaType << nl << nl
+            << modelType << nl << nl
             << "Valid reaction rate flame area types :" << endl
             << dictionaryConstructorTablePtr_->sortedToc()
             << exit(FatalIOError);
     }
 
-    const label tempOpen = reactionRateFlameAreaType.find('<');
-
-    const word className = reactionRateFlameAreaType(0, tempOpen);
+    const word className = modelType.substr(0, modelType.find('<'));
 
     return autoPtr<reactionRateFlameArea>
         (cstrIter()(className, dict, mesh, combModel));
diff --git a/src/combustionModels/diffusionMulticomponent/diffusionMulticomponent.C b/src/combustionModels/diffusionMulticomponent/diffusionMulticomponent.C
index aa4893c07877a4b8129eb58f540d9027b829f713..6dbf0d5623148f43af53583a208957ad86044a54 100644
--- a/src/combustionModels/diffusionMulticomponent/diffusionMulticomponent.C
+++ b/src/combustionModels/diffusionMulticomponent/diffusionMulticomponent.C
@@ -380,7 +380,9 @@ Foam::combustionModels::diffusionMulticomponent<CombThermoType, ThermoType>::R
 
     if (this->active())
     {
-        const label specieI = this->thermo().composition().species()[Y.member()];
+        const label specieI =
+            this->thermo().composition().species()[Y.member()];
+
         Su += this->chemistryPtr_->RR(specieI);
     }
 
diff --git a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C
index ca7d0616b8d6b7d169eb52a21529a82d0f488fd8..50e69d177dba51bc3a50baa58f83149e2b970e5a 100644
--- a/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C
+++ b/src/combustionModels/psiCombustionModel/psiCombustionModel/psiCombustionModelNew.C
@@ -35,7 +35,7 @@ Foam::combustionModels::psiCombustionModel::New
     const word& phaseName
 )
 {
-    const word combModelName
+    const word modelType
     (
         IOdictionary
         (
@@ -51,21 +51,21 @@ Foam::combustionModels::psiCombustionModel::New
         ).lookup("combustionModel")
     );
 
-    Info<< "Selecting combustion model " << combModelName << endl;
+    Info<< "Selecting combustion model " << modelType << endl;
 
-    auto cstrIter = dictionaryConstructorTablePtr_->cfind(combModelName);
+    auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
 
     if (!cstrIter.found())
     {
         FatalErrorInFunction
             << "Unknown psiCombustionModel type "
-            << combModelName << endl << endl
-            << "Valid combustionModel types :" << endl
+            << modelType << nl << nl
+            << "Valid combustionModel types :" << nl
             << dictionaryConstructorTablePtr_->sortedToc()
             << exit(FatalError);
     }
 
-    const word className = combModelName(0, combModelName.find('<'));
+    const word className = modelType.substr(0, modelType.find('<'));
 
     return autoPtr<psiCombustionModel>
     (
diff --git a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C
index f6ffadc0b6a74e13c266266adeac412c063a344f..fb03177606ab5cac5d83274332c37b90abe22fb5 100644
--- a/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C
+++ b/src/combustionModels/rhoCombustionModel/rhoCombustionModel/rhoCombustionModelNew.C
@@ -35,7 +35,7 @@ Foam::combustionModels::rhoCombustionModel::New
     const word& phaseName
 )
 {
-    const word combTypeName
+    const word modelType
     (
         IOdictionary
         (
@@ -51,23 +51,21 @@ Foam::combustionModels::rhoCombustionModel::New
         ).lookup("combustionModel")
     );
 
-    Info<< "Selecting combustion model " << combTypeName << endl;
+    Info<< "Selecting combustion model " << modelType << endl;
 
-    auto cstrIter = dictionaryConstructorTablePtr_->cfind(combTypeName);
+    auto cstrIter = dictionaryConstructorTablePtr_->cfind(modelType);
 
     if (!cstrIter.found())
     {
         FatalErrorInFunction
             << "Unknown rhoCombustionModel type "
-            << combTypeName << endl << endl
-            << "Valid combustionModel types :" << endl
+            << modelType << nl << nl
+            << "Valid combustionModel types :" << nl
             << dictionaryConstructorTablePtr_->sortedToc()
             << exit(FatalError);
     }
 
-    const label tempOpen = combTypeName.find('<');
-
-    const word className = combTypeName(0, tempOpen);
+    const word className = modelType.substr(0, modelType.find('<'));
 
     return autoPtr<rhoCombustionModel>
     (
diff --git a/src/conversion/ccm/reader/ccmReader.C b/src/conversion/ccm/reader/ccmReader.C
index 66b8bd95054ebb4777b672582d6e28dffb216b87..78495c4ba512b2e3798bc5a28188c02efadc9d53 100644
--- a/src/conversion/ccm/reader/ccmReader.C
+++ b/src/conversion/ccm/reader/ccmReader.C
@@ -211,7 +211,8 @@ void Foam::ccm::reader::readProblemDescription
 
 
 // readInterfaceDefinitions:
-// - get /InterfaceDefinitions. used by STARCCM to define in-place interfaces, etc
+// - get /InterfaceDefinitions.
+//   used by STARCCM to define in-place interfaces, etc
 // - only handle in-place one here
 void Foam::ccm::reader::readInterfaceDefinitions()
 {
@@ -364,7 +365,7 @@ void Foam::ccm::reader::readProblemDescription_boundaryRegion
             }
             else
             {
-                dict.add(opt, word::validated(str));
+                dict.add(opt, word::validate(str, true));
             }
         }
 
@@ -388,7 +389,8 @@ void Foam::ccm::reader::readProblemDescription_boundaryRegion
             )
             {
 #ifdef DEBUG_CCMIOREAD
-                Info<< "boundary is on an interface: remap name for  " << Id << endl;
+                Info<< "boundary is on an interface: remap name for  "
+                    << Id << endl;
 #endif
                 // Substitute immediately with interface name
                 str = interfaceDefinitions_.interfaceName(Id);
@@ -405,7 +407,7 @@ void Foam::ccm::reader::readProblemDescription_boundaryRegion
 
             if (!str.empty())
             {
-                dict.add(opt, word::validated(str));
+                dict.add(opt, word::validate(str, true));
             }
         }
 
@@ -470,7 +472,7 @@ void Foam::ccm::reader::readProblemDescription_cellTable
                 str = "zone_" + ::Foam::name(Id);
             }
 
-            dict.add(opt, word::validated(str));
+            dict.add(opt, word::validate(str, true));
         }
 
 
@@ -482,7 +484,7 @@ void Foam::ccm::reader::readProblemDescription_cellTable
 
             if (!str.empty())
             {
-                dict.add(opt, word::validated(str));
+                dict.add(opt, word::validate(str, true));
             }
         }
 
diff --git a/src/conversion/ccm/reader/ccmReader.H b/src/conversion/ccm/reader/ccmReader.H
index 67d937f1365d1c8c4e3b324a7df3ff69578f2085..d19952298b8bb944257b20c8702bc708af8b15fa 100644
--- a/src/conversion/ccm/reader/ccmReader.H
+++ b/src/conversion/ccm/reader/ccmReader.H
@@ -329,8 +329,9 @@ private:
         //- Get interfaces, cellTable and boundaryRegion information
         void readProblemDescription(const ccmID& probNode);
 
-        //- Get /InterfaceDefinitions, used by STARCCM to define in-place interfaces, etc
-        //  only handle in-place (IN_PLACE) ones at the moment
+        //- Get /InterfaceDefinitions, used by STARCCM to define in-place
+        //  interfaces, etc.
+        //  Only handle in-place (IN_PLACE) ones at the moment
         void readInterfaceDefinitions();
 
         //- Get boundaryRegion information
@@ -358,7 +359,8 @@ private:
         //- Read the monitoring
         void readMonitoring(const ccmID& topoId);
 
-        //- Move solid faces from Default_Boundary_Region -> Default_Boundary_Solid
+        //- Move solid faces from Default_Boundary_Region to
+        //  Default_Boundary_Solid
         void juggleSolids();
 
         //- Remove unwanted fluid/porous/solid regions
diff --git a/src/conversion/ccm/reader/ccmReaderMesh.C b/src/conversion/ccm/reader/ccmReaderMesh.C
index a7cfd831b3eb7bdb0915687c40b4df98bee19578..cd696c8619475939eaf6bfa212843e1e251ea8bf 100644
--- a/src/conversion/ccm/reader/ccmReaderMesh.C
+++ b/src/conversion/ccm/reader/ccmReaderMesh.C
@@ -1053,7 +1053,11 @@ void Foam::ccm::reader::readMonitoring
             //
             //- simulate ReadFaceCells with kCCMIOBoundaryFaces
             // CCMIOGetNode(nullptr, childNode, "Cells", &subNode);
-            // CCMIORead1i(nullptr, subNode, faceCells.begin(), kCCMIOStart, kCCMIOEnd);
+            // CCMIORead1i
+            // (
+            //     nullptr, subNode, faceCells.begin(),
+            //     kCCMIOStart, kCCMIOEnd
+            // );
             //
             // Info << "cells: " << faceCells << endl;
         }
@@ -1159,7 +1163,8 @@ void Foam::ccm::reader::juggleSolids()
     // Adjust start and sizes
     patchSizes_[patchIndex] -= adjustPatch;
     patchSizes_[patchIndex+1] = adjustPatch;
-    patchStarts[patchIndex+1] = patchStarts[patchIndex] + patchSizes_[patchIndex];
+    patchStarts[patchIndex+1] =
+        patchStarts[patchIndex] + patchSizes_[patchIndex];
 
     origBndId_[patchIndex+1] = boundaryRegion_.append
     (
@@ -1686,8 +1691,9 @@ void Foam::ccm::reader::cleanupInterfaces()
                         oldToNew[face0] = pos + nsorted;
                         oldToNew[face1] = pos + nsorted + nsizeby2;
 
-                        // Mark destination of the faces, but cannot renumber yet
-                        // use negative to potential overlap with other patch regions
+                        // Mark destination of the faces, but cannot renumber
+                        // yet. Use negative to potential overlap with other
+                        // patch regions
                         bafInterfaces_[elemI][0] = -oldToNew[face0];
                         bafInterfaces_[elemI][1] = -oldToNew[face1];
 
@@ -1743,14 +1749,6 @@ void Foam::ccm::reader::cleanupInterfaces()
             oldToNew[face1] = oldToNew[face0];
         }
 
-//         Info<< "nInternalFaces " << nInternalFaces_ << nl
-//             << "oldToNew (internal) "
-//             << SubList<label>(oldToNew, nInternalFaces_)
-//             << nl
-//             << "oldToNew (extern) "
-//             << SubList<label>(oldToNew, nFaces_ - nInternalFaces_, nInternalFaces_)
-//             << endl;
-
         forAllIters(monitoringSets_, iter)
         {
             inplaceRenumber(oldToNew, iter());
diff --git a/src/conversion/ccm/writer/ccmWriterMesh.C b/src/conversion/ccm/writer/ccmWriterMesh.C
index 1e2bd0f2b28dbe5d80892a29a91da214aafd8d8b..4ac3c621b8215598fa9679fb9b167a3fbbe53a05 100644
--- a/src/conversion/ccm/writer/ccmWriterMesh.C
+++ b/src/conversion/ccm/writer/ccmWriterMesh.C
@@ -162,7 +162,8 @@ void Foam::ccm::writer::writeFaces
 
     if (ccm::debug)
     {
-        Info<<"CCMIOWriteFaces()  size:" << size << " streamSize:" << streamSize << endl;
+        Info<<"CCMIOWriteFaces()  size:" << size << " streamSize:"
+            << streamSize << endl;
     }
 
     CCMIOWriteFaces
diff --git a/src/conversion/ccm/writer/ccmWriterSolution.C b/src/conversion/ccm/writer/ccmWriterSolution.C
index f277629b1b8eab7fc85de34d11b3b27148d1504d..a4a04aed78d7a01d8f5dcc32efa83b4c1caba5d0 100644
--- a/src/conversion/ccm/writer/ccmWriterSolution.C
+++ b/src/conversion/ccm/writer/ccmWriterSolution.C
@@ -253,8 +253,8 @@ void Foam::ccm::writer::writeSolution
             processorNode,
             topoFileName.c_str(), &verticesNode,// verticesFile, verticesNode
             topoFileName.c_str(), &topoNode,    // topologyFile, topologyNode
-            nullptr, nullptr,                   // initialField unchanged
-            nullptr, nullptr                    // no solutionFile, solution unchanged
+            nullptr, nullptr,   // initialField unchanged
+            nullptr, nullptr    // no solutionFile, solution unchanged
         );
     }
     assertNoError("Error after writing geometry processor");
diff --git a/src/conversion/fire/FIREMeshReader.C b/src/conversion/fire/FIREMeshReader.C
index c57a188615836393f331c44adb891d313f02f114..239e6a5a87ba1d4241262a30590ab6ce7e4dcd16 100644
--- a/src/conversion/fire/FIREMeshReader.C
+++ b/src/conversion/fire/FIREMeshReader.C
@@ -155,7 +155,7 @@ void Foam::fileFormats::FIREMeshReader::readSelections(ISstream& is)
             // index starting at 1
             const label selId = ++nCellSelections;
 
-            cellTable_.setName(selId, word::validated(name));
+            cellTable_.setName(selId, word::validate(name, true));
             cellTable_.setMaterial(selId, "fluid");
 
             for (label i = 0; i < count; ++i)
@@ -170,7 +170,7 @@ void Foam::fileFormats::FIREMeshReader::readSelections(ISstream& is)
             // index starting at 0
             const label selId = nFaceSelections++;
 
-            faceNames.append(word::validated(name));
+            faceNames.append(word::validate(name, true));
 
             for (label i = 0; i < count; ++i)
             {
@@ -241,7 +241,8 @@ void Foam::fileFormats::FIREMeshReader::reorganize()
     inplaceReorder(oldToNew, neigh_);
     inplaceReorder(oldToNew, faceZoneId_);
 
-    // determine the patch sizes - faceNames_ already has extra place for missed faces
+    // Determine the patch sizes
+    // - faceNames_ already has extra place for missed faces
     const label zoneMissed = faceNames_.size() - 1;
     patchSizes_.setSize(faceNames_.size());
     patchSizes_ = 0;
@@ -292,7 +293,8 @@ void Foam::fileFormats::FIREMeshReader::reorganize()
         label patchI = faceZoneId_[faceI];
         if (patchI == -1)
         {
-            oldToNew[faceI] = patchStarts_[zoneMissed] + patchSizes_[zoneMissed];
+            oldToNew[faceI] =
+                patchStarts_[zoneMissed] + patchSizes_[zoneMissed];
             ++patchSizes_[zoneMissed];
         }
         else
diff --git a/src/conversion/starcd/STARCDMeshReader.C b/src/conversion/starcd/STARCDMeshReader.C
index 0229eaa0d20b854e84bd92c82652e703c7945e62..22af44c6fafc2965a72ceb55cc60f480598647f2 100644
--- a/src/conversion/starcd/STARCDMeshReader.C
+++ b/src/conversion/starcd/STARCDMeshReader.C
@@ -864,7 +864,9 @@ void Foam::fileFormats::STARCDMeshReader::readBoundary
                     if (prostarShapeLookup.found(mapIndex))
                     {
                         mapIndex = prostarShapeLookup[mapIndex];
-                        cellFaceId = STARCDCore::starToFoamFaceAddr[mapIndex][cellFaceId];
+                        cellFaceId =
+                            STARCDCore::starToFoamFaceAddr
+                            [mapIndex][cellFaceId];
                     }
                 }
                 else
diff --git a/src/conversion/starcd/STARCDMeshWriter.C b/src/conversion/starcd/STARCDMeshWriter.C
index c4ccf80faa70a339cc053cd3ab6b9a3f67fca1b7..a2e6bdb1ffb9d32cc10649d6d4a2e0301a78cb11 100644
--- a/src/conversion/starcd/STARCDMeshWriter.C
+++ b/src/conversion/starcd/STARCDMeshWriter.C
@@ -409,7 +409,8 @@ void Foam::fileFormats::STARCDMeshWriter::writeBoundary
                 }
 
                 mapIndex = prostarShapeLookup[mapIndex];
-                cellFaceId = STARCDCore::foamToStarFaceAddr[mapIndex][cellFaceId];
+                cellFaceId =
+                    STARCDCore::foamToStarFaceAddr[mapIndex][cellFaceId];
             }
             // Info<< endl;
 
diff --git a/src/dynamicMesh/fvMeshTools/fvMeshTools.C b/src/dynamicMesh/fvMeshTools/fvMeshTools.C
index 1222a658701eccc52a2bb8c6897b38b72cc009a2..117ddca4e52cf5946476585e4423b6fa672e11d5 100644
--- a/src/dynamicMesh/fvMeshTools/fvMeshTools.C
+++ b/src/dynamicMesh/fvMeshTools/fvMeshTools.C
@@ -483,7 +483,11 @@ Foam::autoPtr<Foam::fvMesh> Foam::fvMeshTools::newMesh
     else
     {
         // Receive patches
-        IPstream fromMaster(Pstream::commsTypes::scheduled, Pstream::masterNo());
+        IPstream fromMaster
+        (
+            Pstream::commsTypes::scheduled,
+            Pstream::masterNo()
+        );
         fromMaster >> patchEntries;
     }
 
diff --git a/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C b/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C
index 97f35afa23cc26e0342fafeeb620587f72884779..70a1347169b231358c61ffc706346f9741c103f6 100644
--- a/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C
+++ b/src/dynamicMesh/meshCut/cellLooper/topoCellLooper.C
@@ -43,7 +43,7 @@ namespace Foam
 }
 
 // Angle for polys to be considered splitHexes.
-const Foam::scalar Foam::topoCellLooper::featureCos = Foam::cos(10.0_deg);
+const Foam::scalar Foam::topoCellLooper::featureCos = Foam::cos(degToRad(10.0));
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
diff --git a/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C b/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C
index 689d112f67474f523e934de1949d62075750cc14..71623907fde7ea916639400177b0174e958e4248 100644
--- a/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C
+++ b/src/dynamicMesh/meshCut/meshModifiers/undoableMeshCutter/undoableMeshCutter.C
@@ -184,7 +184,7 @@ Foam::undoableMeshCutter::undoableMeshCutter
     faceRemover_
     (
         mesh,
-        Foam::cos(30.0_deg)
+        Foam::cos(degToRad(30.0))
     )
 {}
 
diff --git a/src/fileFormats/ensight/file/ensightCase.C b/src/fileFormats/ensight/file/ensightCase.C
index dc803f5f990c393b791286dc55b2e5489d9ce57f..9e9053ad4549827f537fb3bbc481aab42821e8df 100644
--- a/src/fileFormats/ensight/file/ensightCase.C
+++ b/src/fileFormats/ensight/file/ensightCase.C
@@ -307,7 +307,8 @@ void Foam::ensightCase::noteCloud
     else
     {
         FatalErrorInFunction
-            << "Tried to add a cloud variable for writing without having added a cloud"
+            << "Tried to add a cloud variable for writing"
+            << " - without having added a cloud"
             << abort(FatalError);
     }
 }
diff --git a/src/fileFormats/ensight/file/ensightCase.H b/src/fileFormats/ensight/file/ensightCase.H
index e6603d9a104e85a76c8d5258def631282f7c4b21..67835f2e7d693ee7248185270e3af957d72e603c 100644
--- a/src/fileFormats/ensight/file/ensightCase.H
+++ b/src/fileFormats/ensight/file/ensightCase.H
@@ -280,12 +280,12 @@ public:
         ) const;
 
 
-        //- Open stream for new data file (on master), using the current index.
+        //- Open stream for new data file (on master), with current index.
         template<class Type>
         autoPtr<ensightFile> newData(const word& varName) const;
 
 
-        //- Open stream for new cloud data file (on master), using the current index.
+        //- Open stream for new cloud data file (on master), with current index.
         template<class Type>
         autoPtr<ensightFile> newCloudData
         (
diff --git a/src/fileFormats/starcd/STARCDCore.H b/src/fileFormats/starcd/STARCDCore.H
index 21f64cae72c50ad5c6a5fcd43d9d9393d8aa7728..e4f7a03cab7a77fbcd7138c5efd9e437026e0b65 100644
--- a/src/fileFormats/starcd/STARCDCore.H
+++ b/src/fileFormats/starcd/STARCDCore.H
@@ -147,7 +147,11 @@ public:
     // Public Member Functions
 
         //- Resolve base file-name for the given file-type
-        static fileName starFileName(const fileName& baseName, const enum fileExt);
+        static fileName starFileName
+        (
+            const fileName& baseName,
+            const enum fileExt
+        );
 
 
         //- Remove existing PROSTAR files for the given base file-name
diff --git a/src/fileFormats/stl/STLReaderASCII.L b/src/fileFormats/stl/STLReaderASCII.L
index 46c9ab1a853195dd9c28254f436a50b46f5eb478..5a781d4a56b6979cde2fad4d72683d8371c4f1b4 100644
--- a/src/fileFormats/stl/STLReaderASCII.L
+++ b/src/fileFormats/stl/STLReaderASCII.L
@@ -243,7 +243,7 @@ endsolid              {space}("endsolid"|"ENDSOLID")({some_space}{word})*
 }
 
 <readSolidName>{string} {
-    const word solidName(Foam::string::validate<word>(YYText()));
+    const word solidName(word::validate(YYText()));
 
     auto iter = lookup_.cfind(solidName);
     if (iter.found())
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C
index 6a86dea0da02ca783b977ba06d3c100a70cbe63d..438d135ff8d4b05cb0ba94934da7e35648b9e91f 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/activePressureForceBaffleVelocity/activePressureForceBaffleVelocityFvPatchVectorField.C
@@ -287,7 +287,8 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::updateCoeffs()
             }
             else
             {
-                Info<< "Area-averaged pressure difference = " << valueDiff << endl;
+                Info<< "Area-averaged pressure difference = "
+                    << valueDiff << endl;
             }
         }
 
diff --git a/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.H b/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.H
index 4cf6b7c5153c658cff1b13f097d64a0a8c706754..04697bdb34227517ece77c72ce6e3b94fe2fdc51 100644
--- a/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.H
+++ b/src/functionObjects/field/fieldValues/surfaceFieldValue/surfaceFieldValue.H
@@ -88,7 +88,6 @@ Usage
         operation    | operation to perform    | yes         |
         postOperation | post-operation to perform    | no | none |
         weightField  | name of field to apply weighting | no |
-        orientedWeightField  | name of oriented field to apply weighting | no |
         scaleFactor  | scale factor            | no          | 1
         fields       | list of fields to operate on | yes    |
     \endtable
diff --git a/src/functionObjects/graphics/runTimePostProcessing/pointData.C b/src/functionObjects/graphics/runTimePostProcessing/pointData.C
index 42742962888b0de578a1fed1c10cdeab51ae23fc..82872a3bbb26d9cdcf2d2af62a55b99610d928b7 100644
--- a/src/functionObjects/graphics/runTimePostProcessing/pointData.C
+++ b/src/functionObjects/graphics/runTimePostProcessing/pointData.C
@@ -130,7 +130,8 @@ Foam::functionObjects::runTimePostPro::pointData::pointData
 
 // * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //
 
-Foam::autoPtr<Foam::functionObjects::runTimePostPro::pointData> Foam::functionObjects::runTimePostPro::pointData::New
+Foam::autoPtr<Foam::functionObjects::runTimePostPro::pointData>
+Foam::functionObjects::runTimePostPro::pointData::New
 (
     const runTimePostProcessing& parent,
     const dictionary& dict,
diff --git a/src/functionObjects/utilities/thermoCoupleProbes/thermoCoupleProbes.C b/src/functionObjects/utilities/thermoCoupleProbes/thermoCoupleProbes.C
index 740856a5a8d15cb177c417cfcfa2180df5dc8317..6c1cfd9bab69e98fd4084d211ef1ef5f32bbf9ad 100644
--- a/src/functionObjects/utilities/thermoCoupleProbes/thermoCoupleProbes.C
+++ b/src/functionObjects/utilities/thermoCoupleProbes/thermoCoupleProbes.C
@@ -128,13 +128,13 @@ void Foam::functionObjects::thermoCoupleProbes::derivatives
     scalarField Re(rhoc*Uc*d_/muc);
     scalarField Pr(Cpc*muc/kappac);
     Pr = max(ROOTVSMALL, Pr);
-    scalarField Nu(2.0 + (0.4*sqrt(Re) + 0.06*pow(Re, 2/3))*pow(Pr, 0.4));
+    scalarField Nu(2.0 + (0.4*sqrt(Re) + 0.06*pow(Re, 2.0/3.0))*pow(Pr, 0.4));
     scalarField htc(Nu*kappac/d_);
 
     const scalar sigma = physicoChemical::sigma.value();
 
     scalar area = 4*constant::mathematical::pi*sqr(0.5*d_);
-    scalar volume = (4/3)*constant::mathematical::pi*pow3(0.5*d_);
+    scalar volume = (4.0/3.0)*constant::mathematical::pi*pow3(0.5*d_);
 
     dydx =
         (epsilon_*(G/4 - sigma*pow4(y))*area + htc*(Tc - y)*area)
diff --git a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.C b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.C
index a8c5d41858977dc4d0a49961daf7158e26626450..683e356b238998310d0fb63758608a52f9d74084 100644
--- a/src/fvOptions/sources/derived/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.C
+++ b/src/fvOptions/sources/derived/rotorDiskSource/trimModel/targetCoeff/targetCoeffTrim.C
@@ -204,7 +204,7 @@ Foam::targetCoeffTrim::targetCoeffTrim
     nIter_(50),
     tol_(1e-8),
     relax_(1.0),
-    dTheta_(0.1_deg),
+    dTheta_(degToRad(0.1)),
     alpha_(1.0)
 {
     read(dict);
diff --git a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C
index d81ce400f67f9e0c1dcf8e9a0e90dd2dffd92df6..248c75c9aa8ac8419178f04b95fbb1e272b37a57 100644
--- a/src/lagrangian/DSMC/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C
+++ b/src/lagrangian/DSMC/submodels/BinaryCollisionModel/LarsenBorgnakkeVariableHardSphere/LarsenBorgnakkeVariableHardSphere.C
@@ -245,12 +245,14 @@ void Foam::LarsenBorgnakkeVariableHardSphere<CloudType>::collide
 
             if (iDofQ == 2)
             {
-                scalar energyRatio = 1.0 - pow(rndGen.sample01<scalar>(), (1.0/ChiB));
+                const scalar energyRatio =
+                    1.0 - pow(rndGen.sample01<scalar>(), (1.0/ChiB));
+
                 EiQ = energyRatio*availableEnergy;
             }
             else
             {
-                scalar ChiA = 0.5*iDofQ;
+                const scalar ChiA = 0.5*iDofQ;
                 EiQ = energyRatio(ChiA, ChiB)*availableEnergy;
             }
 
diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C
index 6f9ccfe51ee29ef8cc75e5f05b0ac094b8f40e4f..08237cb39879a4e0dfdd70fbb8258ec3cec345e8 100644
--- a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C
+++ b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C
@@ -315,7 +315,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::wetSplashInteraction
         const scalar epsilon = 0.993 - theta*(1.76 - theta*(1.56 - theta*0.49));
 
         // Update parcel velocity
-        U = -epsilon*(Un) + 5/7*(Ut);
+        U = -epsilon*(Un) + 5.0/7.0*(Ut);
 
         keepParticle = true;
         return;
diff --git a/src/lumpedPointMotion/lumpedPointMovement.C b/src/lumpedPointMotion/lumpedPointMovement.C
index 1f61bc1c36349b924ff3a7ae8cc74bc41fad25e6..7683ab5fd950b48881924e9958e3c97e77075eac 100644
--- a/src/lumpedPointMotion/lumpedPointMovement.C
+++ b/src/lumpedPointMotion/lumpedPointMovement.C
@@ -302,7 +302,8 @@ void Foam::lumpedPointMovement::setBoundBox
         centre_ -= (centre_ & axis_) * axis_;
         if (lumpedPointIOMovement::debug)
         {
-            Pout<<"autoCentre on " << centre_ << " boundBox: " << boundBox_ << endl;
+            Pout<<"autoCentre on " << centre_
+                << " boundBox: " << boundBox_ << endl;
         }
     }
     else
@@ -310,7 +311,8 @@ void Foam::lumpedPointMovement::setBoundBox
         // User-specified centre
         if (lumpedPointIOMovement::debug)
         {
-            Pout<<"centre on " << centre_ << " boundBox: " << boundBox_ << endl;
+            Pout<<"centre on " << centre_
+                << " boundBox: " << boundBox_ << endl;
         }
     }
 }
diff --git a/src/mesh/blockMesh/blockMesh/blockMesh.H b/src/mesh/blockMesh/blockMesh/blockMesh.H
index 01f9bf6411b0bf7e1e9675d818d4ab3f1c4cb821..74471c8e90068217996d88238b593b9734d29da7 100644
--- a/src/mesh/blockMesh/blockMesh/blockMesh.H
+++ b/src/mesh/blockMesh/blockMesh/blockMesh.H
@@ -157,7 +157,7 @@ class blockMesh
         void createPatches() const;
 
         //- As copy (not implemented)
-        blockMesh(const blockMesh&);
+        blockMesh(const blockMesh&) = delete;
 
 
 public:
diff --git a/src/mesh/blockMesh/blockMesh/blockMeshTopology.C b/src/mesh/blockMesh/blockMesh/blockMeshTopology.C
index ff275c852e6b69c484306d64126ab320fdcf8718..f270e4a20594f7ceec6f6bbe913ba1832f5591a0 100644
--- a/src/mesh/blockMesh/blockMesh/blockMeshTopology.C
+++ b/src/mesh/blockMesh/blockMesh/blockMeshTopology.C
@@ -362,6 +362,12 @@ Foam::polyMesh* Foam::blockMesh::createTopology
         meshDescription.readIfPresent("scale", scaleFactor_);
     }
 
+    // Require (scale > 0), treat (scale <= 0) as scaling == 1 (no scaling).
+    if (scaleFactor_ <= 0)
+    {
+        scaleFactor_ = 1.0;
+    }
+
     // Read the block edges
     if (meshDescription.found("edges"))
     {
diff --git a/src/mesh/blockMesh/blocks/block/block.C b/src/mesh/blockMesh/blocks/block/block.C
index dc842131a281384c66f7ffad3305e6fc3fd26899..481e2ed8802b95c99823e5fbe8f5e43ec030fa53 100644
--- a/src/mesh/blockMesh/blocks/block/block.C
+++ b/src/mesh/blockMesh/blocks/block/block.C
@@ -82,7 +82,7 @@ Foam::autoPtr<Foam::block> Foam::block::New
 
     if (!cstrIter.found())
     {
-        is.putBack(blockOrCellShapeType);
+        is.putBack(token(blockOrCellShapeType));
         return autoPtr<block>(new block(dict, index, points, edges, faces, is));
     }
     else
diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C
index 931501b342d5a485b24c61240160a582730573b6..99d642c1bd3428f137922b19341a3023ca08bb32 100644
--- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C
+++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementBaffles.C
@@ -148,14 +148,14 @@ Foam::label Foam::meshRefinement::createBaffle
 //    {
 //        return true;
 //    }
-//    else if (mag(n1&n2) > cos(30.0_deg))
+//    else if (mag(n1&n2) > cos(degToRad(30.0)))
 //    {
 //        // Both normals aligned. Check that test vector perpendicularish to
 //        // surface normal
 //        scalar magTestDir = mag(testDir);
 //        if (magTestDir > VSMALL)
 //        {
-//            if (mag(n1&(testDir/magTestDir)) < cos(45.0_deg))
+//            if (mag(n1&(testDir/magTestDir)) < cos(degToRad(45.0)))
 //            {
 //                //Pout<< "** disabling baffling face "
 //                //    << mesh_.faceCentres()[faceI] << endl;
diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementGapRefine.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementGapRefine.C
index 6b301662ee3136b3d471f9e9d6c3ca1440462822..dc87b9376facd72386d0c05a7c13d2d86429c1f8 100644
--- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementGapRefine.C
+++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementGapRefine.C
@@ -526,7 +526,7 @@ Foam::label Foam::meshRefinement::markSurfaceGapRefinement
 //    const indexedOctree<treeDataTriSurface>& tree = s.tree();
 //
 //
-//    const scalar searchCos = Foam::cos(30.0_deg);
+//    const scalar searchCos = Foam::cos(degToRad(30.0));
 //
 //    // Normals for ray shooting and inside/outside detection
 //    vectorField nearNormal;
diff --git a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementRefine.C b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementRefine.C
index f46eaf6ca8395e7f2fb4c9a797ba12ea143270a1..5d69b69098d80ed4acec1db750b8a759d0ddef84 100644
--- a/src/mesh/snappyHexMesh/meshRefinement/meshRefinementRefine.C
+++ b/src/mesh/snappyHexMesh/meshRefinement/meshRefinementRefine.C
@@ -1632,7 +1632,7 @@ bool Foam::meshRefinement::isNormalGap
             d /= magD;
 
             // Check average normal with respect to intersection locations
-            if (mag(avg&d) > Foam::cos(45.0_deg))
+            if (mag(avg&d) > Foam::cos(degToRad(45.0)))
             {
                 return true;
             }
diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.C
index 140b4f0c2db430376bae5fe8f3ab89779da4fa83..1040094bb1410ec2faaf2ff2e2de4f29e3375032 100644
--- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.C
+++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappyRefineDriver.C
@@ -1134,7 +1134,7 @@ Foam::label Foam::snappyRefineDriver::refinementInterfaceRefine
                 //    }
                 //}
 
-                const scalar oppositeCos = Foam::cos(135.0_deg);
+                const scalar oppositeCos = Foam::cos(degToRad(135.0));
 
                 forAllConstIter(cellSet, transitionCells, iter)
                 {
@@ -1861,8 +1861,8 @@ void Foam::snappyRefineDriver::mergePatchFaces
     {
         meshRefiner_.mergePatchFacesUndo
         (
-            Foam::cos(45.0_deg),
-            Foam::cos(45.0_deg),
+            Foam::cos(degToRad(45.0)),
+            Foam::cos(degToRad(45.0)),
             meshRefiner_.meshedPatches(),
             motionDict,
             labelList(mesh.nFaces(), -1)
@@ -1873,8 +1873,8 @@ void Foam::snappyRefineDriver::mergePatchFaces
         // Still merge refined boundary faces if all four are on same patch
         meshRefiner_.mergePatchFaces
         (
-            Foam::cos(45.0_deg),
-            Foam::cos(45.0_deg),
+            Foam::cos(degToRad(45.0)),
+            Foam::cos(degToRad(45.0)),
             4,          // only merge faces split into 4
             meshRefiner_.meshedPatches()
         );
@@ -1885,7 +1885,7 @@ void Foam::snappyRefineDriver::mergePatchFaces
         meshRefiner_.checkData();
     }
 
-    meshRefiner_.mergeEdgesUndo(Foam::cos(45.0_deg), motionDict);
+    meshRefiner_.mergeEdgesUndo(Foam::cos(degToRad(45.0)), motionDict);
 
     if (debug)
     {
diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C
index b0d7e484257286fdc0748649a48ce31b1c09a65f..79100022ffb50745d9b061251be4144587d88962 100644
--- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C
+++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriver.C
@@ -1117,7 +1117,7 @@ void Foam::snappySnapDriver::detectNearSurfaces
     //// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     //
     //{
-    //    const scalar cos45 = Foam::cos(45.0_deg);
+    //    const scalar cos45 = Foam::cos(degToRad(45.0));
     //    vector n(cos45, cos45, cos45);
     //    n /= mag(n);
     //
diff --git a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C
index 8f9ec62cc7528cad0edbe6e252d2df6b5d9038b4..ec9e7f3936d5ddd3020c449e35d1ee09b864b71a 100644
--- a/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C
+++ b/src/mesh/snappyHexMesh/snappyHexMeshDriver/snappySnapDriverFeature.C
@@ -2839,7 +2839,7 @@ void Foam::snappySnapDriver::determineBaffleFeatures
     // Detect baffle edges. Assume initial mesh will have 0,90 or 180
     // (baffle) degree angles so smoothing should make 0,90
     // to be less than 90. Choose reasonable value
-    const scalar baffleFeatureCos = Foam::cos(110.0_deg);
+    const scalar baffleFeatureCos = Foam::cos(degToRad(110.0));
 
 
     autoPtr<OBJstream> baffleEdgeStr;
diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C
index 9511881b8a6c5de535168209590ed717ee60d457..cf5273892572827e2946c7453ccca63600a26ce7 100644
--- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C
+++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIMethod/AMIMethod/AMIMethod.C
@@ -299,9 +299,9 @@ void Foam::AMIMethod<SourcePatch, TargetPatch>::appendNbrFaces
             const vector& n1 = patch.faceNormals()[facei];
             const vector& n2 = patch.faceNormals()[nbrFacei];
 
-            scalar cosI = n1 & n2;
+            const scalar cosI = n1 & n2;
 
-            if (cosI > Foam::cos(89.0_deg))
+            if (cosI > Foam::cos(degToRad(89.0)))
             {
                 faceIDs.append(nbrFacei);
             }
diff --git a/src/meshTools/edgeMesh/edgeMeshFormats/nas/NASedgeFormat.C b/src/meshTools/edgeMesh/edgeMeshFormats/nas/NASedgeFormat.C
index 7bd0acab4fa2964a9a74a731f01ee1533bffe90f..7bcc2d32439f629416ed693166d5eecc4bc27192 100644
--- a/src/meshTools/edgeMesh/edgeMeshFormats/nas/NASedgeFormat.C
+++ b/src/meshTools/edgeMesh/edgeMeshFormats/nas/NASedgeFormat.C
@@ -74,7 +74,7 @@ bool Foam::fileFormats::NASedgeFormat::read
         // Check if character 72 is continuation
         if (line.size() > 72 && line[72] == '+')
         {
-            line = line.substr(0, 72);
+            line.resize(72);
 
             while (true)
             {
@@ -87,7 +87,7 @@ bool Foam::fileFormats::NASedgeFormat::read
                 }
                 else
                 {
-                    line += buf.substr(8, buf.size()-8);
+                    line += buf.substr(8);
                     break;
                 }
             }
diff --git a/src/meshTools/edgeMesh/edgeMeshFormats/obj/OBJedgeFormat.C b/src/meshTools/edgeMesh/edgeMeshFormats/obj/OBJedgeFormat.C
index 1261b971cf1e1feb7a47840d45066d564a294601..e93dfead989c4139a0e592f61af2b037ffbbcc7c 100644
--- a/src/meshTools/edgeMesh/edgeMeshFormats/obj/OBJedgeFormat.C
+++ b/src/meshTools/edgeMesh/edgeMeshFormats/obj/OBJedgeFormat.C
@@ -116,10 +116,9 @@ bool Foam::fileFormats::OBJedgeFormat::read(const fileName& filename)
     {
         string line = this->getLineNoComment(is);
 
-        // handle continuations
-        if (line[line.size()-1] == '\\')
+        // Handle continuations
+        if (line.removeEnd("\\"))
         {
-            line.substr(0, line.size()-1);
             line += this->getLineNoComment(is);
         }
 
diff --git a/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C b/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C
index 43adc8695d8f63505fc8640b8888c7b6f25366d6..8758a9662ae6928346167f011a4e8e66f5d7c1b1 100644
--- a/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C
+++ b/src/meshTools/edgeMesh/extendedEdgeMesh/extendedEdgeMesh.C
@@ -85,7 +85,8 @@ Foam::extendedEdgeMesh::sideVolumeTypeNames_
 };
 
 
-Foam::scalar Foam::extendedEdgeMesh::cosNormalAngleTol_ = Foam::cos(0.1_deg);
+Foam::scalar Foam::extendedEdgeMesh::cosNormalAngleTol_ =
+    Foam::cos(degToRad(0.1));
 
 
 Foam::label Foam::extendedEdgeMesh::convexStart_ = 0;
diff --git a/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C b/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C
index 1c1b4bf1744feecf33e94bccc4e9b4d360f345fe..a6c033a84d391a74ca1f4d14b57552fc19521532 100644
--- a/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C
+++ b/src/meshTools/sets/cellSources/shapeToCell/shapeToCell.C
@@ -55,7 +55,7 @@ Foam::topoSetSource::addToUsageTable Foam::shapeToCell::usage_
 
 
 // Angle for polys to be considered splitHexes.
-Foam::scalar Foam::shapeToCell::featureCos = Foam::cos(10.0_deg);
+Foam::scalar Foam::shapeToCell::featureCos = Foam::cos(degToRad(10.0));
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C
index cc77026b9260250858ed23fc249ec3dd785a689f..2f9101a461d7bb52db7c49b3d64dc3d0bed351e8 100644
--- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C
+++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C
@@ -43,7 +43,7 @@ namespace Foam
 defineTypeNameAndDebug(edgeIntersections, 0);
 }
 
-Foam::scalar Foam::edgeIntersections::alignedCos_ = Foam::cos(89.0_deg);
+Foam::scalar Foam::edgeIntersections::alignedCos_ = Foam::cos(degToRad(89.0));
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
diff --git a/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C b/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C
index a251d856a3eef9813db41c1a616cd397be8571ff..c727121a60144f4854e012946b37f35c50500496 100644
--- a/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C
+++ b/src/meshTools/triSurface/surfaceFeatures/surfaceFeatures.C
@@ -41,7 +41,7 @@ namespace Foam
 {
     defineTypeNameAndDebug(surfaceFeatures, 0);
 
-    const scalar surfaceFeatures::parallelTolerance = sin(1.0_deg);
+    const scalar surfaceFeatures::parallelTolerance = sin(degToRad(1.0));
 
 
 //! \cond fileScope
diff --git a/src/parallel/decompose/Allwmake b/src/parallel/decompose/Allwmake
index 15c73ac76826585ab1599a4c4ec2f651a00fa11f..a90f705601ba1a0848ea2bdd0ba49862f1d525e4 100755
--- a/src/parallel/decompose/Allwmake
+++ b/src/parallel/decompose/Allwmake
@@ -8,12 +8,17 @@ cd ${0%/*} || exit 1    # Run from this directory
 export FOAM_EXT_LIBBIN
 
 # Check for the existence of any of the files
-hasAnyFile()
+# On success, echoes the file found and returns 0, otherwise returns 2
+findFirstFile()
 {
     local file
     for file
     do
-        [ -f "$file" -a -r "$file" ] && return 0
+        if [ -f "$file" -a -r "$file" ]
+        then
+            echo "$file"
+            return 0
+        fi
     done
 
     return 2
@@ -25,6 +30,7 @@ hasAnyFile()
 hasMetis()
 {
     local warning="==> skip metis"
+    local header label settings
 
     unset METIS_ARCH_PATH METIS_VERSION
     settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/metis) || {
@@ -40,31 +46,30 @@ hasMetis()
     fi
 
     # Header
-    local header=$METIS_ARCH_PATH/include/metis.h
-    if [ "${METIS_ARCH_PATH##*-}" = system ]
-    then
-        [ -f "$header" ] || header=/usr/include/metis.h
-    fi
-    [ -f "$header" ] || {
+    header=$(findFirstFile \
+        $METIS_ARCH_PATH/include/metis.h \
+        /usr/include/metis.h \
+    ) || {
         echo "$warning (no header)"
         return 2  # file not found
     }
 
     # Library
-    hasAnyFile \
+    [ "${METIS_ARCH_PATH##*-}" = system ] || \
+    findFirstFile \
         $FOAM_EXT_LIBBIN/libmetis.so \
         $METIS_ARCH_PATH/lib/libmetis.a \
         $METIS_ARCH_PATH/lib/libmetis.so \
         $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmetis.a \
         $METIS_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libmetis.so \
-    || [ "${METIS_ARCH_PATH##*-}" = system ] || {
+    > /dev/null || {
         echo "$warning (missing library)"
         return 2
     }
 
     # Ensure consistent sizes between OpenFOAM and metis header
     # Extract IDXTYPEWIDTH from metis.h: regex as per ThirdParty Allwmake
-    local label=$(sed -ne 's/^.*#define  *IDXTYPEWIDTH  *\([1-9][0-9]\).*/\1/p' $header)
+    label=$(sed -ne 's/^.*#define  *IDXTYPEWIDTH  *\([1-9][0-9]\).*/\1/p' $header)
     : ${label:=unknown}
 
     if [ "$WM_LABEL_SIZE" = "$label" ]
@@ -83,6 +88,7 @@ hasMetis()
 hasScotch()
 {
     local warning="==> skip scotch"
+    local header label settings
 
     unset SCOTCH_ARCH_PATH SCOTCH_VERSION
     settings=$($WM_PROJECT_DIR/bin/foamEtcFile config.sh/scotch) || {
@@ -98,36 +104,54 @@ hasScotch()
     fi
 
     # Header
-    local header=$SCOTCH_ARCH_PATH/include/scotch.h
-    if [ "${SCOTCH_ARCH_PATH##*-}" = system ]
-    then
-        [ -f "$header" ] || header=/usr/include/scotch.h
-    fi
-    [ -f "$header" ] || {
+    header=$(findFirstFile \
+        $SCOTCH_ARCH_PATH/include/scotch.h \
+        /usr/include/scotch/scotch.h \
+        /usr/include/scotch.h
+    ) || {
         echo "$warning (no header)"
         return 2  # file not found
     }
 
     # Library
-    hasAnyFile \
+    [ "${SCOTCH_ARCH_PATH##*-}" = system ] || \
+    findFirstFile \
         $FOAM_EXT_LIBBIN/libscotch.so \
         $SCOTCH_ARCH_PATH/lib/libscotch.a \
         $SCOTCH_ARCH_PATH/lib/libscotch.so \
         $SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libscotch.a \
         $SCOTCH_ARCH_PATH/lib$WM_COMPILER_LIB_ARCH/libscotch.so \
-    || [ "${SCOTCH_ARCH_PATH##*-}" = system ] || {
+    > /dev/null || {
         echo "$warning (missing library)"
         return 2
     }
 
     # Ensure consistent sizes between OpenFOAM and scotch header
     # extract 'typedef int64_t SCOTCH_Num' or equivalent
-    local label=$(sed -ne \
+    label=$(sed -ne \
         's/^.*typedef *\([^ ]*\) *SCOTCH_Num.*/\1/ip' \
         "$header")
 
     : ${label:=unknown}
 
+    # No SCOTCH_VERSION set? Try to obtain from header
+    # extract #define SCOTCH_VERSION, SCOTCH_RELEASE, SCOTCH_PATCHLEVEL
+    [ -n "$SCOTCH_VERSION" ] || \
+    SCOTCH_VERSION=$(
+        eval $(
+            sed -ne \
+            's/^ *#define *SCOTCH_\(VERSION\|RELEASE\|PATCHLEVEL\) *\([0-9][0-9]*\).*$/\1=\2/p' \
+            "$header"
+        )
+
+        set -- $VERSION $RELEASE $PATCHLEVEL
+        IFS="."
+        [ "$#" -gt 0 ] && echo "scotch-$*"
+    )
+
+    # Failsafe value
+    : ${SCOTCH_VERSION:=scotch}
+
     case "$WM_LABEL_SIZE:$label" in
     (32:int32_t | 32:int | 64:int64_t | 64:long)
         echo "Scotch (label=$label) - $SCOTCH_ARCH_PATH"
@@ -187,4 +211,5 @@ fi
 wmake $targetType decompositionMethods
 wmake $targetType decompose
 
+
 #------------------------------------------------------------------------------
diff --git a/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.C b/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.C
index ca1f1511c068078f7fa4093de60dfbee925f4d1a..58f784039858c581f13fbfeebec3995cdaae8c55 100644
--- a/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.C
+++ b/src/regionModels/thermalBaffleModels/derivedFvPatchFields/thermalBaffle/thermalBaffleFvPatchScalarField.C
@@ -191,9 +191,8 @@ void thermalBaffleFvPatchScalarField::createPatchMesh()
     dicts[bottomPatchID].add("inGroups", inGroups);
     dicts[bottomPatchID].add("sampleMode", mpp.sampleModeNames_[mpp.mode()]);
 
-    const label sepPos = coupleGroup.find('_');
-
-    const word coupleGroupSlave = coupleGroup(0, sepPos) + "_slave";
+    const word coupleGroupSlave =
+        coupleGroup.substr(0, coupleGroup.find('_')) + "_slave";
 
     inGroups[0] = coupleGroupSlave;
     dicts[topPatchID].add("coupleGroup", coupleGroupSlave);
diff --git a/src/sampling/sampledSurface/readers/ensight/ensightSurfaceReader.C b/src/sampling/sampledSurface/readers/ensight/ensightSurfaceReader.C
index 2c21271939d7da5ec56115b36e6aca64da0d69b0..38a51d6141164155b13bfdb8753486cc0728cdb6 100644
--- a/src/sampling/sampledSurface/readers/ensight/ensightSurfaceReader.C
+++ b/src/sampling/sampledSurface/readers/ensight/ensightSurfaceReader.C
@@ -186,7 +186,7 @@ void Foam::ensightSurfaceReader::readCase(IFstream& is)
         //   surfaceName.****.fieldName
         // This is not parser friendly - simply take remainder of buffer
         label iPos = iss.stdStream().tellg();
-        fieldFileName = buffer(iPos, buffer.size() - iPos);
+        fieldFileName = buffer.substr(iPos);
         size_t p0  = fieldFileName.find_first_not_of(' ');
         if (p0 == string::npos)
         {
diff --git a/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.C b/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.C
index 8f9681a7dd65537ebbfcd8b3e43e39f6fe599ce9..2340b819c0f2d429f77eb2788f16c2f2bedb07de 100644
--- a/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.C
+++ b/src/surfMesh/surfaceFormats/ac3d/AC3DsurfaceFormat.C
@@ -121,10 +121,8 @@ bool Foam::fileFormats::AC3DsurfaceFormat<Face>::read
             if (cmd == "name")
             {
                 // name %s
-                string str = parse<string>(args);
-                string::stripInvalid<word>(str);
-
-                names[zoneI] = str;
+                const string str = parse<string>(args);
+                names[zoneI] = word::validate(str);
             }
             else if (cmd == "rot")
             {
diff --git a/src/surfMesh/surfaceFormats/nas/NASsurfaceFormat.C b/src/surfMesh/surfaceFormats/nas/NASsurfaceFormat.C
index 7f64549e9c2dae03b7ff61ef66372e02261f2d13..ab37ac9a9005514121f0c79a7bf99b1783c31a09 100644
--- a/src/surfMesh/surfaceFormats/nas/NASsurfaceFormat.C
+++ b/src/surfMesh/surfaceFormats/nas/NASsurfaceFormat.C
@@ -89,12 +89,12 @@ bool Foam::fileFormats::NASsurfaceFormat<Face>::read
         string line;
         is.getLine(line);
 
-        // Ansa extension
-        if (line.substr(0, 10) == "$ANSA_NAME")
+        // ANSA extension
+        if (line.startsWith("$ANSA_NAME"))
         {
-            string::size_type sem0 = line.find (';', 0);
-            string::size_type sem1 = line.find (';', sem0+1);
-            string::size_type sem2 = line.find (';', sem1+1);
+            string::size_type sem0 = line.find(';', 0);
+            string::size_type sem1 = line.find(';', sem0+1);
+            string::size_type sem2 = line.find(';', sem1+1);
 
             if
             (
@@ -111,17 +111,8 @@ bool Foam::fileFormats::NASsurfaceFormat<Face>::read
 
                 string rawName;
                 is.getLine(rawName);
-                if (rawName[rawName.size()-1] == '\r')
-                {
-                    rawName = rawName.substr(1, rawName.size()-2);
-                }
-                else
-                {
-                    rawName = rawName.substr(1, rawName.size()-1);
-                }
-
-                string::stripInvalid<word>(rawName);
-                ansaName = rawName;
+                rawName.removeEnd("\r");
+                ansaName = word::validate(rawName.substr(1));
 
                 // Info<< "ANSA tag for NastranID:" << ansaId
                 //     << " of type " << ansaType
@@ -132,11 +123,7 @@ bool Foam::fileFormats::NASsurfaceFormat<Face>::read
 
         // Hypermesh extension
         // $HMNAME COMP                   1"partName"
-        if
-        (
-            line.substr(0, 12) == "$HMNAME COMP"
-         && line.find ('"') != string::npos
-        )
+        if (line.startsWith("$HMNAME COMP") && line.find('"') != string::npos)
         {
             label groupId = readLabel
             (
@@ -147,11 +134,9 @@ bool Foam::fileFormats::NASsurfaceFormat<Face>::read
 
             string rawName;
             lineStream >> rawName;
-            string::stripInvalid<word>(rawName);
 
-            word groupName(rawName);
+            const word groupName = word::validate(rawName);
             nameLookup.insert(groupId, groupName);
-
             // Info<< "group " << groupId << " => " << groupName << endl;
         }
 
@@ -165,7 +150,7 @@ bool Foam::fileFormats::NASsurfaceFormat<Face>::read
         // Check if character 72 is continuation
         if (line.size() > 72 && line[72] == '+')
         {
-            line = line.substr(0, 72);
+            line.resize(72);
 
             while (true)
             {
@@ -178,7 +163,7 @@ bool Foam::fileFormats::NASsurfaceFormat<Face>::read
                 }
                 else
                 {
-                    line += buf.substr(8, buf.size()-8);
+                    line += buf.substr(8);
                     break;
                 }
             }
diff --git a/src/surfMesh/surfaceFormats/obj/OBJstream.C b/src/surfMesh/surfaceFormats/obj/OBJstream.C
index 7c3b34c1ae2db4f2c1070816bc897260af65b539..2fcf7f43052834b2b637f020f9c49e5cb505ce87 100644
--- a/src/surfMesh/surfaceFormats/obj/OBJstream.C
+++ b/src/surfMesh/surfaceFormats/obj/OBJstream.C
@@ -119,14 +119,9 @@ Foam::Ostream& Foam::OBJstream::writeQuoted
         OFstream::write(token::BEGIN_STRING);
 
         int backslash = 0;
-        for
-        (
-            std::string::const_iterator iter = str.begin();
-            iter != str.end();
-            ++iter
-        )
+        for (auto iter = str.cbegin(); iter != str.cend(); ++iter)
         {
-            char c = *iter;
+            const char c = *iter;
 
             if (c == '\\')
             {
@@ -161,12 +156,7 @@ Foam::Ostream& Foam::OBJstream::writeQuoted
     else
     {
         // output unquoted string, only advance line number on newline
-        for
-        (
-            std::string::const_iterator iter = str.begin();
-            iter != str.end();
-            ++iter
-        )
+        for (auto iter = str.cbegin(); iter != str.cend(); ++iter)
         {
             writeAndCheck(*iter);
         }
diff --git a/src/surfMesh/surfaceFormats/obj/OBJsurfaceFormat.C b/src/surfMesh/surfaceFormats/obj/OBJsurfaceFormat.C
index 708f7654e97b30e204fafe49f671603d074d54a9..e7a16d36758cf864911c2fe37f53abf51d843aba 100644
--- a/src/surfMesh/surfaceFormats/obj/OBJsurfaceFormat.C
+++ b/src/surfMesh/surfaceFormats/obj/OBJsurfaceFormat.C
@@ -81,10 +81,9 @@ bool Foam::fileFormats::OBJsurfaceFormat<Face>::read
     {
         string line = this->getLineNoComment(is);
 
-        // handle continuations
-        if (line[line.size()-1] == '\\')
+        // Handle continuations
+        if (line.removeEnd("\\"))
         {
-            line.substr(0, line.size()-1);
             line += this->getLineNoComment(is);
         }
 
diff --git a/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatCore.C b/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatCore.C
index 71b3751c8c40739dd9d4db596b4a979d17c5f62e..b6b87fc6a27cfffbf5c67003c7e56442200237aa 100644
--- a/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatCore.C
+++ b/src/surfMesh/surfaceFormats/starcd/STARCDsurfaceFormatCore.C
@@ -64,7 +64,7 @@ Foam::fileFormats::STARCDsurfaceFormatCore::readInpCellTable
         if (ctnameRE.match(line, groups))
         {
             const label tableId = atoi(groups[0].c_str());
-            const word tableName = word::validated(groups[1]);
+            const word tableName = word::validate(groups[1], true);
 
             if (!tableName.empty())
             {
diff --git a/src/surfMesh/surfaceFormats/tri/TRIsurfaceFormatCore.C b/src/surfMesh/surfaceFormats/tri/TRIsurfaceFormatCore.C
index 97b4112f9b6a41104a5657fbc74987b708deeffb..2c66572be93dd0ad26864c6c94f54a010314b7dc 100644
--- a/src/surfMesh/surfaceFormats/tri/TRIsurfaceFormatCore.C
+++ b/src/surfMesh/surfaceFormats/tri/TRIsurfaceFormatCore.C
@@ -86,12 +86,11 @@ bool Foam::fileFormats::TRIsurfaceFormatCore::read
     {
         string line = this->getLineNoComment(is);
 
-        // handle continuations ?
-        //          if (line[line.size()-1] == '\\')
-        //          {
-        //              line.substr(0, line.size()-1);
-        //              line += this->getLineNoComment(is);
-        //          }
+        // Handle continuations?
+        // if (line.removeEnd("\\"))
+        // {
+        //     line += this->getLineNoComment(is);
+        // }
 
         IStringStream lineStream(line);
 
@@ -128,14 +127,14 @@ bool Foam::fileFormats::TRIsurfaceFormatCore::read
         // ie, instead of having 0xFF, skip 0 and leave xFF to
         // get read as a word and name it "zoneFF"
 
-        char zero;
-        lineStream >> zero;
+        char zeroChar;
+        lineStream >> zeroChar;
 
-        word rawName(lineStream);
-        word name("zone" + rawName(1, rawName.size()-1));
+        const word rawName(lineStream);
+        const word name("zone" + rawName.substr(1));
 
-        HashTable<label>::const_iterator fnd = lookup.find(name);
-        if (fnd != lookup.end())
+        HashTable<label>::const_iterator fnd = lookup.cfind(name);
+        if (fnd.found())
         {
             if (zoneI != fnd())
             {
diff --git a/src/surfMesh/triSurface/interfaces/NAS/readNAS.C b/src/surfMesh/triSurface/interfaces/NAS/readNAS.C
index 42196867735262f0fa490b594916c71bd7ed69ef..f40226dc05bcad09ee0dbf9258f2974fed336b54 100644
--- a/src/surfMesh/triSurface/interfaces/NAS/readNAS.C
+++ b/src/surfMesh/triSurface/interfaces/NAS/readNAS.C
@@ -32,7 +32,6 @@ Description
         GRID          28        10.20269-.030265-2.358-8
     \endverbatim
 
-
 \*---------------------------------------------------------------------------*/
 
 #include "triSurface.H"
@@ -78,11 +77,8 @@ static std::string readNASToken
     size_t& index
 )
 {
-    size_t indexStart, indexEnd;
-
-    indexStart = index;
-
-    indexEnd = line.find(',', indexStart);
+    size_t indexStart = index;
+    size_t indexEnd = line.find(',', indexStart);
     index = indexEnd + 1;
 
     if (indexEnd == std::string::npos)
@@ -134,12 +130,12 @@ bool triSurface::readNAS(const fileName& fName)
         string line;
         is.getLine(line);
 
-        // Ansa extension
-        if (line.substr(0, 10) == "$ANSA_NAME")
+        // ANSA extension
+        if (line.startsWith("$ANSA_NAME"))
         {
-            string::size_type sem0 = line.find (';', 0);
-            string::size_type sem1 = line.find (';', sem0+1);
-            string::size_type sem2 = line.find (';', sem1+1);
+            string::size_type sem0 = line.find(';', 0);
+            string::size_type sem1 = line.find(';', sem0+1);
+            string::size_type sem2 = line.find(';', sem1+1);
 
             if
             (
@@ -156,15 +152,10 @@ bool triSurface::readNAS(const fileName& fName)
 
                 string nameString;
                 is.getLine(ansaName);
-                if (ansaName[ansaName.size()-1] == '\r')
-                {
-                    ansaName = ansaName.substr(1, ansaName.size()-2);
-                }
-                else
-                {
-                    ansaName = ansaName.substr(1, ansaName.size()-1);
-                }
 
+                ansaName.removeEnd("\r");  // Possible CR-NL
+
+                ansaName = ansaName.substr(1);
                 // Info<< "ANSA tag for NastranID:" << ansaId
                 //     << " of type " << ansaType
                 //     << " name " << ansaName << endl;
@@ -174,11 +165,7 @@ bool triSurface::readNAS(const fileName& fName)
 
         // Hypermesh extension
         // $HMNAME COMP                   1"partName"
-        if
-        (
-            line.substr(0, 12) == "$HMNAME COMP"
-         && line.find ('"') != string::npos
-        )
+        if (line.startsWith("$HMNAME COMP") && line.find('"') != string::npos)
         {
             label groupId = readLabel
             (
@@ -190,8 +177,9 @@ bool triSurface::readNAS(const fileName& fName)
             string rawName;
             lineStream >> rawName;
 
-            groupToName.insert(groupId, string::validate<word>(rawName));
-            Info<< "group " << groupId << " => " << rawName << endl;
+            const word groupName = word::validate(rawName);
+            groupToName.insert(groupId, groupName);
+            Info<< "group " << groupId << " => " << groupName << endl;
         }
 
 
@@ -204,20 +192,20 @@ bool triSurface::readNAS(const fileName& fName)
         // Check if character 72 is continuation
         if (line.size() > 72 && line[72] == '+')
         {
-            line = line.substr(0, 72);
+            line.resize(72);
 
             while (true)
             {
                 string buf;
                 is.getLine(buf);
 
-                if (buf.size() > 72 && buf[72]=='+')
+                if (buf.size() > 72 && buf[72] == '+')
                 {
                     line += buf.substr(8, 64);
                 }
                 else
                 {
-                    line += buf.substr(8, buf.size()-8);
+                    line += buf.substr(8);
                     break;
                 }
             }
@@ -287,8 +275,9 @@ bool triSurface::readNAS(const fileName& fName)
                 readLabel(IStringStream(readNASToken(line, 8, linei))());
             if (groupId == ansaId && ansaType == "PSHELL")
             {
-                groupToName.insert(groupId, string::validate<word>(ansaName));
-                Info<< "group " << groupId << " => " << ansaName << endl;
+                const word groupName = word::validate(ansaName);
+                groupToName.insert(groupId, groupName);
+                Info<< "group " << groupId << " => " << groupName << endl;
             }
         }
         else if (cmd == "GRID")
diff --git a/src/surfMesh/triSurface/interfaces/OBJ/readOBJ.C b/src/surfMesh/triSurface/interfaces/OBJ/readOBJ.C
index 9a5f3fe4996eb3be29de0afc689055a6a22d6f46..62187851483b7910e91de183bd70be6e14522b9c 100644
--- a/src/surfMesh/triSurface/interfaces/OBJ/readOBJ.C
+++ b/src/surfMesh/triSurface/interfaces/OBJ/readOBJ.C
@@ -51,13 +51,10 @@ bool Foam::triSurface::readOBJ(const fileName& OBJfileName)
     {
         string line = getLineNoComment(OBJfile);
 
-        label sz = line.size();
-
-        if (sz)
+        if (line.size())
         {
-            if (line[sz-1] == '\\')
+            if (line.removeEnd("\\"))
             {
-                line.substr(0, sz-1);
                 line += getLineNoComment(OBJfile);
             }
 
diff --git a/src/surfMesh/triSurface/interfaces/TRI/readTRI.C b/src/surfMesh/triSurface/interfaces/TRI/readTRI.C
index 841ab10692d7f19f7791773180f017bba128fbf2..b8190d39d5437a515f96e195f205d17ce33bee54 100644
--- a/src/surfMesh/triSurface/interfaces/TRI/readTRI.C
+++ b/src/surfMesh/triSurface/interfaces/TRI/readTRI.C
@@ -99,19 +99,18 @@ bool Foam::triSurface::readTRI(const fileName& TRIfileName)
 
         // Region/colour in .tri file starts with 0x. Skip.
 
-        char zero;
-        lineStream >> zero;
+        char zeroChar;
+        lineStream >> zeroChar;
 
-        word rawSolidName(lineStream);
+        const word rawSolidName(lineStream);
 
-        word solidName("patch" + rawSolidName(1, rawSolidName.size()-1));
+        const word solidName("patch" + rawSolidName.substr(1));
 
         label region  = -1;
 
-        HashTable<label, string>::const_iterator fnd =
-            STLsolidNames.find(solidName);
+        auto fnd = STLsolidNames.cfind(solidName);
 
-        if (fnd != STLsolidNames.end())
+        if (fnd.found())
         {
             region = fnd();
         }
diff --git a/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.C b/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.C
index 23fd128691b6e4ea775302e4619f269dfe2adaf1..3eace6af4cdbc5ff04934af0c95353f39012e218 100644
--- a/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.C
+++ b/src/thermophysicalModels/radiation/radiationModels/fvDOM/fvDOM/fvDOM.C
@@ -531,11 +531,11 @@ void Foam::radiation::fvDOM::setRayIdLambdaId
 ) const
 {
     // assuming name is in the form: CHARS_rayId_lambdaId
-    size_type i1 = name.find_first_of("_");
-    size_type i2 = name.find_last_of("_");
+    const size_type i1 = name.find('_');
+    const size_type i2 = name.rfind('_');
 
     rayId = readLabel(IStringStream(name.substr(i1+1, i2-1))());
-    lambdaId = readLabel(IStringStream(name.substr(i2+1, name.size()-1))());
+    lambdaId = readLabel(IStringStream(name.substr(i2+1))());
 }
 
 
diff --git a/src/thermophysicalModels/radiation/submodels/sootModel/sootModel/sootModelNew.C b/src/thermophysicalModels/radiation/submodels/sootModel/sootModel/sootModelNew.C
index 18fc90ada9f2d02b2ff66a7a0f74b111052cc665..a9af94a66f54589b52e6444e60b22bcb160148c0 100644
--- a/src/thermophysicalModels/radiation/submodels/sootModel/sootModel/sootModelNew.C
+++ b/src/thermophysicalModels/radiation/submodels/sootModel/sootModel/sootModelNew.C
@@ -56,9 +56,7 @@ Foam::radiation::sootModel::New
             << exit(FatalError);
     }
 
-    const label tempOpen = modelType.find('<');
-
-    const word className = modelType(0, tempOpen);
+    const word className = modelType.substr(0, modelType.find('<'));
 
     return autoPtr<sootModel>(cstrIter()(dict, mesh, className));
 }
diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L
index 79eca025078e1a6d1b992314ad8e0f88fafff5c8..80379ff868d99346e365b2eb8b05b72b63ec3d15 100644
--- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L
+++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinLexer.L
@@ -65,29 +65,6 @@ int yyFlexLexer::yywrap()
 //! \endcond
 
 
-Foam::string foamSpecieString(const char* YYText)
-{
-    Foam::string specieString(YYText);
-    return specieString;
-}
-
-
-Foam::word foamName(const char* YYText)
-{
-    Foam::string fn(YYText);
-    Foam::string::stripInvalid<Foam::word>(fn);
-    return fn;
-}
-
-
-Foam::word foamName(const Foam::string& s)
-{
-    Foam::string fn(s);
-    Foam::string::stripInvalid<Foam::word>(fn);
-    return fn;
-}
-
-
  /* ------------------------------------------------------------------------- *\
    ------ cppLexer::yylex()
  \* ------------------------------------------------------------------------- */
@@ -344,7 +321,7 @@ bool finishReaction = false;
     }
 
 <readElements>{elementName} {
-        currentElementName = foamName(YYText());
+        currentElementName = word::validate(YYText());
         correctElementName(currentElementName);
 
         if (!elementIndices_.found(currentElementName))
@@ -382,7 +359,7 @@ bool finishReaction = false;
     }
 
 <readSpecies>{specieName} {
-        word specieName(foamName(foamSpecieString(YYText())));
+        const word specieName = word::validate(YYText());
 
         if (specieName == "THERMO")
         {
@@ -429,15 +406,15 @@ bool finishReaction = false;
     }
 
 <readThermoAll>{thermoTemp}{thermoTemp}{thermoTemp} {
-        string temperaturesString(YYText());
-        //scalar lowestT(stringToScalar(temperaturesString(0, 10)));
-        allCommonT = stringToScalar(temperaturesString(10, 10));
-        //scalar highestT(stringToScalar(temperaturesString(20, 10)));
+        const string temperaturesString(YYText());
+        //scalar lowestT(stringToScalar(temperaturesString.substr(0, 10)));
+        allCommonT = stringToScalar(temperaturesString.substr(10, 10));
+        //scalar highestT(stringToScalar(temperaturesString.substr(20, 10)));
         BEGIN(readThermoSpecieName);
     }
 
 <readThermoSpecieName>{thermoSpecieName} {
-        string specieString(foamSpecieString(YYText()));
+        string specieString(YYText());
         if (newFormat_)
         {
             specieString.replaceAll(" ", "_");
@@ -449,7 +426,7 @@ bool finishReaction = false;
             size_t spacePos = specieString.find(' ');
             if (spacePos != string::npos)
             {
-                currentSpecieName = specieString(0, spacePos);
+                currentSpecieName = specieString.substr(0, spacePos);
             }
             else
             {
@@ -467,15 +444,15 @@ bool finishReaction = false;
     }
 
 <readThermoFormula>{thermoFormula} {
-        string thermoFormula(YYText());
+        const string thermoFormula(YYText());
 
         nSpecieElements = 0;
         currentSpecieComposition.setSize(5);
 
         for (int i=0; i<4; i++)
         {
-            word elementName(foamName(thermoFormula(5*i, 2)));
-            label nAtoms = atoi(thermoFormula(5*i + 2, 3).c_str());
+            word elementName = word::validate(thermoFormula.substr(5*i, 2));
+            label nAtoms = atoi(thermoFormula.substr(5*i + 2, 3).c_str());
 
             if (elementName.size() && nAtoms)
             {
@@ -490,31 +467,23 @@ bool finishReaction = false;
     }
 
 <readThermoPhase>{thermoPhase} {
-        char phaseChar = YYText()[0];
+        const char phaseChar = YYText()[0];
 
         switch (phaseChar)
         {
-            case 'S':
-                speciePhase_.insert(currentSpecieName, solid);
-            break;
-
-            case 'L':
-                speciePhase_.insert(currentSpecieName, liquid);
-            break;
-
-            case 'G':
-                speciePhase_.insert(currentSpecieName, gas);
-            break;
+            case 'S': speciePhase_.insert(currentSpecieName, solid); break;
+            case 'L': speciePhase_.insert(currentSpecieName, liquid); break;
+            case 'G': speciePhase_.insert(currentSpecieName, gas); break;
         }
 
         BEGIN(readThermoTemps);
     }
 
 <readThermoTemps>{thermoLowTemp}{thermoHighTemp}{thermoCommonTemp} {
-        string temperaturesString(YYText());
-        currentLowT = stringToScalar(temperaturesString(0, 10));
-        currentHighT = stringToScalar(temperaturesString(10, 10));
-        currentCommonT = stringToScalar(temperaturesString(20, 8));
+        const string temperaturesString(YYText());
+        currentLowT = stringToScalar(temperaturesString.substr(0, 10));
+        currentHighT = stringToScalar(temperaturesString.substr(10, 10));
+        currentCommonT = stringToScalar(temperaturesString.substr(20, 8));
 
         if (currentCommonT < SMALL)
         {
@@ -525,9 +494,9 @@ bool finishReaction = false;
     }
 
 <readThermoFormula2>{thermoFormula2} {
-        string thermoFormula(YYText());
-        word elementName(foamName(thermoFormula(0, 2)));
-        label nAtoms = atoi(thermoFormula(2, 3).c_str());
+        const string thermoFormula(YYText());
+        word elementName = word::validate(thermoFormula.substr(0, 2));
+        const label nAtoms = atoi(thermoFormula.substr(2, 3).c_str());
 
         if
         (
@@ -568,13 +537,13 @@ bool finishReaction = false;
     }
 
 <readThermoCoeff1>{thermoCoeff}{thermoCoeff}{thermoCoeff}{thermoCoeff}{thermoCoeff} {
-        string thermoCoeffString(YYText());
+        const string thermoCoeffString(YYText());
 
-        highCpCoeffs[0] = stringToScalar(thermoCoeffString(0, 15));
-        highCpCoeffs[1] = stringToScalar(thermoCoeffString(15, 15));
-        highCpCoeffs[2] = stringToScalar(thermoCoeffString(30, 15));
-        highCpCoeffs[3] = stringToScalar(thermoCoeffString(45, 15));
-        highCpCoeffs[4] = stringToScalar(thermoCoeffString(60, 15));
+        highCpCoeffs[0] = stringToScalar(thermoCoeffString.substr(0, 15));
+        highCpCoeffs[1] = stringToScalar(thermoCoeffString.substr(15, 15));
+        highCpCoeffs[2] = stringToScalar(thermoCoeffString.substr(30, 15));
+        highCpCoeffs[3] = stringToScalar(thermoCoeffString.substr(45, 15));
+        highCpCoeffs[4] = stringToScalar(thermoCoeffString.substr(60, 15));
 
         BEGIN(readThermoLineLabel2);
     }
@@ -586,12 +555,12 @@ bool finishReaction = false;
 <readThermoCoeff2>{thermoCoeff}{thermoCoeff}{thermoCoeff}{thermoCoeff}{thermoCoeff} {
         string thermoCoeffString(YYText());
 
-        highCpCoeffs[5] = stringToScalar(thermoCoeffString(0, 15));
-        highCpCoeffs[6] = stringToScalar(thermoCoeffString(15, 15));
+        highCpCoeffs[5] = stringToScalar(thermoCoeffString.substr(0, 15));
+        highCpCoeffs[6] = stringToScalar(thermoCoeffString.substr(15, 15));
 
-        lowCpCoeffs[0] = stringToScalar(thermoCoeffString(30, 15));
-        lowCpCoeffs[1] = stringToScalar(thermoCoeffString(45, 15));
-        lowCpCoeffs[2] = stringToScalar(thermoCoeffString(60, 15));
+        lowCpCoeffs[0] = stringToScalar(thermoCoeffString.substr(30, 15));
+        lowCpCoeffs[1] = stringToScalar(thermoCoeffString.substr(45, 15));
+        lowCpCoeffs[2] = stringToScalar(thermoCoeffString.substr(60, 15));
 
         BEGIN(readThermoLineLabel3);
     }
@@ -603,10 +572,10 @@ bool finishReaction = false;
 <readThermoCoeff3>{thermoCoeff}{thermoCoeff}{thermoCoeff}{thermoCoeff}{thermoCoeff} {
         string thermoCoeffString(YYText());
 
-        lowCpCoeffs[3] = stringToScalar(thermoCoeffString(0, 15));
-        lowCpCoeffs[4] = stringToScalar(thermoCoeffString(15, 15));
-        lowCpCoeffs[5] = stringToScalar(thermoCoeffString(30, 15));
-        lowCpCoeffs[6] = stringToScalar(thermoCoeffString(45, 15));
+        lowCpCoeffs[3] = stringToScalar(thermoCoeffString.substr(0, 15));
+        lowCpCoeffs[4] = stringToScalar(thermoCoeffString.substr(15, 15));
+        lowCpCoeffs[5] = stringToScalar(thermoCoeffString.substr(30, 15));
+        lowCpCoeffs[6] = stringToScalar(thermoCoeffString.substr(45, 15));
 
         BEGIN(readThermoLineLabel4);
     }
@@ -695,7 +664,7 @@ bool finishReaction = false;
 
 <readReactionKeyword>{reactionKeyword} {
 
-        word keyword(foamName(YYText()));
+        const word keyword = word::validate(YYText());
 
         HashTable<int>::iterator reactionKeywordIter
         (
@@ -807,7 +776,7 @@ bool finishReaction = false;
         }
         else
         {
-            currentSpecieName = foamName(foamSpecieString(YYText()));
+            currentSpecieName = word::validate(YYText());
 
             HashTable<label>::iterator specieIndexIter
             (
@@ -853,7 +822,7 @@ bool finishReaction = false;
 
 <readReactionKeyword>{reactionKeywordSlash} {
 
-        word keyword(foamName(YYText()));
+        word keyword = word::validate(YYText());
 
         HashTable<int>::iterator reactionKeywordIter
         (
@@ -1327,11 +1296,9 @@ bool finishReaction = false;
 
 <readPDependentSpecie>{pDependentSpecie} {
 
-        word rhsPDependentSpecieName = pDependentSpecieName;
-        pDependentSpecieName =
-            foamName(foamSpecieString(YYText()));
-        pDependentSpecieName =
-            pDependentSpecieName(0, pDependentSpecieName.size() - 1);
+        const word rhsPDependentSpecieName = pDependentSpecieName;
+        pDependentSpecieName = word::validate(YYText());
+        pDependentSpecieName.resize(pDependentSpecieName.size()-1);
 
         if (rrType == thirdBodyArrhenius)
         {
@@ -1400,7 +1367,7 @@ bool finishReaction = false;
     }
 
 <readTdepSpecie>{specieName} {
-        word specieName(foamName(foamSpecieString(YYText())));
+        word specieName = word::validate(YYText());
         FatalErrorInFunction
             << "Temperature-dependent reaction on line "
             << lineNo_ << "not yet supported"
@@ -1409,8 +1376,7 @@ bool finishReaction = false;
     }
 
 <readReactionOrderSpecie>{specieName} {
-        currentSpecieName =
-            word(foamName(foamSpecieString(YYText())));
+        currentSpecieName = word::validate(YYText());
 
         HashTable<label>::iterator specieIndexIter
         (
diff --git a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C
index 8f0330cea9995f36cf6b551dda070ebebb101401..5da2f878c4b72175943a1a175bb6a3aeee484281 100644
--- a/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C
+++ b/src/thermophysicalModels/specie/reaction/Reactions/Reaction/Reaction.C
@@ -211,17 +211,12 @@ Foam::Reaction<ReactionThermo>::specieCoeffs::specieCoeffs
     {
         word specieName = t.wordToken();
 
-        size_t i = specieName.find('^');
+        const size_t i = specieName.find('^');
 
         if (i != word::npos)
         {
-            string exponentStr = specieName
-            (
-                i + 1,
-                specieName.size() - i - 1
-            );
-            exponent = atof(exponentStr.c_str());
-            specieName = specieName(0, i);
+            exponent = atof(specieName.substr(i + 1).c_str());
+            specieName.resize(i);
         }
 
         if (species.contains(specieName))
diff --git a/tutorials/DNS/dnsFoam/boxTurb16/system/blockMeshDict b/tutorials/DNS/dnsFoam/boxTurb16/system/blockMeshDict
index 13fb2fb7286c86d03f5908d01feb2b8778efb396..0f4cb459b8e019c079cc0b11f23dc44fe0733531 100644
--- a/tutorials/DNS/dnsFoam/boxTurb16/system/blockMeshDict
+++ b/tutorials/DNS/dnsFoam/boxTurb16/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/basic/overLaplacianDyMFoam/heatTransfer/system/blockMeshDict b/tutorials/basic/overLaplacianDyMFoam/heatTransfer/system/blockMeshDict
index 40ae9f45e9eb7a40c39ef97db9c0342161aa84f2..796996860a37cde4550e4090b11065550ecb3a60 100644
--- a/tutorials/basic/overLaplacianDyMFoam/heatTransfer/system/blockMeshDict
+++ b/tutorials/basic/overLaplacianDyMFoam/heatTransfer/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/basic/potentialFoam/cylinder/system/blockMeshDict b/tutorials/basic/potentialFoam/cylinder/system/blockMeshDict
index c64d03f7786f8b12c9671fbc034dba21e5c09986..b8d2e44337fb657226f3ceef221924836110f319 100644
--- a/tutorials/basic/potentialFoam/cylinder/system/blockMeshDict
+++ b/tutorials/basic/potentialFoam/cylinder/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices #codeStream
 {
diff --git a/tutorials/basic/potentialFoam/pitzDaily/system/blockMeshDict b/tutorials/basic/potentialFoam/pitzDaily/system/blockMeshDict
index d56a5091ae9d7007bfc68a10d69b1274096ade93..66b270d144197ccfbbfee5c1570e87e1a776837c 100644
--- a/tutorials/basic/potentialFoam/pitzDaily/system/blockMeshDict
+++ b/tutorials/basic/potentialFoam/pitzDaily/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/basic/scalarTransportFoam/pitzDaily/system/blockMeshDict b/tutorials/basic/scalarTransportFoam/pitzDaily/system/blockMeshDict
index d56a5091ae9d7007bfc68a10d69b1274096ade93..66b270d144197ccfbbfee5c1570e87e1a776837c 100644
--- a/tutorials/basic/scalarTransportFoam/pitzDaily/system/blockMeshDict
+++ b/tutorials/basic/scalarTransportFoam/pitzDaily/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/system/blockMeshDict b/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/system/blockMeshDict
index 4f138a91411a86b1a51d8b94b6c6b5a5f2393eff..4c0c4c02b3dfc4ee167052c47a8f51b84e2b28b8 100644
--- a/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/system/blockMeshDict
+++ b/tutorials/combustion/PDRFoam/flamePropagationWithObstacles/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1.0;
+scale   1.0;
 
 vertices
 (
diff --git a/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/system/blockMeshDict b/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/system/blockMeshDict
index 36e529969ba2144523bde3ac22b31e91b3b4c3bc..2a1810928545cbf35e26dc07281ada5924790a87 100644
--- a/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/system/blockMeshDict
+++ b/tutorials/combustion/XiDyMFoam/annularCombustorTurbine/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertUoMeters 1;
+scale   1;
 
 r0 34;
 r1 39;
diff --git a/tutorials/combustion/XiDyMFoam/oscillatingCylinder/system/blockMeshDict b/tutorials/combustion/XiDyMFoam/oscillatingCylinder/system/blockMeshDict
index 00a191e545782e3a096a2b93cda5003668e1403b..e7527c477d3baec46628a96016713b48cf8394f5 100644
--- a/tutorials/combustion/XiDyMFoam/oscillatingCylinder/system/blockMeshDict
+++ b/tutorials/combustion/XiDyMFoam/oscillatingCylinder/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/combustion/XiFoam/RAS/moriyoshiHomogeneous/system/blockMeshDict b/tutorials/combustion/XiFoam/RAS/moriyoshiHomogeneous/system/blockMeshDict
index 0d793511f270a0866ef4d00eabcd9a272a0bf3c3..976d0daf0cb0477553075aa274c9d7252c7310de 100644
--- a/tutorials/combustion/XiFoam/RAS/moriyoshiHomogeneous/system/blockMeshDict
+++ b/tutorials/combustion/XiFoam/RAS/moriyoshiHomogeneous/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/combustion/fireFoam/LES/compartmentFire/system/blockMeshDict.m4 b/tutorials/combustion/fireFoam/LES/compartmentFire/system/blockMeshDict.m4
index 77daf3a70a5306175a8bafb5b2137a3bc59c1658..5ac0fa128b2a1c7a7cd9f2d4629ad03b3f7531b2 100644
--- a/tutorials/combustion/fireFoam/LES/compartmentFire/system/blockMeshDict.m4
+++ b/tutorials/combustion/fireFoam/LES/compartmentFire/system/blockMeshDict.m4
@@ -23,7 +23,7 @@ define(vlabel, [[// ]Vertex $1 = VCOUNT define($1, VCOUNT)define([VCOUNT], incr(
 define(pi, 3.14159265)
 define(angle, 45)
 
-convertToMeters 1;
+scale   1;
 
 /*  User parameter for geometry  */
 define(L_square, 0.06)
diff --git a/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/system/blockMeshDict b/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/system/blockMeshDict
index f9b31c018456089859f4e5fcc78662a5f8c504a9..8307097c25fb3e2af2fd6f5d21f10ebed45e8815 100644
--- a/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/system/blockMeshDict
+++ b/tutorials/combustion/fireFoam/LES/flameSpreadWaterSuppressionPanel/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/combustion/fireFoam/LES/oppositeBurningPanels/system/blockMeshDict b/tutorials/combustion/fireFoam/LES/oppositeBurningPanels/system/blockMeshDict
index 3c5f8544aa5fba113d96254dc0446328defe34de..168c11c859455f5d4e3501a196bcf4e90baf2507 100644
--- a/tutorials/combustion/fireFoam/LES/oppositeBurningPanels/system/blockMeshDict
+++ b/tutorials/combustion/fireFoam/LES/oppositeBurningPanels/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/combustion/fireFoam/LES/simplePMMApanel/system/blockMeshDict b/tutorials/combustion/fireFoam/LES/simplePMMApanel/system/blockMeshDict
index a98922be864ff3ac7929a9aef8db3a9b9d587792..642b2f8dc352b0368602e9efa979fc610a934418 100644
--- a/tutorials/combustion/fireFoam/LES/simplePMMApanel/system/blockMeshDict
+++ b/tutorials/combustion/fireFoam/LES/simplePMMApanel/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/combustion/fireFoam/LES/smallPoolFire2D/system/blockMeshDict b/tutorials/combustion/fireFoam/LES/smallPoolFire2D/system/blockMeshDict
index cb3cfa521d5bc4057a2b641f8f2a1db6b32b6b3d..d4c5e2cccd651bff4ace2a7933cfaf292eb6fe40 100644
--- a/tutorials/combustion/fireFoam/LES/smallPoolFire2D/system/blockMeshDict
+++ b/tutorials/combustion/fireFoam/LES/smallPoolFire2D/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/combustion/fireFoam/LES/smallPoolFire3D/system/blockMeshDict b/tutorials/combustion/fireFoam/LES/smallPoolFire3D/system/blockMeshDict
index c0ef30e98b43a0cd07b771355485b122b58596b8..0d9654b28949fd4ccea9d7d844ef71ba332fdb28 100644
--- a/tutorials/combustion/fireFoam/LES/smallPoolFire3D/system/blockMeshDict
+++ b/tutorials/combustion/fireFoam/LES/smallPoolFire3D/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/system/blockMeshDict b/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/system/blockMeshDict
index cfb49f89b100573c11f4929f4dd0df2ac0e5858a..0dce920e40ca7425943d49546a8272c0d78f7f89 100644
--- a/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/system/blockMeshDict
+++ b/tutorials/combustion/reactingFoam/RAS/DLR_A_LTS/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 R1X 3.99619288633;
 R2X 4.49571699712;
diff --git a/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/system/blockMeshDict b/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/system/blockMeshDict
index 92054dd89339a1135a77fada1a6362a5ab46506c..d317daf07e74b8cf9f33570a36973f9591ede986 100644
--- a/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/system/blockMeshDict
+++ b/tutorials/combustion/reactingFoam/RAS/SandiaD_LTS/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/system/blockMeshDict b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/system/blockMeshDict
index f0f06a591bcdb4a0797ba7a4ed8ab06e189d8154..915d5eea8148c6d1ab4a2825e408bb44bee4d728 100644
--- a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/system/blockMeshDict
+++ b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2DLTS/system/blockMeshDict b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2DLTS/system/blockMeshDict
index f0f06a591bcdb4a0797ba7a4ed8ab06e189d8154..915d5eea8148c6d1ab4a2825e408bb44bee4d728 100644
--- a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2DLTS/system/blockMeshDict
+++ b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2DLTS/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2DLTS_GRI_TDAC/system/blockMeshDict b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2DLTS_GRI_TDAC/system/blockMeshDict
index f0f06a591bcdb4a0797ba7a4ed8ab06e189d8154..915d5eea8148c6d1ab4a2825e408bb44bee4d728 100644
--- a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2DLTS_GRI_TDAC/system/blockMeshDict
+++ b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2DLTS_GRI_TDAC/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D_GRI/system/blockMeshDict b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D_GRI/system/blockMeshDict
index f0f06a591bcdb4a0797ba7a4ed8ab06e189d8154..915d5eea8148c6d1ab4a2825e408bb44bee4d728 100644
--- a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D_GRI/system/blockMeshDict
+++ b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D_GRI/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D_GRI_TDAC/system/blockMeshDict b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D_GRI_TDAC/system/blockMeshDict
index f0f06a591bcdb4a0797ba7a4ed8ab06e189d8154..915d5eea8148c6d1ab4a2825e408bb44bee4d728 100644
--- a/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D_GRI_TDAC/system/blockMeshDict
+++ b/tutorials/combustion/reactingFoam/laminar/counterFlowFlame2D_GRI_TDAC/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoCentralDyMFoam/movingCone/system/blockMeshDict b/tutorials/compressible/rhoCentralDyMFoam/movingCone/system/blockMeshDict
index 5152e8af6bfbaf631bf05189716556ced936f2fa..fe38daba6e79758969f0f70970a26724d1872692 100644
--- a/tutorials/compressible/rhoCentralDyMFoam/movingCone/system/blockMeshDict
+++ b/tutorials/compressible/rhoCentralDyMFoam/movingCone/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/system/blockMeshDict b/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/system/blockMeshDict
index 75d0ca9c52219161a20ef70a5c683f02698af753..13536af92287fb7e84640f83c628cff36cae1de4 100644
--- a/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/system/blockMeshDict
+++ b/tutorials/compressible/rhoCentralFoam/LadenburgJet60psi/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/system/blockMeshDict b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/system/blockMeshDict
index a3da683455b590b1922c0304631615aa8074dea0..4eed4bb99dd4ea62f9da10d817878c406dce22b7 100644
--- a/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/system/blockMeshDict
+++ b/tutorials/compressible/rhoCentralFoam/biconic25-55Run35/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoCentralFoam/forwardStep/system/blockMeshDict b/tutorials/compressible/rhoCentralFoam/forwardStep/system/blockMeshDict
index 2b4319734d273737d33d71f04f2e7dca6c1f4172..efc627a8072382ec143cc8e6c9f27c2809e8e9db 100644
--- a/tutorials/compressible/rhoCentralFoam/forwardStep/system/blockMeshDict
+++ b/tutorials/compressible/rhoCentralFoam/forwardStep/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoCentralFoam/obliqueShock/system/blockMeshDict b/tutorials/compressible/rhoCentralFoam/obliqueShock/system/blockMeshDict
index 0556cb061a930434e1830412a3f0efcc89764c1e..e1c8a62ce9bc8698706021c39ee037f1a553e044 100644
--- a/tutorials/compressible/rhoCentralFoam/obliqueShock/system/blockMeshDict
+++ b/tutorials/compressible/rhoCentralFoam/obliqueShock/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoCentralFoam/shockTube/system/blockMeshDict b/tutorials/compressible/rhoCentralFoam/shockTube/system/blockMeshDict
index f606cb1655a259b4ebb9ef523c410b32a6b2fdd1..5a4749aab37656491a79d55bf4e900d4c935d22f 100644
--- a/tutorials/compressible/rhoCentralFoam/shockTube/system/blockMeshDict
+++ b/tutorials/compressible/rhoCentralFoam/shockTube/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoCentralFoam/wedge15Ma5/system/blockMeshDict b/tutorials/compressible/rhoCentralFoam/wedge15Ma5/system/blockMeshDict
index a82a8e3742f66aa420b9f7a9a42772bdd1ece520..2b2736ec3cb40a3e0762456e48f11903d25711b6 100644
--- a/tutorials/compressible/rhoCentralFoam/wedge15Ma5/system/blockMeshDict
+++ b/tutorials/compressible/rhoCentralFoam/wedge15Ma5/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoPimpleAdiabaticFoam/rutlandVortex2D/system/blockMeshDict b/tutorials/compressible/rhoPimpleAdiabaticFoam/rutlandVortex2D/system/blockMeshDict
index 213fe055b14f0cf4037df2b6f1a58e5d6ec5872c..d6485a47679b925cdfa59fefeaeadef1d94d8e65 100644
--- a/tutorials/compressible/rhoPimpleAdiabaticFoam/rutlandVortex2D/system/blockMeshDict
+++ b/tutorials/compressible/rhoPimpleAdiabaticFoam/rutlandVortex2D/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 // D = 0.57
-convertToMeters 0.57;
+scale   0.57;
 
 x0      -3.5;
 x1      1.8;
diff --git a/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/system/blockMeshDict b/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/system/blockMeshDict
index 959bb051905ea8a81ca1dc4fe9e1479bfb79a037..8400e089f9d8f50b09b7caa81e80bc99fadb8f95 100644
--- a/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/system/blockMeshDict
+++ b/tutorials/compressible/rhoPimpleDyMFoam/annularThermalMixer/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoPimpleFoam/LES/pitzDaily/system/blockMeshDict b/tutorials/compressible/rhoPimpleFoam/LES/pitzDaily/system/blockMeshDict
index d56a5091ae9d7007bfc68a10d69b1274096ade93..66b270d144197ccfbbfee5c1570e87e1a776837c 100644
--- a/tutorials/compressible/rhoPimpleFoam/LES/pitzDaily/system/blockMeshDict
+++ b/tutorials/compressible/rhoPimpleFoam/LES/pitzDaily/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/TJunction/system/blockMeshDict b/tutorials/compressible/rhoPimpleFoam/RAS/TJunction/system/blockMeshDict
index 60af047d0414ddbcd35b7dc40819d9a3192b6ff6..7c9012bc920021b45c7307c3bbf020e9acfa2885 100644
--- a/tutorials/compressible/rhoPimpleFoam/RAS/TJunction/system/blockMeshDict
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/TJunction/system/blockMeshDict
@@ -30,7 +30,7 @@ FoamFile
 //             +-+
 //           outlet2
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/blockMeshDict.m4 b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/blockMeshDict.m4
index 378e93531400cb34280e87cd24fd3fee5feb3bfd..17988e2f4429aabb0948372f36888b6186be9a30 100644
--- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/blockMeshDict.m4
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuct/system/blockMeshDict.m4
@@ -59,7 +59,7 @@ define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl>
 define(youtlet,calc(yporo + Sin*lenoutlet)) dnl>
 dnl>
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/blockMeshDict.m4 b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/blockMeshDict.m4
index c00bb933d47874af3198ccac4c7c97781a6cf6a8..fe2b1b84385eeb2a485a07aa56e561dacb8872d7 100644
--- a/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/blockMeshDict.m4
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/angledDuctLTS/system/blockMeshDict.m4
@@ -59,7 +59,7 @@ define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl>
 define(youtlet,calc(yporo + Sin*lenoutlet)) dnl>
 dnl>
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/cavity/system/blockMeshDict b/tutorials/compressible/rhoPimpleFoam/RAS/cavity/system/blockMeshDict
index 5f58428dd6957756f1e7d66e8d9a31e95ad07e8c..6c09069cce78a74eb7a1f40bb1e2350e46a2d75d 100644
--- a/tutorials/compressible/rhoPimpleFoam/RAS/cavity/system/blockMeshDict
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/cavity/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/system/blockMeshDict.m4 b/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/system/blockMeshDict.m4
index 978c365452b845edab1fb846ab3b5acbff7a4937..367e7b66fd25491135bb4d5aa64abbb54d247aee 100644
--- a/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/system/blockMeshDict.m4
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/mixerVessel2D/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, ($1b $4b $3b $2b))
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 // Hub radius
 define(r, 0.2)
diff --git a/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/blockMeshDict b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/blockMeshDict
index adb98d2811fd4c484c96ea00cb54d256b3826c8f..4980330b276ee58150f1593f0ba9b6b23c383520 100644
--- a/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/blockMeshDict
+++ b/tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/system/blockMeshDict b/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/system/blockMeshDict
index 307264d51b965a5113474fd9f58ea033d1d73a5f..d01bd8d2a67e6e22275eb55faf304f3fbeb44af6 100644
--- a/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/system/blockMeshDict
+++ b/tutorials/compressible/rhoPimpleFoam/laminar/helmholtzResonance/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.0025;
+scale   0.0025;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoPimpleFoam/laminar/sineWaveDamping/system/blockMeshDict b/tutorials/compressible/rhoPimpleFoam/laminar/sineWaveDamping/system/blockMeshDict
index 55efa8b2c4600904e08464283cd1d34338dfa99c..cddd6f08c0ad412db33870a3f0f787ac61159365 100644
--- a/tutorials/compressible/rhoPimpleFoam/laminar/sineWaveDamping/system/blockMeshDict
+++ b/tutorials/compressible/rhoPimpleFoam/laminar/sineWaveDamping/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/common/blockMeshDict.m4 b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/common/blockMeshDict.m4
index c00bb933d47874af3198ccac4c7c97781a6cf6a8..fe2b1b84385eeb2a485a07aa56e561dacb8872d7 100644
--- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/common/blockMeshDict.m4
+++ b/tutorials/compressible/rhoPorousSimpleFoam/angledDuct/common/blockMeshDict.m4
@@ -59,7 +59,7 @@ define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl>
 define(youtlet,calc(yporo + Sin*lenoutlet)) dnl>
 dnl>
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/blockMeshDict.m4 b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/blockMeshDict.m4
index c00bb933d47874af3198ccac4c7c97781a6cf6a8..fe2b1b84385eeb2a485a07aa56e561dacb8872d7 100644
--- a/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/blockMeshDict.m4
+++ b/tutorials/compressible/rhoSimpleFoam/angledDuctExplicitFixedCoeff/system/blockMeshDict.m4
@@ -59,7 +59,7 @@ define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl>
 define(youtlet,calc(yporo + Sin*lenoutlet)) dnl>
 dnl>
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoSimpleFoam/squareBend/system/blockMeshDict b/tutorials/compressible/rhoSimpleFoam/squareBend/system/blockMeshDict
index adb98d2811fd4c484c96ea00cb54d256b3826c8f..4980330b276ee58150f1593f0ba9b6b23c383520 100644
--- a/tutorials/compressible/rhoSimpleFoam/squareBend/system/blockMeshDict
+++ b/tutorials/compressible/rhoSimpleFoam/squareBend/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/blockMeshDict b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/blockMeshDict
index adb98d2811fd4c484c96ea00cb54d256b3826c8f..4980330b276ee58150f1593f0ba9b6b23c383520 100644
--- a/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/blockMeshDict
+++ b/tutorials/compressible/rhoSimpleFoam/squareBendLiq/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/compressible/sonicDyMFoam/movingCone/system/blockMeshDict b/tutorials/compressible/sonicDyMFoam/movingCone/system/blockMeshDict
index 5152e8af6bfbaf631bf05189716556ced936f2fa..fe38daba6e79758969f0f70970a26724d1872692 100644
--- a/tutorials/compressible/sonicDyMFoam/movingCone/system/blockMeshDict
+++ b/tutorials/compressible/sonicDyMFoam/movingCone/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/compressible/sonicFoam/RAS/prism/system/blockMeshDict b/tutorials/compressible/sonicFoam/RAS/prism/system/blockMeshDict
index 5a6793f5bf2956f6f4ecdc23a2d87c5e487b871e..e49cae32bcca3ae34004a0cdb594906662d4167d 100644
--- a/tutorials/compressible/sonicFoam/RAS/prism/system/blockMeshDict
+++ b/tutorials/compressible/sonicFoam/RAS/prism/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.01;
+scale   0.01;
 
 vertices
 (
diff --git a/tutorials/compressible/sonicFoam/laminar/forwardStep/system/blockMeshDict b/tutorials/compressible/sonicFoam/laminar/forwardStep/system/blockMeshDict
index e16345acd198662ec0ed363939ab7e121104cece..2cba17b774924dd1c1f043ea09c0f76662199273 100644
--- a/tutorials/compressible/sonicFoam/laminar/forwardStep/system/blockMeshDict
+++ b/tutorials/compressible/sonicFoam/laminar/forwardStep/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/compressible/sonicFoam/laminar/shockTube/system/blockMeshDict b/tutorials/compressible/sonicFoam/laminar/shockTube/system/blockMeshDict
index c8dd603ebd55c765c2b7867d1b41cfa7e16a090a..4ae38c119a6b447813ecdc6a4093fede4877177b 100644
--- a/tutorials/compressible/sonicFoam/laminar/shockTube/system/blockMeshDict
+++ b/tutorials/compressible/sonicFoam/laminar/shockTube/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/compressible/sonicLiquidFoam/decompressionTank/system/blockMeshDict b/tutorials/compressible/sonicLiquidFoam/decompressionTank/system/blockMeshDict
index 4c357b3d07da353a7e16352eea005e31031f4aa2..ad79f714502612db94683b690e1f5c57a40a4976 100644
--- a/tutorials/compressible/sonicLiquidFoam/decompressionTank/system/blockMeshDict
+++ b/tutorials/compressible/sonicLiquidFoam/decompressionTank/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/system/blockMeshDict b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/system/blockMeshDict
index e5167bcf141c3304f893128f57ead8046babf99b..1150c8fbe6ed521c08869fb5cb3a33dbcc86d788 100644
--- a/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/system/blockMeshDict
+++ b/tutorials/discreteMethods/dsmcFoam/freeSpacePeriodic/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.01;
+scale   0.01;
 
 vertices
 (
diff --git a/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/system/blockMeshDict b/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/system/blockMeshDict
index 3f7dd9093ad9063cee937dd4eefeb01876b414de..b7b33c3fcdc6c095c552c586accb3a7c35eaf1f6 100644
--- a/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/system/blockMeshDict
+++ b/tutorials/discreteMethods/dsmcFoam/freeSpaceStream/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.01;
+scale   0.01;
 
 vertices
 (
diff --git a/tutorials/discreteMethods/dsmcFoam/supersonicCorner/system/blockMeshDict b/tutorials/discreteMethods/dsmcFoam/supersonicCorner/system/blockMeshDict
index fb0e830e43ffee3ebf96b63786835b9fcff39633..324c57126f83322b1d14eabad823e65035abfafa 100644
--- a/tutorials/discreteMethods/dsmcFoam/supersonicCorner/system/blockMeshDict
+++ b/tutorials/discreteMethods/dsmcFoam/supersonicCorner/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.01;
+scale   0.01;
 
 vertices
 (
diff --git a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/system/blockMeshDict b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/system/blockMeshDict
index f6b6e32c1879050ea1e1bbb26c173378463c665a..7570d2772f1f19fc717a0b12c7a980c5ea5fdcd5 100644
--- a/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/system/blockMeshDict
+++ b/tutorials/discreteMethods/dsmcFoam/wedge15Ma5/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/system/blockMeshDict b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/system/blockMeshDict
index fd5a034c99902b0b338984adf89d447312fb3697..ebac510393719641fa29710ef8b61ebce749975d 100644
--- a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/system/blockMeshDict
+++ b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeArgon/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 2.462491658e-9;
+scale   2.462491658e-9;
 
 vertices
 (
diff --git a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeWater/system/blockMeshDict b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeWater/system/blockMeshDict
index 2afa81ddd042ef14eebb1121a7021ba05ead3fe7..f2dcdece1f812fc850e7327a758ee7e946e72e9e 100644
--- a/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeWater/system/blockMeshDict
+++ b/tutorials/discreteMethods/molecularDynamics/mdEquilibrationFoam/periodicCubeWater/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 2.10840e-9;
+scale   2.10840e-9;
 
 vertices
 (
diff --git a/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/system/blockMeshDict b/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/system/blockMeshDict
index ff30428ef68118d3940e258678357815c6a26245..29d923b2e53135fb509c197fef09351ac2cc0b2e 100644
--- a/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/system/blockMeshDict
+++ b/tutorials/discreteMethods/molecularDynamics/mdFoam/nanoNozzle/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 3.2e-9;
+scale   3.2e-9;
 
 vertices
 (
diff --git a/tutorials/electromagnetics/electrostaticFoam/chargedWire/system/blockMeshDict b/tutorials/electromagnetics/electrostaticFoam/chargedWire/system/blockMeshDict
index 51474f9320d9a3e2ac0e9d4b2ba9c0813cd3eb28..e4f6c2965418565a0db80534ba6f3953002307d0 100644
--- a/tutorials/electromagnetics/electrostaticFoam/chargedWire/system/blockMeshDict
+++ b/tutorials/electromagnetics/electrostaticFoam/chargedWire/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/electromagnetics/mhdFoam/hartmann/system/blockMeshDict b/tutorials/electromagnetics/mhdFoam/hartmann/system/blockMeshDict
index 66352a5e1c485e9d7b44f1a806015c09687a1fb0..7fae23a65342b6ba0fd44b609540f016cb95106a 100644
--- a/tutorials/electromagnetics/mhdFoam/hartmann/system/blockMeshDict
+++ b/tutorials/electromagnetics/mhdFoam/hartmann/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/financial/financialFoam/europeanCall/system/blockMeshDict b/tutorials/financial/financialFoam/europeanCall/system/blockMeshDict
index 51153e2c4cfb4e2e05adbc44a41c80b07729d5eb..8cd2be990e9b079389b7bc1c123d758c29cc8e04 100644
--- a/tutorials/financial/financialFoam/europeanCall/system/blockMeshDict
+++ b/tutorials/financial/financialFoam/europeanCall/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 200;
+scale   200;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/BernardCells/system/blockMeshDict b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/BernardCells/system/blockMeshDict
index 7c0a440b5188ca09e140b4df6a1eb9f827fd2f6d..1f58ded07ef8ec4d82c3573efac69b840e3d2fe0 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/BernardCells/system/blockMeshDict
+++ b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/BernardCells/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/system/blockMeshDict b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/system/blockMeshDict
index 9bfe4d9421f292287c5a8711552a70835bff82f4..6fdfe76425ef6b9ac1873b5cd4ae95895f2bda80 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/system/blockMeshDict
+++ b/tutorials/heatTransfer/buoyantBoussinesqPimpleFoam/hotRoom/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/blockMeshDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/blockMeshDict
index 9bfe4d9421f292287c5a8711552a70835bff82f4..6fdfe76425ef6b9ac1873b5cd4ae95895f2bda80 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/blockMeshDict
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/hotRoom/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/blockMeshDict b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/blockMeshDict
index 48842c478ffb8c4b953749e075463ab71a98f5a2..98f4f94479072474955d27bf6ad87b354a5a3de0 100644
--- a/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/blockMeshDict
+++ b/tutorials/heatTransfer/buoyantBoussinesqSimpleFoam/iglooWithFridges/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/system/blockMeshDict b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/system/blockMeshDict
index 9bfe4d9421f292287c5a8711552a70835bff82f4..6fdfe76425ef6b9ac1873b5cd4ae95895f2bda80 100644
--- a/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/system/blockMeshDict
+++ b/tutorials/heatTransfer/buoyantPimpleFoam/hotRoom/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/buoyantPimpleFoam/thermocoupleTestCase/system/blockMeshDict b/tutorials/heatTransfer/buoyantPimpleFoam/thermocoupleTestCase/system/blockMeshDict
index 721d41763b0e64bcf5635825909b426ae6e2a37c..f733e498157c9d3f2a9683659db25704e4bb9bac 100644
--- a/tutorials/heatTransfer/buoyantPimpleFoam/thermocoupleTestCase/system/blockMeshDict
+++ b/tutorials/heatTransfer/buoyantPimpleFoam/thermocoupleTestCase/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/blockMeshDict b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/blockMeshDict
index 0f23434d102a8159baa6392c3c5bf65ac4eadc7d..ec9a48732b9e279aa05783c7f77aad175b4bb013 100644
--- a/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/blockMeshDict
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/buoyantCavity/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/blockMeshDict b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/blockMeshDict
index daf6afe0b25f4918d6c90233a4c17e739d7bcbeb..a0b1674a956c7c48b20d144a88286dc3000ffb09 100644
--- a/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/blockMeshDict
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/circuitBoardCooling/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/system/blockMeshDict b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/system/blockMeshDict
index 68747c9b2b9a254de894a59305f661345186a826..ae7f223b839221a487bd63b5ec910ee8d03f586f 100644
--- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/system/blockMeshDict
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoom/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/system/blockMeshDict b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/system/blockMeshDict
index 68747c9b2b9a254de894a59305f661345186a826..ae7f223b839221a487bd63b5ec910ee8d03f586f 100644
--- a/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/system/blockMeshDict
+++ b/tutorials/heatTransfer/buoyantSimpleFoam/hotRadiationRoomFvDOM/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledMultiRegionHeater/system/blockMeshDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledMultiRegionHeater/system/blockMeshDict
index a0349cb81d2eca0501774b84c259945ad233b6c6..2ba9dce030268362add167d187e275c6af67bdcb 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledMultiRegionHeater/system/blockMeshDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalCoupledMultiRegionHeater/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/blockMeshDict b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/blockMeshDict
index 30d8e71a56901e82237c0349111bd8abd2a425fa..6e691ae405e1a5fafcc6dbd4bcfa11a2487632d1 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/blockMeshDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/externalSolarLoad/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/blockMeshDict b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/blockMeshDict
index a0349cb81d2eca0501774b84c259945ad233b6c6..2ba9dce030268362add167d187e275c6af67bdcb 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/blockMeshDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/blockMeshDict b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/blockMeshDict
index a0349cb81d2eca0501774b84c259945ad233b6c6..2ba9dce030268362add167d187e275c6af67bdcb 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/blockMeshDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/blockMeshDict b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/blockMeshDict
index 9ce5aac52d0b5c4b0c6949dc0a1e78ba272e7bfa..635757f74e605df1b0453f864d5ca3315d3cf910 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/blockMeshDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldCondensation/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/system/blockMeshDict b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/system/blockMeshDict
index 24b4060e2fac9ac8c5e64572729e119b63335305..55c2af8a2b2fa20ae87328dc725f252c8431c81b 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/system/blockMeshDict
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/windshieldDefrost/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/blockMeshDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/blockMeshDict
index 52ffe9012ad85dcff472381e41607020b5536282..12be2b50723c76b2aab80131d1802b2ec3b80687 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/blockMeshDict
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/air/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.05;
+scale   0.05;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/porous/blockMeshDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/porous/blockMeshDict
index 97861ae85bcc1e5bce35966371e1968797c69fea..7ff6efbd2bd41a5c215b84207a03a8290eb7e660 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/porous/blockMeshDict
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/heatExchanger/system/porous/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.05;
+scale   0.05;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/system/solid/blockMeshDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/system/solid/blockMeshDict
index aad40c34c05f32dc3e2a59a878501abeadb2ef7c..531015dacfdd1e5bdb46c242f153679009061cbc 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/system/solid/blockMeshDict
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/jouleHeatingSolid/system/solid/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/blockMeshDict b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/blockMeshDict
index a0349cb81d2eca0501774b84c259945ad233b6c6..2ba9dce030268362add167d187e275c6af67bdcb 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/blockMeshDict
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeaterRadiation/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/blockMeshDict.m4 b/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/blockMeshDict.m4
index 3ad72932a46a6bd0f1e8d9316ffb909a35621381..7d49c594ab917e58c28836fda7351cf5bf302e9e 100644
--- a/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/blockMeshDict.m4
+++ b/tutorials/incompressible/SRFPimpleFoam/rotor2D/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, ($1b $4b $3b $2b))
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 // Hub radius
 define(r, 0.05)
diff --git a/tutorials/incompressible/SRFSimpleFoam/mixer/system/blockMeshDict b/tutorials/incompressible/SRFSimpleFoam/mixer/system/blockMeshDict
index e639055dd64c9332b9108e93577df1c6a12a2afa..a79087ab1dfcad4d0686ab851647049169664fd8 100644
--- a/tutorials/incompressible/SRFSimpleFoam/mixer/system/blockMeshDict
+++ b/tutorials/incompressible/SRFSimpleFoam/mixer/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/incompressible/adjointShapeOptimizationFoam/pitzDaily/system/blockMeshDict b/tutorials/incompressible/adjointShapeOptimizationFoam/pitzDaily/system/blockMeshDict
index d56a5091ae9d7007bfc68a10d69b1274096ade93..66b270d144197ccfbbfee5c1570e87e1a776837c 100644
--- a/tutorials/incompressible/adjointShapeOptimizationFoam/pitzDaily/system/blockMeshDict
+++ b/tutorials/incompressible/adjointShapeOptimizationFoam/pitzDaily/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/incompressible/boundaryFoam/boundaryLaunderSharma/system/blockMeshDict b/tutorials/incompressible/boundaryFoam/boundaryLaunderSharma/system/blockMeshDict
index 5680de324744a8c2f530938886bee11e55d4e0a0..4a193339cc21fd3f559f76bb2c27939bfe880df9 100644
--- a/tutorials/incompressible/boundaryFoam/boundaryLaunderSharma/system/blockMeshDict
+++ b/tutorials/incompressible/boundaryFoam/boundaryLaunderSharma/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.05;
+scale   0.05;
 
 vertices
 (
diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctions/system/blockMeshDict b/tutorials/incompressible/boundaryFoam/boundaryWallFunctions/system/blockMeshDict
index efdd0f17b49c8e13830c7b2e86ed8ee3f2abb3aa..22a4a5d74374a0b9ee48a692fca3e6ec0dc6bdf3 100644
--- a/tutorials/incompressible/boundaryFoam/boundaryWallFunctions/system/blockMeshDict
+++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctions/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.05;
+scale   0.05;
 
 vertices
 (
diff --git a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/system/blockMeshDict b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/system/blockMeshDict
index efdd0f17b49c8e13830c7b2e86ed8ee3f2abb3aa..22a4a5d74374a0b9ee48a692fca3e6ec0dc6bdf3 100644
--- a/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/system/blockMeshDict
+++ b/tutorials/incompressible/boundaryFoam/boundaryWallFunctionsProfile/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.05;
+scale   0.05;
 
 vertices
 (
diff --git a/tutorials/incompressible/icoFoam/cavity/cavity/system/blockMeshDict b/tutorials/incompressible/icoFoam/cavity/cavity/system/blockMeshDict
index 5f58428dd6957756f1e7d66e8d9a31e95ad07e8c..6c09069cce78a74eb7a1f40bb1e2350e46a2d75d 100644
--- a/tutorials/incompressible/icoFoam/cavity/cavity/system/blockMeshDict
+++ b/tutorials/incompressible/icoFoam/cavity/cavity/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/incompressible/icoFoam/cavity/cavityClipped/system/blockMeshDict b/tutorials/incompressible/icoFoam/cavity/cavityClipped/system/blockMeshDict
index 645f42c5c25838a6d94db3d41c514b1abf46927f..9223258b942d59deeced5721bb321db5a4990669 100644
--- a/tutorials/incompressible/icoFoam/cavity/cavityClipped/system/blockMeshDict
+++ b/tutorials/incompressible/icoFoam/cavity/cavityClipped/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/incompressible/icoFoam/cavity/cavityGrade/system/blockMeshDict b/tutorials/incompressible/icoFoam/cavity/cavityGrade/system/blockMeshDict
index 597d2b6650dc35ecb111a133eac0a4fb4aa04b8e..41f72c55f8a424dcd15eb3f340f5630cb3b2beab 100644
--- a/tutorials/incompressible/icoFoam/cavity/cavityGrade/system/blockMeshDict
+++ b/tutorials/incompressible/icoFoam/cavity/cavityGrade/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/incompressible/icoFoam/cavityMappingTest/system/blockMeshDict.coarse b/tutorials/incompressible/icoFoam/cavityMappingTest/system/blockMeshDict.coarse
index 3118c894d875f5cf3287d1714402b6bd2cd2f48f..6b7e69ca49f5fd62bb46fc54438cc27a4ec33bca 100644
--- a/tutorials/incompressible/icoFoam/cavityMappingTest/system/blockMeshDict.coarse
+++ b/tutorials/incompressible/icoFoam/cavityMappingTest/system/blockMeshDict.coarse
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/incompressible/icoFoam/cavityMappingTest/system/blockMeshDict.fine b/tutorials/incompressible/icoFoam/cavityMappingTest/system/blockMeshDict.fine
index ff18fe91723135de7fa3e1ba09eba593d88f9d53..65d9c283fdd10bed86fc400aa6b22242d39e0197 100644
--- a/tutorials/incompressible/icoFoam/cavityMappingTest/system/blockMeshDict.fine
+++ b/tutorials/incompressible/icoFoam/cavityMappingTest/system/blockMeshDict.fine
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/incompressible/lumpedPointMotion/building/steady/system/blockMeshDict b/tutorials/incompressible/lumpedPointMotion/building/steady/system/blockMeshDict
index f74ade9f7a5961d6fd09d7fee605c724f670d87c..7741cd76dfdd07cc8688294396bf7084aaf8f246 100644
--- a/tutorials/incompressible/lumpedPointMotion/building/steady/system/blockMeshDict
+++ b/tutorials/incompressible/lumpedPointMotion/building/steady/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/nonNewtonianIcoFoam/offsetCylinder/system/blockMeshDict b/tutorials/incompressible/nonNewtonianIcoFoam/offsetCylinder/system/blockMeshDict
index ae0eea03723f428b23f71a6574e3862a44e375db..29d3d602e6134c74a969d910a40a80b346ff4021 100644
--- a/tutorials/incompressible/nonNewtonianIcoFoam/offsetCylinder/system/blockMeshDict
+++ b/tutorials/incompressible/nonNewtonianIcoFoam/offsetCylinder/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderAndBackground/system/blockMeshDict b/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderAndBackground/system/blockMeshDict
index 6e5e98888be4752510adbf4213f7e06441cdc761..40b57fce6f4bbc4cca2bbff8443a0bd8914e9857 100644
--- a/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderAndBackground/system/blockMeshDict
+++ b/tutorials/incompressible/overPimpleDyMFoam/cylinder/cylinderAndBackground/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/overPimpleDyMFoam/simpleRotor/system/blockMeshDict b/tutorials/incompressible/overPimpleDyMFoam/simpleRotor/system/blockMeshDict
index 7e5a21da5f53e67d393bb9c85279dc96e0fbfb36..bc0d9c02a8c1818e182f90c0a1a92a38ba1c8efd 100644
--- a/tutorials/incompressible/overPimpleDyMFoam/simpleRotor/system/blockMeshDict
+++ b/tutorials/incompressible/overPimpleDyMFoam/simpleRotor/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.01;
+scale   0.01;
 
 vertices
 (
diff --git a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/blockMeshDict b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/blockMeshDict
index e2fe1595c6346ff2a83268e66a0a1f452b3bf7df..abcbd45e7949729afa2f1856b525581d50f53330 100644
--- a/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/blockMeshDict
+++ b/tutorials/incompressible/overPimpleDyMFoam/twoSimpleRotors/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.01;
+scale   0.01;
 
 vertices
 (
diff --git a/tutorials/incompressible/overSimpleFoam/aeroFoil/aeroFoil_snappyHexMesh/system/blockMeshDict b/tutorials/incompressible/overSimpleFoam/aeroFoil/aeroFoil_snappyHexMesh/system/blockMeshDict
index f539f6c928209ce89c02cae600f6010f1f7e601d..5c5c3b5727f6010e06ae0c06e8f5962f1b7bde4f 100644
--- a/tutorials/incompressible/overSimpleFoam/aeroFoil/aeroFoil_snappyHexMesh/system/blockMeshDict
+++ b/tutorials/incompressible/overSimpleFoam/aeroFoil/aeroFoil_snappyHexMesh/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/system/blockMeshDict b/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/system/blockMeshDict
index 9c95d3eac673927d7ed24e3d5c3b1a4476938555..fbf525e19667dba723b3153d5591421fb1bc0882 100644
--- a/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/system/blockMeshDict
+++ b/tutorials/incompressible/overSimpleFoam/aeroFoil/background_overset/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/overSimpleFoam/aeroFoil/background_snappyHexMesh/system/blockMeshDict b/tutorials/incompressible/overSimpleFoam/aeroFoil/background_snappyHexMesh/system/blockMeshDict
index 5151eb3c5f61e739724cbbfcbeb95f73a74e716e..500a2ca931113509e7c781f2a1ca7629030373d4 100644
--- a/tutorials/incompressible/overSimpleFoam/aeroFoil/background_snappyHexMesh/system/blockMeshDict
+++ b/tutorials/incompressible/overSimpleFoam/aeroFoil/background_snappyHexMesh/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/system/blockMeshDict.m4 b/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/system/blockMeshDict.m4
index 30653d758b6963131c3f4cba55d920960de1c306..8a9a3ffdb1b21fb7901ef47891c2ca9df9f61684 100644
--- a/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/system/blockMeshDict.m4
+++ b/tutorials/incompressible/pimpleDyMFoam/mixerVesselAMI2D/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, ($1b $4b $3b $2b))
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 // Hub radius
 define(r, 0.2)
diff --git a/tutorials/incompressible/pimpleDyMFoam/movingCone/system/blockMeshDict b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/blockMeshDict
index 5152e8af6bfbaf631bf05189716556ced936f2fa..fe38daba6e79758969f0f70970a26724d1872692 100644
--- a/tutorials/incompressible/pimpleDyMFoam/movingCone/system/blockMeshDict
+++ b/tutorials/incompressible/pimpleDyMFoam/movingCone/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/incompressible/pimpleDyMFoam/oscillatingInletACMI2D/system/blockMeshDict b/tutorials/incompressible/pimpleDyMFoam/oscillatingInletACMI2D/system/blockMeshDict
index 4918eee995cc034859f2772944530e7a3f6ddf6b..d4cebc01007db04af98f628b60dd48265838473c 100644
--- a/tutorials/incompressible/pimpleDyMFoam/oscillatingInletACMI2D/system/blockMeshDict
+++ b/tutorials/incompressible/pimpleDyMFoam/oscillatingInletACMI2D/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/pimpleDyMFoam/oscillatingInletPeriodicAMI2D/system/blockMeshDict b/tutorials/incompressible/pimpleDyMFoam/oscillatingInletPeriodicAMI2D/system/blockMeshDict
index a674ddb2d5b60f5dba93539756c850f18a436016..09c1c6222ec39999bb55ec2da60936235ec7e539 100644
--- a/tutorials/incompressible/pimpleDyMFoam/oscillatingInletPeriodicAMI2D/system/blockMeshDict
+++ b/tutorials/incompressible/pimpleDyMFoam/oscillatingInletPeriodicAMI2D/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/pimpleDyMFoam/propeller/system/blockMeshDict b/tutorials/incompressible/pimpleDyMFoam/propeller/system/blockMeshDict
index a3e0711203427b31af900e54a610d7c7bd9313ad..e2e3a627557322719bd5f80b220665c940d209d9 100644
--- a/tutorials/incompressible/pimpleDyMFoam/propeller/system/blockMeshDict
+++ b/tutorials/incompressible/pimpleDyMFoam/propeller/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/blockMeshDict b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/blockMeshDict
index b245a81c2d641388b6742eb6ab724011544ba638..1c56ab324bc8deee45ef42e2f1b737dcae2fda0a 100644
--- a/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/blockMeshDict
+++ b/tutorials/incompressible/pimpleDyMFoam/wingMotion/wingMotion_snappyHexMesh/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/pimpleFoam/LES/channel395/system/blockMeshDict b/tutorials/incompressible/pimpleFoam/LES/channel395/system/blockMeshDict
index 7e87b0870afbc32ada6e4e7140b9af2844c5330b..f20100a529d5ab813cd0fc645924c1fa0e6bfbbe 100644
--- a/tutorials/incompressible/pimpleFoam/LES/channel395/system/blockMeshDict
+++ b/tutorials/incompressible/pimpleFoam/LES/channel395/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/pimpleFoam/LES/channel395DFSEM/system/blockMeshDict b/tutorials/incompressible/pimpleFoam/LES/channel395DFSEM/system/blockMeshDict
index 31cee0dff7a42dfb2017b420d2225633ac333a4a..1dab70a86ae5b442323b29ee3746b2867bdec414 100644
--- a/tutorials/incompressible/pimpleFoam/LES/channel395DFSEM/system/blockMeshDict
+++ b/tutorials/incompressible/pimpleFoam/LES/channel395DFSEM/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 L #calc "20*M_PI";
 H #calc "1";
diff --git a/tutorials/incompressible/pimpleFoam/LES/vortexShed/system/blockMeshDict.m4 b/tutorials/incompressible/pimpleFoam/LES/vortexShed/system/blockMeshDict.m4
index 4d8f014df8d8c7df43d3f71224058d5b7fea338d..b0997b2c9ed8b30ecf9a2a125ca8226132cc3a67 100644
--- a/tutorials/incompressible/pimpleFoam/LES/vortexShed/system/blockMeshDict.m4
+++ b/tutorials/incompressible/pimpleFoam/LES/vortexShed/system/blockMeshDict.m4
@@ -75,7 +75,7 @@ dnl> -----------------------------------------------------------------
 dnl>
 dnl>
 
-convertToMeters 0.02;
+scale   0.02;
 
 vertices
 (
diff --git a/tutorials/incompressible/pimpleFoam/RAS/TJunction/system/blockMeshDict b/tutorials/incompressible/pimpleFoam/RAS/TJunction/system/blockMeshDict
index 60af047d0414ddbcd35b7dc40819d9a3192b6ff6..7c9012bc920021b45c7307c3bbf020e9acfa2885 100644
--- a/tutorials/incompressible/pimpleFoam/RAS/TJunction/system/blockMeshDict
+++ b/tutorials/incompressible/pimpleFoam/RAS/TJunction/system/blockMeshDict
@@ -30,7 +30,7 @@ FoamFile
 //             +-+
 //           outlet2
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/system/blockMeshDict b/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/system/blockMeshDict
index de2d4268be4b1101a39f0462c3f122d3eb94e234..ab120702e18738b2d8a3838fe2b62b96fed138c8 100644
--- a/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/system/blockMeshDict
+++ b/tutorials/incompressible/pimpleFoam/RAS/TJunctionFan/system/blockMeshDict
@@ -30,7 +30,7 @@ FoamFile
 //             +-+
 //           outlet2
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/pimpleFoam/RAS/elipsekkLOmega/system/blockMeshDict b/tutorials/incompressible/pimpleFoam/RAS/elipsekkLOmega/system/blockMeshDict
index 48381779c2611cb5be862d0769e6cb1d8d14664a..6c801da10e94263392a3bce6a0afc1721e71d019 100644
--- a/tutorials/incompressible/pimpleFoam/RAS/elipsekkLOmega/system/blockMeshDict
+++ b/tutorials/incompressible/pimpleFoam/RAS/elipsekkLOmega/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/incompressible/pimpleFoam/RAS/pitzDaily/system/blockMeshDict b/tutorials/incompressible/pimpleFoam/RAS/pitzDaily/system/blockMeshDict
index d56a5091ae9d7007bfc68a10d69b1274096ade93..66b270d144197ccfbbfee5c1570e87e1a776837c 100644
--- a/tutorials/incompressible/pimpleFoam/RAS/pitzDaily/system/blockMeshDict
+++ b/tutorials/incompressible/pimpleFoam/RAS/pitzDaily/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/incompressible/pimpleFoam/laminar/planarContraction/system/blockMeshDict b/tutorials/incompressible/pimpleFoam/laminar/planarContraction/system/blockMeshDict
index 882d1786cb679697e8f00611f948cd90f31b19dc..2421266f80e51c92984e2ae4ef4de668cf60d7bf 100644
--- a/tutorials/incompressible/pimpleFoam/laminar/planarContraction/system/blockMeshDict
+++ b/tutorials/incompressible/pimpleFoam/laminar/planarContraction/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.0032;
+scale   0.0032;
 
 vertices
 (
diff --git a/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/system/blockMeshDict b/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/system/blockMeshDict
index 08f4f15c7bcd824ed0f12a5332f737df051a340e..75742d637533d918dafea9c08c62002658366441 100644
--- a/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/system/blockMeshDict
+++ b/tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/blockMeshDict b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/blockMeshDict
index 5303da9235cce4723d125110e7bfc38fde8ede74..b5569940209ae82315d57bb5a774b37ae796df6f 100644
--- a/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/blockMeshDict
+++ b/tutorials/incompressible/pisoFoam/LES/motorBike/motorBike/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/pisoFoam/LES/pitzDaily/system/blockMeshDict b/tutorials/incompressible/pisoFoam/LES/pitzDaily/system/blockMeshDict
index d56a5091ae9d7007bfc68a10d69b1274096ade93..66b270d144197ccfbbfee5c1570e87e1a776837c 100644
--- a/tutorials/incompressible/pisoFoam/LES/pitzDaily/system/blockMeshDict
+++ b/tutorials/incompressible/pisoFoam/LES/pitzDaily/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/incompressible/pisoFoam/LES/pitzDailyMapped/system/blockMeshDict b/tutorials/incompressible/pisoFoam/LES/pitzDailyMapped/system/blockMeshDict
index 5b5a606d92c3d21e11b600aa870220eab9319e6d..ac4f7fdaac4d092d33507cb8da1982a045db1608 100644
--- a/tutorials/incompressible/pisoFoam/LES/pitzDailyMapped/system/blockMeshDict
+++ b/tutorials/incompressible/pisoFoam/LES/pitzDailyMapped/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/incompressible/pisoFoam/RAS/cavity/system/blockMeshDict b/tutorials/incompressible/pisoFoam/RAS/cavity/system/blockMeshDict
index 5f58428dd6957756f1e7d66e8d9a31e95ad07e8c..6c09069cce78a74eb7a1f40bb1e2350e46a2d75d 100644
--- a/tutorials/incompressible/pisoFoam/RAS/cavity/system/blockMeshDict
+++ b/tutorials/incompressible/pisoFoam/RAS/cavity/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/incompressible/pisoFoam/RAS/cavityCoupledU/system/blockMeshDict b/tutorials/incompressible/pisoFoam/RAS/cavityCoupledU/system/blockMeshDict
index 5f58428dd6957756f1e7d66e8d9a31e95ad07e8c..6c09069cce78a74eb7a1f40bb1e2350e46a2d75d 100644
--- a/tutorials/incompressible/pisoFoam/RAS/cavityCoupledU/system/blockMeshDict
+++ b/tutorials/incompressible/pisoFoam/RAS/cavityCoupledU/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/blockMeshDict b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/blockMeshDict
index b597b2ba1adcb42dcc0b832c28c951353ba47eb1..24d2183215ffcb676b043da662f34725e5edf1c3 100644
--- a/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/blockMeshDict
+++ b/tutorials/incompressible/pisoFoam/laminar/porousBlockage/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuct/common/blockMeshDict.m4 b/tutorials/incompressible/porousSimpleFoam/angledDuct/common/blockMeshDict.m4
index c00bb933d47874af3198ccac4c7c97781a6cf6a8..fe2b1b84385eeb2a485a07aa56e561dacb8872d7 100644
--- a/tutorials/incompressible/porousSimpleFoam/angledDuct/common/blockMeshDict.m4
+++ b/tutorials/incompressible/porousSimpleFoam/angledDuct/common/blockMeshDict.m4
@@ -59,7 +59,7 @@ define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl>
 define(youtlet,calc(yporo + Sin*lenoutlet)) dnl>
 dnl>
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/incompressible/shallowWaterFoam/squareBump/system/blockMeshDict b/tutorials/incompressible/shallowWaterFoam/squareBump/system/blockMeshDict
index 4ec56a18cb159503a9af7390680d5c53703a1834..224e45bd17e7dc3d3e6a800a3a668db6018899f6 100644
--- a/tutorials/incompressible/shallowWaterFoam/squareBump/system/blockMeshDict
+++ b/tutorials/incompressible/shallowWaterFoam/squareBump/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/simpleFoam/T3A/system/blockMeshDict b/tutorials/incompressible/simpleFoam/T3A/system/blockMeshDict
index 168b125e1bd1f509c6469cb369a0f84afe4fd99f..ecd244898b7d802913917525bf59939dd309be0b 100644
--- a/tutorials/incompressible/simpleFoam/T3A/system/blockMeshDict
+++ b/tutorials/incompressible/simpleFoam/T3A/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/simpleFoam/mixerVessel2D/system/blockMeshDict.m4 b/tutorials/incompressible/simpleFoam/mixerVessel2D/system/blockMeshDict.m4
index 7af575645872d1c69eb34d26b1b79d305805dd12..a1aca5ab529ec7af115066707ddfc5a67b939b22 100644
--- a/tutorials/incompressible/simpleFoam/mixerVessel2D/system/blockMeshDict.m4
+++ b/tutorials/incompressible/simpleFoam/mixerVessel2D/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, ($1b $4b $3b $2b))
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 // Hub radius
 define(r, 0.2)
diff --git a/tutorials/incompressible/simpleFoam/motorBike/constant/transportProperties b/tutorials/incompressible/simpleFoam/motorBike/constant/transportProperties
index 778c5383eef65cdc5c47e951c5a255181b09b317..c4e6700e33209b565645cb3d82471d590265a4b9 100644
--- a/tutorials/incompressible/simpleFoam/motorBike/constant/transportProperties
+++ b/tutorials/incompressible/simpleFoam/motorBike/constant/transportProperties
@@ -16,6 +16,6 @@ FoamFile
 
 transportModel  Newtonian;
 
-nu              .5e-05;
+nu              1.5e-05;
 
 // ************************************************************************* //
diff --git a/tutorials/incompressible/simpleFoam/motorBike/system/blockMeshDict b/tutorials/incompressible/simpleFoam/motorBike/system/blockMeshDict
index 021d051c59318779b57f2d5c3d530f7a625bbf29..c9ab3e03420404b82b682fb9261ed348f15439f5 100644
--- a/tutorials/incompressible/simpleFoam/motorBike/system/blockMeshDict
+++ b/tutorials/incompressible/simpleFoam/motorBike/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/simpleFoam/pipeCyclic/system/blockMeshDict b/tutorials/incompressible/simpleFoam/pipeCyclic/system/blockMeshDict
index 527f9fa8bd7406176953f5f1664a3f88283c44b8..5a6703351978a76dc106f9a1709c2bd1d343dbe9 100644
--- a/tutorials/incompressible/simpleFoam/pipeCyclic/system/blockMeshDict
+++ b/tutorials/incompressible/simpleFoam/pipeCyclic/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 //- Half angle of wedge in degrees
 halfAngle 45.0;
diff --git a/tutorials/incompressible/simpleFoam/pitzDaily/system/blockMeshDict b/tutorials/incompressible/simpleFoam/pitzDaily/system/blockMeshDict
index d56a5091ae9d7007bfc68a10d69b1274096ade93..66b270d144197ccfbbfee5c1570e87e1a776837c 100644
--- a/tutorials/incompressible/simpleFoam/pitzDaily/system/blockMeshDict
+++ b/tutorials/incompressible/simpleFoam/pitzDaily/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/system/blockMeshDict b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/system/blockMeshDict
index d56a5091ae9d7007bfc68a10d69b1274096ade93..66b270d144197ccfbbfee5c1570e87e1a776837c 100644
--- a/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/system/blockMeshDict
+++ b/tutorials/incompressible/simpleFoam/pitzDailyExptInlet/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/incompressible/simpleFoam/rotorDisk/system/blockMeshDict b/tutorials/incompressible/simpleFoam/rotorDisk/system/blockMeshDict
index e4ba7976824c680313825c05aa7c980606b826d1..cde1418c230788fc4c05dd827090cc9ad5503494 100644
--- a/tutorials/incompressible/simpleFoam/rotorDisk/system/blockMeshDict
+++ b/tutorials/incompressible/simpleFoam/rotorDisk/system/blockMeshDict
@@ -27,7 +27,7 @@ backgroundMesh
     zCells    12;
 }
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/simpleFoam/simpleCar/system/blockMeshDict b/tutorials/incompressible/simpleFoam/simpleCar/system/blockMeshDict
index 17ca024daacfb04d507a97dc6a6d1122140163d5..0513d80251d6ba2e7510754a1b6e4abd72423e18 100644
--- a/tutorials/incompressible/simpleFoam/simpleCar/system/blockMeshDict
+++ b/tutorials/incompressible/simpleFoam/simpleCar/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/simpleFoam/turbineSiting/system/blockMeshDict b/tutorials/incompressible/simpleFoam/turbineSiting/system/blockMeshDict
index 46f7aeb84b5a796e9ad1753b7f8e5f6bcdfe2cc7..20c97a3db23d269e6afd78877a16609f40d9c103 100644
--- a/tutorials/incompressible/simpleFoam/turbineSiting/system/blockMeshDict
+++ b/tutorials/incompressible/simpleFoam/turbineSiting/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/incompressible/simpleFoam/windAroundBuildings/system/blockMeshDict b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/blockMeshDict
index 7f4b135e82a93ccae7d71409b2e31b9cda670e04..f37e8836895bdc53d6bddb12d261e2be3671610d 100644
--- a/tutorials/incompressible/simpleFoam/windAroundBuildings/system/blockMeshDict
+++ b/tutorials/incompressible/simpleFoam/windAroundBuildings/system/blockMeshDict
@@ -27,7 +27,7 @@ backgroundMesh
     zCells  10;
 }
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/lagrangian/DPMFoam/Goldschmidt/system/blockMeshDict b/tutorials/lagrangian/DPMFoam/Goldschmidt/system/blockMeshDict
index 34e1e95b1d9e41b024ae832e9d3620c0862b8f06..3217abcd22854fadf34a70765be1f1e16495e2f9 100644
--- a/tutorials/lagrangian/DPMFoam/Goldschmidt/system/blockMeshDict
+++ b/tutorials/lagrangian/DPMFoam/Goldschmidt/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/lagrangian/MPPICFoam/Goldschmidt/system/blockMeshDict b/tutorials/lagrangian/MPPICFoam/Goldschmidt/system/blockMeshDict
index b4af0b64a7e4a66a91af80ff36b186f2b74f165b..78286f84eef10755760c5375fc0ff2e4f674203e 100644
--- a/tutorials/lagrangian/MPPICFoam/Goldschmidt/system/blockMeshDict
+++ b/tutorials/lagrangian/MPPICFoam/Goldschmidt/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/lagrangian/MPPICFoam/column/system/blockMeshDict b/tutorials/lagrangian/MPPICFoam/column/system/blockMeshDict
index a9f85df5c0bc54ae1dca7554a46b92772dd86dbb..fdaa18b90fbf6154fe4f0beb23081d6761f279b1 100644
--- a/tutorials/lagrangian/MPPICFoam/column/system/blockMeshDict
+++ b/tutorials/lagrangian/MPPICFoam/column/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/lagrangian/MPPICFoam/cyclone/system/blockMeshDict b/tutorials/lagrangian/MPPICFoam/cyclone/system/blockMeshDict
index fb37fb568f3186069fea724b296a7b254559e76b..8bced1f9c9456bfd71438058783ea995b8e7c25e 100644
--- a/tutorials/lagrangian/MPPICFoam/cyclone/system/blockMeshDict
+++ b/tutorials/lagrangian/MPPICFoam/cyclone/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/lagrangian/MPPICFoam/injectionChannel/system/blockMeshDict b/tutorials/lagrangian/MPPICFoam/injectionChannel/system/blockMeshDict
index 75a13cc196ca292753269c8ba78c4576d91a4063..006d43cbf7c90c342d8b73bc4b802283ed8fa964 100644
--- a/tutorials/lagrangian/MPPICFoam/injectionChannel/system/blockMeshDict
+++ b/tutorials/lagrangian/MPPICFoam/injectionChannel/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.01;
+scale   0.01;
 
 vertices
 (
diff --git a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/blockMeshDict b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/blockMeshDict
index 7b69996ad7aa67169f234572c34b0bdafeb72680..693c2aea3cf4e38351c5c8a3e42778f07a489888 100644
--- a/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/blockMeshDict
+++ b/tutorials/lagrangian/coalChemistryFoam/simplifiedSiwek/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1.0;
+scale   1.0;
 
 vertices
 (
diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperEmptying/system/blockMeshDict b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperEmptying/system/blockMeshDict
index e3566a4e03ac9dc271e234ee4d424decd07fe1fc..d902868af587c599b77204b6af022324ab035612 100644
--- a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperEmptying/system/blockMeshDict
+++ b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperEmptying/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperInitialState/system/blockMeshDict b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperInitialState/system/blockMeshDict
index f67edf5308bf4adb700b0d3b71402b5893aedfc3..01cedf06cae3285eff44d3fa12e7f3c54c283601 100644
--- a/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperInitialState/system/blockMeshDict
+++ b/tutorials/lagrangian/icoUncoupledKinematicParcelFoam/hopper/hopperInitialState/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/system/blockMeshDict b/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/system/blockMeshDict
index 6ac91846de0643cabb4ef298bbc1fc3bd81d5942..9d5c5d8fc0632303d63db8e033db7173828d4cca 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/system/blockMeshDict
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/cylinder/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/system/blockMeshDict b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/system/blockMeshDict
index 2a949d99b6c2bed439ec517d45203b6d8d1410d1..85a622e9e53ee55cf4b2485890cd9c4f3698a3e7 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/system/blockMeshDict
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/hotBoxes/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/rivuletPanel/system/blockMeshDict b/tutorials/lagrangian/reactingParcelFilmFoam/rivuletPanel/system/blockMeshDict
index 93874ad1ebe568558d4eafac2b3064dc2d9636f7..9dfd42dd9da6aa4d5b497ea8877f90a17b3d58c6 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/rivuletPanel/system/blockMeshDict
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/rivuletPanel/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/system/blockMeshDict b/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/system/blockMeshDict
index 6a921ba8ed357f80fc084f20cf998db25d94f20c..6aa6b55c052bf61d3f5655333560d87e4f516155 100644
--- a/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/system/blockMeshDict
+++ b/tutorials/lagrangian/reactingParcelFilmFoam/splashPanel/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/lagrangian/reactingParcelFoam/counterFlowFlame2DLTS/system/blockMeshDict b/tutorials/lagrangian/reactingParcelFoam/counterFlowFlame2DLTS/system/blockMeshDict
index f0f06a591bcdb4a0797ba7a4ed8ab06e189d8154..915d5eea8148c6d1ab4a2825e408bb44bee4d728 100644
--- a/tutorials/lagrangian/reactingParcelFoam/counterFlowFlame2DLTS/system/blockMeshDict
+++ b/tutorials/lagrangian/reactingParcelFoam/counterFlowFlame2DLTS/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/lagrangian/reactingParcelFoam/filter/system/blockMeshDict b/tutorials/lagrangian/reactingParcelFoam/filter/system/blockMeshDict
index 2b6253f16c418577926f937d01efbad7a3ef432b..084681086c6d77a4bd18d90e5ba8900aef3a3728 100644
--- a/tutorials/lagrangian/reactingParcelFoam/filter/system/blockMeshDict
+++ b/tutorials/lagrangian/reactingParcelFoam/filter/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/lagrangian/reactingParcelFoam/parcelInBox/system/blockMeshDict b/tutorials/lagrangian/reactingParcelFoam/parcelInBox/system/blockMeshDict
index 710e4c496cc66018792935a078ae2fa8c89a6519..cbec044ccaeb77cc956a64abbb1bfee0d0fdd1ac 100644
--- a/tutorials/lagrangian/reactingParcelFoam/parcelInBox/system/blockMeshDict
+++ b/tutorials/lagrangian/reactingParcelFoam/parcelInBox/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/system/blockMeshDict b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/system/blockMeshDict
index 36453e30f6483a62fe459e28c4a5a5718a0d30ad..3dfa7726062012100a0b8bed305c754f1ca6fff7 100644
--- a/tutorials/lagrangian/reactingParcelFoam/verticalChannel/system/blockMeshDict
+++ b/tutorials/lagrangian/reactingParcelFoam/verticalChannel/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/system/blockMeshDict b/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/system/blockMeshDict
index 36453e30f6483a62fe459e28c4a5a5718a0d30ad..3dfa7726062012100a0b8bed305c754f1ca6fff7 100644
--- a/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/system/blockMeshDict
+++ b/tutorials/lagrangian/reactingParcelFoam/verticalChannelLTS/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/system/blockMeshDict b/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/system/blockMeshDict
index 36453e30f6483a62fe459e28c4a5a5718a0d30ad..3dfa7726062012100a0b8bed305c754f1ca6fff7 100644
--- a/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/system/blockMeshDict
+++ b/tutorials/lagrangian/simpleReactingParcelFoam/verticalChannel/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/lagrangian/sprayFoam/aachenBomb/system/blockMeshDict b/tutorials/lagrangian/sprayFoam/aachenBomb/system/blockMeshDict
index a0f1323ad0a21eaea0cf345aa4fd1748118cfa19..b58b8e7af90e26cde1798c5b5bdd4048a156261b 100644
--- a/tutorials/lagrangian/sprayFoam/aachenBomb/system/blockMeshDict
+++ b/tutorials/lagrangian/sprayFoam/aachenBomb/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/mesh/foamyHexMesh/blob/system/backgroundMeshDecomposition/blockMeshDict b/tutorials/mesh/foamyHexMesh/blob/system/backgroundMeshDecomposition/blockMeshDict
index a6ffcd2498172b10d395d8121280818ea8514902..a9ddd79ed770a354adb6e5f5fd4268e326eb47fa 100644
--- a/tutorials/mesh/foamyHexMesh/blob/system/backgroundMeshDecomposition/blockMeshDict
+++ b/tutorials/mesh/foamyHexMesh/blob/system/backgroundMeshDecomposition/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1.0;
+scale   1.0;
 
 xmin -1.3;
 xmax  0.65;
diff --git a/tutorials/mesh/foamyHexMesh/flange/system/backgroundMeshDecomposition/blockMeshDict b/tutorials/mesh/foamyHexMesh/flange/system/backgroundMeshDecomposition/blockMeshDict
index 45dde47b29e85b8a9cbd357f09ebed8c99e5871a..8981b0d0dcb06209b3eacace7ea0ddd4e3a5ee37 100644
--- a/tutorials/mesh/foamyHexMesh/flange/system/backgroundMeshDecomposition/blockMeshDict
+++ b/tutorials/mesh/foamyHexMesh/flange/system/backgroundMeshDecomposition/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1.0;
+scale   1.0;
 
 xmin -0.0265;
 xmax  0.0265;
diff --git a/tutorials/mesh/foamyHexMesh/mixerVessel/system/backgroundMeshDecomposition/blockMeshDict b/tutorials/mesh/foamyHexMesh/mixerVessel/system/backgroundMeshDecomposition/blockMeshDict
index 7055a5c09f374bd4d08c1819efb241d9699d46a3..38f04707eaa0e8ace4d9a4519e7beada1ca606bd 100644
--- a/tutorials/mesh/foamyHexMesh/mixerVessel/system/backgroundMeshDecomposition/blockMeshDict
+++ b/tutorials/mesh/foamyHexMesh/mixerVessel/system/backgroundMeshDecomposition/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1e-3;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/mesh/moveDynamicMesh/SnakeRiverCanyon/system/blockMeshDict b/tutorials/mesh/moveDynamicMesh/SnakeRiverCanyon/system/blockMeshDict
index b36555dd02598186ab9c21805de0abc7a7aed8d9..29d016b669c72d27dbef7a5f649e15b73e066a42 100644
--- a/tutorials/mesh/moveDynamicMesh/SnakeRiverCanyon/system/blockMeshDict
+++ b/tutorials/mesh/moveDynamicMesh/SnakeRiverCanyon/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/mesh/moveDynamicMesh/relativeMotion/box_snappyHexMesh/system/blockMeshDict b/tutorials/mesh/moveDynamicMesh/relativeMotion/box_snappyHexMesh/system/blockMeshDict
index ebf1c4532f6eea3083ec64acbc9ba694c84c613c..3348ce23a830e6c71a25b8b786e466f647e0cd1d 100644
--- a/tutorials/mesh/moveDynamicMesh/relativeMotion/box_snappyHexMesh/system/blockMeshDict
+++ b/tutorials/mesh/moveDynamicMesh/relativeMotion/box_snappyHexMesh/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/mesh/parallel/cavity/system/blockMeshDict b/tutorials/mesh/parallel/cavity/system/blockMeshDict
index 5f58428dd6957756f1e7d66e8d9a31e95ad07e8c..6c09069cce78a74eb7a1f40bb1e2350e46a2d75d 100644
--- a/tutorials/mesh/parallel/cavity/system/blockMeshDict
+++ b/tutorials/mesh/parallel/cavity/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/mesh/parallel/filter/system/blockMeshDict b/tutorials/mesh/parallel/filter/system/blockMeshDict
index 42f0d62fa9ecbdf47acf3f8a6e57d94cfd3f95a9..2492fe4655349b3f9a3aaafe436deebe3de4c6da 100644
--- a/tutorials/mesh/parallel/filter/system/blockMeshDict
+++ b/tutorials/mesh/parallel/filter/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/mesh/refineMesh/refineFieldDirs/system/blockMeshDict b/tutorials/mesh/refineMesh/refineFieldDirs/system/blockMeshDict
index 5ed3bb5e1ba5bd9c8c77772afc95ba05bb47ff6b..a7266f14e154fb5b8e07e04efdf3a6ca0f9eebc8 100644
--- a/tutorials/mesh/refineMesh/refineFieldDirs/system/blockMeshDict
+++ b/tutorials/mesh/refineMesh/refineFieldDirs/system/blockMeshDict
@@ -8,7 +8,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 /*
 
diff --git a/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/system/blockMeshDict b/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/system/blockMeshDict
index 65c08a29785453400ec6b8241e71ce21b7908f38..62c90d6c0da05212e6f9e18ac6c17174bd433f2c 100644
--- a/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/system/blockMeshDict
+++ b/tutorials/mesh/snappyHexMesh/addLayersToFaceZone/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/mesh/snappyHexMesh/flange/system/blockMeshDict b/tutorials/mesh/snappyHexMesh/flange/system/blockMeshDict
index b41f45f6f7ad960f7e0d69d02a86ec11a358832d..1b9c3d2d5c77a749c4bb8bb3eb439133243896f2 100644
--- a/tutorials/mesh/snappyHexMesh/flange/system/blockMeshDict
+++ b/tutorials/mesh/snappyHexMesh/flange/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/mesh/snappyHexMesh/gap_detection/system/blockMeshDict b/tutorials/mesh/snappyHexMesh/gap_detection/system/blockMeshDict
index 7b6d5251668773997c97de62e46a55e4c215b4ad..db9ee702e1cf89873d8c068288abfd13358eae9a 100644
--- a/tutorials/mesh/snappyHexMesh/gap_detection/system/blockMeshDict
+++ b/tutorials/mesh/snappyHexMesh/gap_detection/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/system/pachuka.m4 b/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/system/pachuka.m4
index b817fb48d749305f436d1ea92b0613e646e3433f..c5e336a674765a187b4316985553cf3994499224 100644
--- a/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/system/pachuka.m4
+++ b/tutorials/multiphase/MPPICInterFoam/twoPhasePachuka/system/pachuka.m4
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.001;
+scale   0.001;
 
 changecom(//)changequote([,])
 define(calc, [esyscmd(perl -e 'printf ($1)')])
diff --git a/tutorials/multiphase/cavitatingFoam/LES/throttle/system/blockMeshDict b/tutorials/multiphase/cavitatingFoam/LES/throttle/system/blockMeshDict
index 9e94de60f25721820046d4f3a56c9e4793f4cbd1..6ef6c450b943209d34a647e56b93de195e886e2d 100644
--- a/tutorials/multiphase/cavitatingFoam/LES/throttle/system/blockMeshDict
+++ b/tutorials/multiphase/cavitatingFoam/LES/throttle/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1.0e-3;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/multiphase/cavitatingFoam/LES/throttle3D/system/blockMeshDict b/tutorials/multiphase/cavitatingFoam/LES/throttle3D/system/blockMeshDict
index 72aabf53a4df492415340523ccaffea346c9b4fb..2db074a07943680d8df8f9742727dce8992d9bdd 100644
--- a/tutorials/multiphase/cavitatingFoam/LES/throttle3D/system/blockMeshDict
+++ b/tutorials/multiphase/cavitatingFoam/LES/throttle3D/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1.0e-3;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/multiphase/cavitatingFoam/RAS/throttle/system/blockMeshDict b/tutorials/multiphase/cavitatingFoam/RAS/throttle/system/blockMeshDict
index 9e94de60f25721820046d4f3a56c9e4793f4cbd1..6ef6c450b943209d34a647e56b93de195e886e2d 100644
--- a/tutorials/multiphase/cavitatingFoam/RAS/throttle/system/blockMeshDict
+++ b/tutorials/multiphase/cavitatingFoam/RAS/throttle/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1.0e-3;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sloshingTank2D/system/blockMeshDict.m4 b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sloshingTank2D/system/blockMeshDict.m4
index cc8f7c321263d08fd1ec39f2e7f0fbe108ae53b6..5c7856f1d2d132a4a7c57ead203d2ebe7ae03151 100644
--- a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sloshingTank2D/system/blockMeshDict.m4
+++ b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sloshingTank2D/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, (b$1 b$4 b$3 b$2))
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 // User-defined parameters
 
-convertToMeters 1;
+scale   1;
 
 define(l, 1.0)      // Length of tank (x-direction)
 define(b, 40)       // Breadth of tank (y-direction)
diff --git a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/system/blockMeshDict b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/system/blockMeshDict
index c2962ef4fe3c8fd423311bf1ded2d89b58e2f720..40f967585ac4f490c6547b308da8aedf7f16ced6 100644
--- a/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/system/blockMeshDict
+++ b/tutorials/multiphase/compressibleInterDyMFoam/laminar/sphereDrop/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 // Domain
 axisLevel               0.0;  // x-coord of axis (right boundary of domain)
diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/blockMeshDict b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/blockMeshDict
index eb62f4d3fa115217910b5fc214c1d601b827d088..9cd145e17424d2ce53c8521bd4b8772adde32c95 100644
--- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/blockMeshDict
+++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge2D/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/blockMeshDict b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/blockMeshDict
index 7b769fb5e33281306e6da43c7a3096d3d35c5f53..4d071f43a159aac89cfc6c67aebbb2ff9110af78 100644
--- a/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/blockMeshDict
+++ b/tutorials/multiphase/compressibleInterFoam/laminar/depthCharge3D/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/system/blockMeshDict b/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/system/blockMeshDict
index 9f1f917cbc0c91145ba92fefa3640e97e2c1e5ee..6832e4c2e281a3a1c27adaa522e841bb185942fe 100644
--- a/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/system/blockMeshDict
+++ b/tutorials/multiphase/compressibleMultiphaseInterFoam/laminar/damBreak4phase/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.146;
+scale   0.146;
 
 vertices
 (
diff --git a/tutorials/multiphase/driftFluxFoam/RAS/dahl/system/blockMeshDict b/tutorials/multiphase/driftFluxFoam/RAS/dahl/system/blockMeshDict
index f7d181567e723243bc999713ef1413e0c9e85b4d..d252f8d2974890bd410dd5ec050d4712867a5378 100644
--- a/tutorials/multiphase/driftFluxFoam/RAS/dahl/system/blockMeshDict
+++ b/tutorials/multiphase/driftFluxFoam/RAS/dahl/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/system/blockMeshDict.m4 b/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/system/blockMeshDict.m4
index 7af575645872d1c69eb34d26b1b79d305805dd12..a1aca5ab529ec7af115066707ddfc5a67b939b22 100644
--- a/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/system/blockMeshDict.m4
+++ b/tutorials/multiphase/driftFluxFoam/RAS/mixerVessel2D/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, ($1b $4b $3b $2b))
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 // Hub radius
 define(r, 0.2)
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/T b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/T
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/T
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/T
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/U b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/U
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/U
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/U
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/alpha.liquid b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/alpha.liquid
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/alpha.liquid
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/alpha.liquid
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/epsilon b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/epsilon
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/epsilon
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/epsilon
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/k b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/k
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/k
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/k
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/nut b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/nut
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/nut
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/nut
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/omega b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/omega
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/omega
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/omega
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/p b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/p
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/p
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/p
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/p_rgh b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/p_rgh
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/0/p_rgh
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/0/p_rgh
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/Allclean b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/Allclean
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/Allclean
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/Allclean
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/Allrun b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/Allrun
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/Allrun
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/Allrun
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/constant/g b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/g
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/constant/g
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/g
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/constant/phaseChangeProperties b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/phaseChangeProperties
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/constant/phaseChangeProperties
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/phaseChangeProperties
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/constant/thermophysicalProperties b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/thermophysicalProperties
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/constant/thermophysicalProperties
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/thermophysicalProperties
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/constant/transportProperties b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/transportProperties
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/constant/transportProperties
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/transportProperties
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/constant/turbulenceProperties b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/turbulenceProperties
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/constant/turbulenceProperties
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/constant/turbulenceProperties
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/system/blockMeshDict b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/blockMeshDict
similarity index 98%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/system/blockMeshDict
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/blockMeshDict
index 85ac05af58eb384c792e3116c79cdb855309abd8..8c69aa89b3e69890889045d9cdf7a2d51c168366 100644
--- a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/system/blockMeshDict
+++ b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1e-2;
+scale   0.01;
 
 vertices
 (
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/system/controlDict b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/controlDict
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/system/controlDict
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/controlDict
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/system/fvSchemes b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/fvSchemes
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/system/fvSchemes
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/fvSchemes
diff --git a/tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/system/fvSolution b/tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/fvSolution
similarity index 100%
rename from tutorials/multiphase/interCondensingEvaporatingFoam/condensatingVessel/system/fvSolution
rename to tutorials/multiphase/interCondensatingEvaporatingFoam/condensatingVessel/system/fvSolution
diff --git a/tutorials/multiphase/interDyMFoam/RAS/DTCHull/system/blockMeshDict b/tutorials/multiphase/interDyMFoam/RAS/DTCHull/system/blockMeshDict
index 7e657f4defab7da183fba0428df581d93359aba4..d2b4d7966430a438166b52fc67989c0a61c61bc2 100644
--- a/tutorials/multiphase/interDyMFoam/RAS/DTCHull/system/blockMeshDict
+++ b/tutorials/multiphase/interDyMFoam/RAS/DTCHull/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/interDyMFoam/RAS/floatingObject/system/blockMeshDict b/tutorials/multiphase/interDyMFoam/RAS/floatingObject/system/blockMeshDict
index eae1148ab00c7aea3829d7641e7529917720d590..fa80ac98d93bccb559b85b8e37db71e4818ed966 100644
--- a/tutorials/multiphase/interDyMFoam/RAS/floatingObject/system/blockMeshDict
+++ b/tutorials/multiphase/interDyMFoam/RAS/floatingObject/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/interDyMFoam/RAS/mixerVesselAMI/system/blockMeshDict b/tutorials/multiphase/interDyMFoam/RAS/mixerVesselAMI/system/blockMeshDict
index a5bb668fd883a57a559a2978635ef81372493824..65e431899c5c35467ee2decbf0c9ed43d57bd953 100644
--- a/tutorials/multiphase/interDyMFoam/RAS/mixerVesselAMI/system/blockMeshDict
+++ b/tutorials/multiphase/interDyMFoam/RAS/mixerVesselAMI/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/interDyMFoam/RAS/motorBike/system/blockMeshDict b/tutorials/multiphase/interDyMFoam/RAS/motorBike/system/blockMeshDict
index 7f4d16f68ce1e5154943abec94ba8fca7823108d..48edf89c731f27152d1f905b6b2726f19bd9f5c0 100644
--- a/tutorials/multiphase/interDyMFoam/RAS/motorBike/system/blockMeshDict
+++ b/tutorials/multiphase/interDyMFoam/RAS/motorBike/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/interDyMFoam/laminar/damBreakWithObstacle/system/blockMeshDict b/tutorials/multiphase/interDyMFoam/laminar/damBreakWithObstacle/system/blockMeshDict
index 51081db37fb481518a4552f9a76da0e1d92cf1f9..84d4c93304118c540157cafa0856c7e7f3a72cca 100644
--- a/tutorials/multiphase/interDyMFoam/laminar/damBreakWithObstacle/system/blockMeshDict
+++ b/tutorials/multiphase/interDyMFoam/laminar/damBreakWithObstacle/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D/system/blockMeshDict.m4 b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D/system/blockMeshDict.m4
index cc8f7c321263d08fd1ec39f2e7f0fbe108ae53b6..5c7856f1d2d132a4a7c57ead203d2ebe7ae03151 100644
--- a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D/system/blockMeshDict.m4
+++ b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, (b$1 b$4 b$3 b$2))
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 // User-defined parameters
 
-convertToMeters 1;
+scale   1;
 
 define(l, 1.0)      // Length of tank (x-direction)
 define(b, 40)       // Breadth of tank (y-direction)
diff --git a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D3DoF/system/blockMeshDict.m4 b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D3DoF/system/blockMeshDict.m4
index cc8f7c321263d08fd1ec39f2e7f0fbe108ae53b6..5c7856f1d2d132a4a7c57ead203d2ebe7ae03151 100644
--- a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D3DoF/system/blockMeshDict.m4
+++ b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank2D3DoF/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, (b$1 b$4 b$3 b$2))
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 // User-defined parameters
 
-convertToMeters 1;
+scale   1;
 
 define(l, 1.0)      // Length of tank (x-direction)
 define(b, 40)       // Breadth of tank (y-direction)
diff --git a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D/system/blockMeshDict.m4 b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D/system/blockMeshDict.m4
index 30dc9f4ad692e226f35e43606b6dfafaed64befd..2be0030239f561bb1e5e5b3c3a49880974e2b1f1 100644
--- a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D/system/blockMeshDict.m4
+++ b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, (b$1 b$4 b$3 b$2))
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 // User-defined parameters
 
-convertToMeters 1;
+scale   1;
 
 define(l, 20)       // Length of tank (x-direction)
 define(b, 40)       // Breadth of tank (y-direction)
diff --git a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D3DoF/system/blockMeshDict.m4 b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D3DoF/system/blockMeshDict.m4
index 30dc9f4ad692e226f35e43606b6dfafaed64befd..2be0030239f561bb1e5e5b3c3a49880974e2b1f1 100644
--- a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D3DoF/system/blockMeshDict.m4
+++ b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D3DoF/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, (b$1 b$4 b$3 b$2))
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 // User-defined parameters
 
-convertToMeters 1;
+scale   1;
 
 define(l, 20)       // Length of tank (x-direction)
 define(b, 40)       // Breadth of tank (y-direction)
diff --git a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D6DoF/system/blockMeshDict.m4 b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D6DoF/system/blockMeshDict.m4
index 30dc9f4ad692e226f35e43606b6dfafaed64befd..2be0030239f561bb1e5e5b3c3a49880974e2b1f1 100644
--- a/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D6DoF/system/blockMeshDict.m4
+++ b/tutorials/multiphase/interDyMFoam/laminar/sloshingTank3D6DoF/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, (b$1 b$4 b$3 b$2))
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 // User-defined parameters
 
-convertToMeters 1;
+scale   1;
 
 define(l, 20)       // Length of tank (x-direction)
 define(b, 40)       // Breadth of tank (y-direction)
diff --git a/tutorials/multiphase/interDyMFoam/laminar/testTubeMixer/system/blockMeshDict b/tutorials/multiphase/interDyMFoam/laminar/testTubeMixer/system/blockMeshDict
index cff87d9a1a92998cf95704ada21dbd552929847b..0dadea9348d1efbd8a527766821ddd1ce96118c0 100644
--- a/tutorials/multiphase/interDyMFoam/laminar/testTubeMixer/system/blockMeshDict
+++ b/tutorials/multiphase/interDyMFoam/laminar/testTubeMixer/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.01;
+scale   0.01;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/LES/nozzleFlow2D/system/blockMeshDict b/tutorials/multiphase/interFoam/LES/nozzleFlow2D/system/blockMeshDict
index 220d1d4184b87a73622d2a81fa3b8ab85b468889..18dad0479ea04650e263a342e181e55a2e318a59 100644
--- a/tutorials/multiphase/interFoam/LES/nozzleFlow2D/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/LES/nozzleFlow2D/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1e-06;
+scale   1e-6;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/RAS/DTCHull/system/blockMeshDict b/tutorials/multiphase/interFoam/RAS/DTCHull/system/blockMeshDict
index 7e657f4defab7da183fba0428df581d93359aba4..d2b4d7966430a438166b52fc67989c0a61c61bc2 100644
--- a/tutorials/multiphase/interFoam/RAS/DTCHull/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/RAS/DTCHull/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/RAS/angledDuct/system/blockMeshDict.m4 b/tutorials/multiphase/interFoam/RAS/angledDuct/system/blockMeshDict.m4
index 378e93531400cb34280e87cd24fd3fee5feb3bfd..17988e2f4429aabb0948372f36888b6186be9a30 100644
--- a/tutorials/multiphase/interFoam/RAS/angledDuct/system/blockMeshDict.m4
+++ b/tutorials/multiphase/interFoam/RAS/angledDuct/system/blockMeshDict.m4
@@ -59,7 +59,7 @@ define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl>
 define(youtlet,calc(yporo + Sin*lenoutlet)) dnl>
 dnl>
 
-convertToMeters 0.001;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/RAS/damBreak/damBreak/system/blockMeshDict b/tutorials/multiphase/interFoam/RAS/damBreak/damBreak/system/blockMeshDict
index 9f1f917cbc0c91145ba92fefa3640e97e2c1e5ee..6832e4c2e281a3a1c27adaa522e841bb185942fe 100644
--- a/tutorials/multiphase/interFoam/RAS/damBreak/damBreak/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/RAS/damBreak/damBreak/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.146;
+scale   0.146;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/system/blockMeshDict b/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/system/blockMeshDict
index 9f1f917cbc0c91145ba92fefa3640e97e2c1e5ee..6832e4c2e281a3a1c27adaa522e841bb185942fe 100644
--- a/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/RAS/damBreakPorousBaffle/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.146;
+scale   0.146;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/RAS/waterChannel/system/blockMeshDict b/tutorials/multiphase/interFoam/RAS/waterChannel/system/blockMeshDict
index 22fa2aa1959d760ab81b0555383681324211b643..0230843d96155e30b68046beece52827b0b5cba0 100644
--- a/tutorials/multiphase/interFoam/RAS/waterChannel/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/RAS/waterChannel/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/RAS/weirOverflow/system/blockMeshDict b/tutorials/multiphase/interFoam/RAS/weirOverflow/system/blockMeshDict
index 315b5800ebdbdef0a9f24a747f0cac32417764e0..63c468701c4519d7b4749edd610a4d7d6ba881fd 100644
--- a/tutorials/multiphase/interFoam/RAS/weirOverflow/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/RAS/weirOverflow/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/laminar/capillaryRise/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/capillaryRise/system/blockMeshDict
index e30c49c574c0b716eeae70e2f2c7a1309bf1454c..7397ae69e78db8625d89f5a5ca3aa937c8f53368 100644
--- a/tutorials/multiphase/interFoam/laminar/capillaryRise/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/laminar/capillaryRise/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1e-3;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/system/blockMeshDict
index 9f1f917cbc0c91145ba92fefa3640e97e2c1e5ee..6832e4c2e281a3a1c27adaa522e841bb185942fe 100644
--- a/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/laminar/damBreak/damBreak/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.146;
+scale   0.146;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/laminar/mixerVessel2D/system/blockMeshDict.m4 b/tutorials/multiphase/interFoam/laminar/mixerVessel2D/system/blockMeshDict.m4
index 7af575645872d1c69eb34d26b1b79d305805dd12..a1aca5ab529ec7af115066707ddfc5a67b939b22 100644
--- a/tutorials/multiphase/interFoam/laminar/mixerVessel2D/system/blockMeshDict.m4
+++ b/tutorials/multiphase/interFoam/laminar/mixerVessel2D/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, ($1b $4b $3b $2b))
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 // Hub radius
 define(r, 0.2)
diff --git a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/system/blockMeshDict
index 992905dc55b8edcda37c8a0253f89935891e4e31..9ff791a89813214892bcc26cfdefd0546e6b84dc 100644
--- a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/eulerianInjection/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.05;
+scale   0.05;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianDistributionInjection/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianDistributionInjection/system/blockMeshDict
index e62bdd9b924c04bb128b06d9495cfc117675747b..6fcff1299fb77ba2ce6930e29c70f79af50e1512 100644
--- a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianDistributionInjection/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianDistributionInjection/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 3;
+scale   3;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianParticleInjection/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianParticleInjection/system/blockMeshDict
index e62bdd9b924c04bb128b06d9495cfc117675747b..6fcff1299fb77ba2ce6930e29c70f79af50e1512 100644
--- a/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianParticleInjection/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/laminar/vofToLagrangian/lagrangianParticleInjection/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 3;
+scale   3;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/laminar/waveExampleCnoidal/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/waveExampleCnoidal/system/blockMeshDict
index 3b84f93af71a9a0b0bf06f2861e9ada3fe5308c1..e3b0910d4a4bab9a2a1d56bdd0931dbe6f9db888 100644
--- a/tutorials/multiphase/interFoam/laminar/waveExampleCnoidal/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/laminar/waveExampleCnoidal/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/laminar/waveExampleSolitary/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/waveExampleSolitary/system/blockMeshDict
index 175bb83f20a1b44b6f6fcb49a72125b47f2ebef3..ab736dde07c153a5983e284383f826a5974f317b 100644
--- a/tutorials/multiphase/interFoam/laminar/waveExampleSolitary/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/laminar/waveExampleSolitary/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/laminar/waveExampleSolitaryGrimshaw/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/waveExampleSolitaryGrimshaw/system/blockMeshDict
index 6de6c2f0f23bd8ddab955398ea141fd12410e4ff..bda1aecbf1ef2baa9e400bfb1db2ee562e242fcb 100644
--- a/tutorials/multiphase/interFoam/laminar/waveExampleSolitaryGrimshaw/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/laminar/waveExampleSolitaryGrimshaw/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/laminar/waveExampleSolitaryMcCowan/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/waveExampleSolitaryMcCowan/system/blockMeshDict
index 6de6c2f0f23bd8ddab955398ea141fd12410e4ff..bda1aecbf1ef2baa9e400bfb1db2ee562e242fcb 100644
--- a/tutorials/multiphase/interFoam/laminar/waveExampleSolitaryMcCowan/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/laminar/waveExampleSolitaryMcCowan/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/laminar/waveExampleStokesI/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/waveExampleStokesI/system/blockMeshDict
index 2a16096fd603b5f81066aed5db4ad71b018d30bd..b55810062ce0ff394ba7052fc6a826cac0be5b55 100644
--- a/tutorials/multiphase/interFoam/laminar/waveExampleStokesI/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/laminar/waveExampleStokesI/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/laminar/waveExampleStokesII/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/waveExampleStokesII/system/blockMeshDict
index afdb56d1bb6308bd4fc55baa9ac95d315a2b02b3..bc4c9fae35af73fd95a00c4f87e212c5ed0b0b75 100644
--- a/tutorials/multiphase/interFoam/laminar/waveExampleStokesII/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/laminar/waveExampleStokesII/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/interFoam/laminar/waveExampleStokesV/system/blockMeshDict b/tutorials/multiphase/interFoam/laminar/waveExampleStokesV/system/blockMeshDict
index 6f5bedb3be5c14dffae1c7abd62f8f250f040973..a90c183aa7fb5dc77f9c908f0d50aff5de8a288d 100644
--- a/tutorials/multiphase/interFoam/laminar/waveExampleStokesV/system/blockMeshDict
+++ b/tutorials/multiphase/interFoam/laminar/waveExampleStokesV/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/interIsoFoam/damBreak/system/blockMeshDict b/tutorials/multiphase/interIsoFoam/damBreak/system/blockMeshDict
index 9570d8dd9c064c3b00c28335ce57fa40360bb23a..8a2c2b9e5508394bce52c908f383f8fb528e9957 100644
--- a/tutorials/multiphase/interIsoFoam/damBreak/system/blockMeshDict
+++ b/tutorials/multiphase/interIsoFoam/damBreak/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.146;
+scale   0.146;
 
 vertices
 (
diff --git a/tutorials/multiphase/interIsoFoam/discInConstantFlow/system/blockMeshDict b/tutorials/multiphase/interIsoFoam/discInConstantFlow/system/blockMeshDict
index 6cc4bbfc815d99b15c13d902a69144e5da39cfac..8a1a235e520e7c6531e3ea562d9514a1c8093689 100644
--- a/tutorials/multiphase/interIsoFoam/discInConstantFlow/system/blockMeshDict
+++ b/tutorials/multiphase/interIsoFoam/discInConstantFlow/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 L   5;
 nx  100;
diff --git a/tutorials/multiphase/interIsoFoam/discInReversedVortexFlow/system/blockMeshDict b/tutorials/multiphase/interIsoFoam/discInReversedVortexFlow/system/blockMeshDict
index 1fe949ba20f9cfe32ec09268985577a9cc13d39f..ec6668b3278537d5a8705d2fe95d35e12af12d5d 100644
--- a/tutorials/multiphase/interIsoFoam/discInReversedVortexFlow/system/blockMeshDict
+++ b/tutorials/multiphase/interIsoFoam/discInReversedVortexFlow/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 L   1;
 nx  100;
diff --git a/tutorials/multiphase/interIsoFoam/notchedDiscInSolidBodyRotation/system/blockMeshDict b/tutorials/multiphase/interIsoFoam/notchedDiscInSolidBodyRotation/system/blockMeshDict
index 1fe949ba20f9cfe32ec09268985577a9cc13d39f..ec6668b3278537d5a8705d2fe95d35e12af12d5d 100644
--- a/tutorials/multiphase/interIsoFoam/notchedDiscInSolidBodyRotation/system/blockMeshDict
+++ b/tutorials/multiphase/interIsoFoam/notchedDiscInSolidBodyRotation/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 L   1;
 nx  100;
diff --git a/tutorials/multiphase/interIsoFoam/sphereInReversedVortexFlow/system/blockMeshDict b/tutorials/multiphase/interIsoFoam/sphereInReversedVortexFlow/system/blockMeshDict
index a04acb0bb2c9fb52521c57f38602eed565e85392..ed77495fe859712ee12ae93ca797c487f25c1be8 100644
--- a/tutorials/multiphase/interIsoFoam/sphereInReversedVortexFlow/system/blockMeshDict
+++ b/tutorials/multiphase/interIsoFoam/sphereInReversedVortexFlow/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 x1 0;
 x2 1;
diff --git a/tutorials/multiphase/interIsoFoam/standingWave/system/blockMeshDict b/tutorials/multiphase/interIsoFoam/standingWave/system/blockMeshDict
index 23d0722044620e389c91579dc20aeb77c8547422..2037c3acf07d10dd2b4f4c2d016f53eed758ef2a 100644
--- a/tutorials/multiphase/interIsoFoam/standingWave/system/blockMeshDict
+++ b/tutorials/multiphase/interIsoFoam/standingWave/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 L   1;
 nx  50;
diff --git a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/blockMeshDict b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/blockMeshDict
index 9f1f917cbc0c91145ba92fefa3640e97e2c1e5ee..6832e4c2e281a3a1c27adaa522e841bb185942fe 100644
--- a/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/blockMeshDict
+++ b/tutorials/multiphase/interMixingFoam/laminar/damBreak/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.146;
+scale   0.146;
 
 vertices
 (
diff --git a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/blockMeshDict b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/blockMeshDict
index a3e0711203427b31af900e54a610d7c7bd9313ad..e2e3a627557322719bd5f80b220665c940d209d9 100644
--- a/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/blockMeshDict
+++ b/tutorials/multiphase/interPhaseChangeDyMFoam/propeller/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/blockMeshDict b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/blockMeshDict
index f7edda0945c5a99f6f5565e3e1910e5db2d83f27..39970c98c5c07feb6b6b4d3921cad2ee8563d776 100644
--- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/blockMeshDict
+++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1e-3;
+scale   0.001;
 
 vertices
 (
diff --git a/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/system/blockMeshDict b/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/system/blockMeshDict
index fbb8d6aa2d74cc627f7121fbd94bac505a4120ee..1f3d5e38e41c30c422473cce0412084d24139c7b 100644
--- a/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/system/blockMeshDict
+++ b/tutorials/multiphase/multiphaseEulerFoam/bubbleColumn/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/system/blockMeshDict b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/system/blockMeshDict
index 9f1f917cbc0c91145ba92fefa3640e97e2c1e5ee..6832e4c2e281a3a1c27adaa522e841bb185942fe 100644
--- a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/system/blockMeshDict
+++ b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phase/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.146;
+scale   0.146;
 
 vertices
 (
diff --git a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/system/blockMeshDict b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/system/blockMeshDict
index ecf1075a043875ce72ec737487f635eca55a3ddb..11c653c122ef12b7fdd4c8a4231ea8c631f92d2a 100644
--- a/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/system/blockMeshDict
+++ b/tutorials/multiphase/multiphaseEulerFoam/damBreak4phaseFine/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.146;
+scale   0.146;
 
 vertices
 (
diff --git a/tutorials/multiphase/multiphaseEulerFoam/mixerVessel2D/system/blockMeshDict.m4 b/tutorials/multiphase/multiphaseEulerFoam/mixerVessel2D/system/blockMeshDict.m4
index 7af575645872d1c69eb34d26b1b79d305805dd12..a1aca5ab529ec7af115066707ddfc5a67b939b22 100644
--- a/tutorials/multiphase/multiphaseEulerFoam/mixerVessel2D/system/blockMeshDict.m4
+++ b/tutorials/multiphase/multiphaseEulerFoam/mixerVessel2D/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, ($1b $4b $3b $2b))
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 // Hub radius
 define(r, 0.2)
diff --git a/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/system/blockMeshDict.m4 b/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/system/blockMeshDict.m4
index 30653d758b6963131c3f4cba55d920960de1c306..8a9a3ffdb1b21fb7901ef47891c2ca9df9f61684 100644
--- a/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/system/blockMeshDict.m4
+++ b/tutorials/multiphase/multiphaseInterDyMFoam/laminar/mixerVesselAMI2D/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, ($1b $4b $3b $2b))
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 // Hub radius
 define(r, 0.2)
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/blockMeshDict b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/blockMeshDict
index 9f1f917cbc0c91145ba92fefa3640e97e2c1e5ee..6832e4c2e281a3a1c27adaa522e841bb185942fe 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/blockMeshDict
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phase/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.146;
+scale   0.146;
 
 vertices
 (
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/blockMeshDict b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/blockMeshDict
index ecf1075a043875ce72ec737487f635eca55a3ddb..11c653c122ef12b7fdd4c8a4231ea8c631f92d2a 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/blockMeshDict
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/damBreak4phaseFine/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.146;
+scale   0.146;
 
 vertices
 (
diff --git a/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/system/blockMeshDict.m4 b/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/system/blockMeshDict.m4
index 7af575645872d1c69eb34d26b1b79d305805dd12..a1aca5ab529ec7af115066707ddfc5a67b939b22 100644
--- a/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/system/blockMeshDict.m4
+++ b/tutorials/multiphase/multiphaseInterFoam/laminar/mixerVessel2D/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, ($1b $4b $3b $2b))
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 // Hub radius
 define(r, 0.2)
diff --git a/tutorials/multiphase/overInterDyMFoam/floatingBody/background/system/blockMeshDict b/tutorials/multiphase/overInterDyMFoam/floatingBody/background/system/blockMeshDict
index 394b3ee01a549486e48b807db222bbdb30f9d7e9..0ff19693cefe9a069ca8332bb3518657a255c64b 100644
--- a/tutorials/multiphase/overInterDyMFoam/floatingBody/background/system/blockMeshDict
+++ b/tutorials/multiphase/overInterDyMFoam/floatingBody/background/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/overInterDyMFoam/floatingBody/floatingBody/system/blockMeshDict b/tutorials/multiphase/overInterDyMFoam/floatingBody/floatingBody/system/blockMeshDict
index dcf765a81b6ecd56304ae821bc0606ac4ad4f842..b4777064b8fecdae7f19099f651124615d498a33 100644
--- a/tutorials/multiphase/overInterDyMFoam/floatingBody/floatingBody/system/blockMeshDict
+++ b/tutorials/multiphase/overInterDyMFoam/floatingBody/floatingBody/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/blockMeshDict b/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/blockMeshDict
index 1fc2016d7de996abff2b71576f512f3444308246..da807520a52d2d855deca185b1287ae10505faa7 100644
--- a/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/blockMeshDict
+++ b/tutorials/multiphase/potentialFreeSurfaceDyMFoam/oscillatingBox/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/blockMeshDict b/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/blockMeshDict
index fde1971878a4523d647955d41ae067553c93ab9d..0139b59aa850592269147713be434b619595b242 100644
--- a/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/blockMeshDict
+++ b/tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/system/blockMeshDict b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/system/blockMeshDict
index fbb8d6aa2d74cc627f7121fbd94bac505a4120ee..1f3d5e38e41c30c422473cce0412084d24139c7b 100644
--- a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/system/blockMeshDict
+++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/bubbleColumn/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/blockMeshDict.m4 b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/blockMeshDict.m4
index 7af575645872d1c69eb34d26b1b79d305805dd12..a1aca5ab529ec7af115066707ddfc5a67b939b22 100644
--- a/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/blockMeshDict.m4
+++ b/tutorials/multiphase/reactingMultiphaseEulerFoam/laminar/mixerVessel2D/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, ($1b $4b $3b $2b))
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 // Hub radius
 define(r, 0.2)
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/LES/bubbleColumn/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/LES/bubbleColumn/system/blockMeshDict
index fbb8d6aa2d74cc627f7121fbd94bac505a4120ee..1f3d5e38e41c30c422473cce0412084d24139c7b 100644
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/LES/bubbleColumn/system/blockMeshDict
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/LES/bubbleColumn/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/blockMeshDict
index 3f72f6e6e11b783daf67222fe53d338c2c7cd4dc..b74168a2641322a6a2fde34b59bd352fff3fae70 100644
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/blockMeshDict
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/LBend/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumn/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumn/system/blockMeshDict
index fbb8d6aa2d74cc627f7121fbd94bac505a4120ee..1f3d5e38e41c30c422473cce0412084d24139c7b 100644
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumn/system/blockMeshDict
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumn/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/system/blockMeshDict
index fbb8d6aa2d74cc627f7121fbd94bac505a4120ee..1f3d5e38e41c30c422473cce0412084d24139c7b 100644
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/system/blockMeshDict
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/bubbleColumnEvaporatingReacting/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/fluidisedBed/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/fluidisedBed/system/blockMeshDict
index 7ef56f0aa6c9d248988424acc614015cc54c062a..4637618e918c5918d93399d97e9e32d14373d686 100644
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/fluidisedBed/system/blockMeshDict
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/fluidisedBed/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/system/blockMeshDict
index 3551b32f37b23e6c997f42ebaca420dde9a243fc..d88380ae1f68ad43814e5ba581f767e599ae183d 100644
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/system/blockMeshDict
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoiling/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/system/blockMeshDict
index 3551b32f37b23e6c997f42ebaca420dde9a243fc..d88380ae1f68ad43814e5ba581f767e599ae183d 100644
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/system/blockMeshDict
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/RAS/wallBoilingIATE/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/system/blockMeshDict
index fbb8d6aa2d74cc627f7121fbd94bac505a4120ee..1f3d5e38e41c30c422473cce0412084d24139c7b 100644
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/system/blockMeshDict
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumn/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/blockMeshDict
index fbb8d6aa2d74cc627f7121fbd94bac505a4120ee..1f3d5e38e41c30c422473cce0412084d24139c7b 100644
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/blockMeshDict
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporating/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/system/blockMeshDict
index fbb8d6aa2d74cc627f7121fbd94bac505a4120ee..1f3d5e38e41c30c422473cce0412084d24139c7b 100644
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/system/blockMeshDict
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnEvaporatingDissolving/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnIATE/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnIATE/system/blockMeshDict
index fbb8d6aa2d74cc627f7121fbd94bac505a4120ee..1f3d5e38e41c30c422473cce0412084d24139c7b 100644
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnIATE/system/blockMeshDict
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/bubbleColumnIATE/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/fluidisedBed/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/fluidisedBed/system/blockMeshDict
index 7ef56f0aa6c9d248988424acc614015cc54c062a..4637618e918c5918d93399d97e9e32d14373d686 100644
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/fluidisedBed/system/blockMeshDict
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/fluidisedBed/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/injection/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/injection/system/blockMeshDict
index 5e2253cab14dc1687377d4434e62706f418c05fc..95a0376e1338d66a5a5c62ab5e4cdfb6a4d59370 100644
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/injection/system/blockMeshDict
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/injection/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/system/blockMeshDict.m4 b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/system/blockMeshDict.m4
index 7af575645872d1c69eb34d26b1b79d305805dd12..a1aca5ab529ec7af115066707ddfc5a67b939b22 100644
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/system/blockMeshDict.m4
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/mixerVessel2D/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, ($1b $4b $3b $2b))
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 // Hub radius
 define(r, 0.2)
diff --git a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/blockMeshDict b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/blockMeshDict
index fbb8d6aa2d74cc627f7121fbd94bac505a4120ee..1f3d5e38e41c30c422473cce0412084d24139c7b 100644
--- a/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/blockMeshDict
+++ b/tutorials/multiphase/reactingTwoPhaseEulerFoam/laminar/steamInjection/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/blockMeshDict b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/blockMeshDict
index ef2c28fad2cc365f78cb6566f99ef44c738ab076..bc2c9518652e2dd31e4111f6cf10f15ac8cb5d2e 100644
--- a/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/blockMeshDict
+++ b/tutorials/multiphase/twoLiquidMixingFoam/lockExchange/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/system/blockMeshDict b/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/system/blockMeshDict
index fbb8d6aa2d74cc627f7121fbd94bac505a4120ee..1f3d5e38e41c30c422473cce0412084d24139c7b 100644
--- a/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/system/blockMeshDict
+++ b/tutorials/multiphase/twoPhaseEulerFoam/LES/bubbleColumn/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/system/blockMeshDict b/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/system/blockMeshDict
index fbb8d6aa2d74cc627f7121fbd94bac505a4120ee..1f3d5e38e41c30c422473cce0412084d24139c7b 100644
--- a/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/system/blockMeshDict
+++ b/tutorials/multiphase/twoPhaseEulerFoam/RAS/bubbleColumn/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/system/blockMeshDict b/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/system/blockMeshDict
index 7ef56f0aa6c9d248988424acc614015cc54c062a..4637618e918c5918d93399d97e9e32d14373d686 100644
--- a/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/system/blockMeshDict
+++ b/tutorials/multiphase/twoPhaseEulerFoam/RAS/fluidisedBed/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/system/blockMeshDict b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/system/blockMeshDict
index fbb8d6aa2d74cc627f7121fbd94bac505a4120ee..1f3d5e38e41c30c422473cce0412084d24139c7b 100644
--- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/system/blockMeshDict
+++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumn/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/system/blockMeshDict b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/system/blockMeshDict
index fbb8d6aa2d74cc627f7121fbd94bac505a4120ee..1f3d5e38e41c30c422473cce0412084d24139c7b 100644
--- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/system/blockMeshDict
+++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/bubbleColumnIATE/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/fluidisedBed/system/blockMeshDict b/tutorials/multiphase/twoPhaseEulerFoam/laminar/fluidisedBed/system/blockMeshDict
index 7ef56f0aa6c9d248988424acc614015cc54c062a..4637618e918c5918d93399d97e9e32d14373d686 100644
--- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/fluidisedBed/system/blockMeshDict
+++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/fluidisedBed/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/injection/system/blockMeshDict b/tutorials/multiphase/twoPhaseEulerFoam/laminar/injection/system/blockMeshDict
index 5e2253cab14dc1687377d4434e62706f418c05fc..95a0376e1338d66a5a5c62ab5e4cdfb6a4d59370 100644
--- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/injection/system/blockMeshDict
+++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/injection/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/system/blockMeshDict.m4 b/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/system/blockMeshDict.m4
index 7af575645872d1c69eb34d26b1b79d305805dd12..a1aca5ab529ec7af115066707ddfc5a67b939b22 100644
--- a/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/system/blockMeshDict.m4
+++ b/tutorials/multiphase/twoPhaseEulerFoam/laminar/mixerVessel2D/system/blockMeshDict.m4
@@ -28,7 +28,7 @@ define(backQuad, ($1b $4b $3b $2b))
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 // Hub radius
 define(r, 0.2)
diff --git a/tutorials/preProcessing/createZeroDirectory/cavity/system/blockMeshDict b/tutorials/preProcessing/createZeroDirectory/cavity/system/blockMeshDict
index 5f58428dd6957756f1e7d66e8d9a31e95ad07e8c..6c09069cce78a74eb7a1f40bb1e2350e46a2d75d 100644
--- a/tutorials/preProcessing/createZeroDirectory/cavity/system/blockMeshDict
+++ b/tutorials/preProcessing/createZeroDirectory/cavity/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 0.1;
+scale   0.1;
 
 vertices
 (
diff --git a/tutorials/preProcessing/createZeroDirectory/motorBike/system/blockMeshDict b/tutorials/preProcessing/createZeroDirectory/motorBike/system/blockMeshDict
index 021d051c59318779b57f2d5c3d530f7a625bbf29..c9ab3e03420404b82b682fb9261ed348f15439f5 100644
--- a/tutorials/preProcessing/createZeroDirectory/motorBike/system/blockMeshDict
+++ b/tutorials/preProcessing/createZeroDirectory/motorBike/system/blockMeshDict
@@ -15,7 +15,7 @@ FoamFile
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/system/blockMeshDict b/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/system/blockMeshDict
index a0349cb81d2eca0501774b84c259945ad233b6c6..2ba9dce030268362add167d187e275c6af67bdcb 100644
--- a/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/system/blockMeshDict
+++ b/tutorials/preProcessing/createZeroDirectory/snappyMultiRegionHeater/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/system/blockMeshDict b/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/system/blockMeshDict
index 608581fb9fa718c75c84f8a7e0075df977acaebb..f5fa560b8ecf82e196f22675723e4b4aec14e6ff 100644
--- a/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/system/blockMeshDict
+++ b/tutorials/stressAnalysis/solidDisplacementFoam/plateHole/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (
diff --git a/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/system/blockMeshDict b/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/system/blockMeshDict
index b766a2368abb7f20972b33014c6a00950e54aa4c..2c517abf2fc379e175862d3c6b8946f41d06e762 100644
--- a/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/system/blockMeshDict
+++ b/tutorials/stressAnalysis/solidEquilibriumDisplacementFoam/beamEndLoad/system/blockMeshDict
@@ -14,7 +14,7 @@ FoamFile
 }
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-convertToMeters 1;
+scale   1;
 
 vertices
 (