diff --git a/Allwmake b/Allwmake
index 035b24811b065daab40609ec071eee1eb534efdd..16edfd1f6fdac8bcedefc29b5890bfd7182017f0 100755
--- a/Allwmake
+++ b/Allwmake
@@ -8,6 +8,12 @@ wmakeCheckPwd "$WM_PROJECT_DIR" || {
     exit 1
 }
 
+[ -n "$FOAM_EXT_LIBBIN" ] || {
+    echo "Error: FOAM_EXT_LIBBIN not set"
+    echo "    Check the OpenFOAM entries in your dot-files and source them."
+    exit 1
+}
+
 # wmake is required for subsequent targets
 ( cd wmake/src && make )
 
diff --git a/applications/Allwmake b/applications/Allwmake
index 9b8bf7d803aabcdef43b55746b493625d8b67ff3..00bc326641b1ae1cab5bfec77832e161b8c79d29 100755
--- a/applications/Allwmake
+++ b/applications/Allwmake
@@ -8,6 +8,12 @@ wmakeCheckPwd "$WM_PROJECT_DIR/applications" || {
     exit 1
 }
 
+[ -n "$FOAM_EXT_LIBBIN" ] || {
+    echo "Error: FOAM_EXT_LIBBIN not set"
+    echo "    Check the OpenFOAM entries in your dot-files and source them."
+    exit 1
+}
+
 set -x
 
 wmake all utilities
diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C b/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C
index 58b39c2ec1f90ae91114a64c0657498d868f0cdd..b21e73c3e195661f2258fd0d927262a8f1304acb 100644
--- a/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C
+++ b/applications/solvers/combustion/PDRFoam/PDRModels/XiGModels/basicXiSubG/basicXiSubG.C
@@ -34,8 +34,8 @@ namespace XiGModels
 {
     defineTypeNameAndDebug(basicSubGrid, 0);
     addToRunTimeSelectionTable(XiGModel, basicSubGrid, dictionary);
-};
-};
+}
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C
index e75b6b000997ca10858b299df7f505b64b180428..33e57393abca84597903176d34d220d0580e7860 100644
--- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C
+++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/PDRDragModel/PDRDragModel.C
@@ -31,7 +31,7 @@ namespace Foam
 {
     defineTypeNameAndDebug(PDRDragModel, 0);
     defineRunTimeSelectionTable(PDRDragModel, dictionary);
-};
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C
index 533a10d656639fef21a2ce4a2f8f32cbb3967949..021824b54999f7253dbbc8685b25fa39e223f3f2 100644
--- a/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C
+++ b/applications/solvers/combustion/PDRFoam/PDRModels/dragModels/basic/basic.C
@@ -34,8 +34,8 @@ namespace PDRDragModels
 {
     defineTypeNameAndDebug(basic, 0);
     addToRunTimeSelectionTable(PDRDragModel, basic, dictionary);
-};
-};
+}
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.C
index 2a1642257bc584701fa0b488ac6f3cf61179b6f8..96abb4bcbe5ed36fcfd8d128a04194e2cf86ac15 100644
--- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.C
+++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/SCOPEBlendXiEq/SCOPEBlendXiEq.C
@@ -34,8 +34,8 @@ namespace XiEqModels
 {
     defineTypeNameAndDebug(SCOPEBlend, 0);
     addToRunTimeSelectionTable(XiEqModel, SCOPEBlend, dictionary);
-};
-};
+}
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C
index 6d7a35867a3b645cac590e1c639a399dce3bc2ea..4d137ef76dc4b5afca1d506e85b5e13084b93cd3 100644
--- a/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C
+++ b/applications/solvers/combustion/PDRFoam/XiModels/XiEqModels/XiEqModel/XiEqModel.C
@@ -31,7 +31,7 @@ namespace Foam
 {
     defineTypeNameAndDebug(XiEqModel, 0);
     defineRunTimeSelectionTable(XiEqModel, dictionary);
-};
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C
index 92189df88178585dfb7b952e21fcef61e814811a..6d5b743a0d87d24972b0a12d5d43cb23e61e64e2 100644
--- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C
+++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/XiGModel/XiGModel.C
@@ -31,7 +31,7 @@ namespace Foam
 {
     defineTypeNameAndDebug(XiGModel, 0);
     defineRunTimeSelectionTable(XiGModel, dictionary);
-};
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C
index 46182d16861cc895d45d60ec7a799382980bbc15..6b1386db598aae072582011bc3079a627d3f56bb 100644
--- a/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C
+++ b/applications/solvers/combustion/PDRFoam/XiModels/XiGModels/instabilityG/instabilityG.C
@@ -34,8 +34,8 @@ namespace XiGModels
 {
     defineTypeNameAndDebug(instabilityG, 0);
     addToRunTimeSelectionTable(XiGModel, instabilityG, dictionary);
-};
-};
+}
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.C b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.C
index 82f68ca6ba186faaba613a9ac0203fe572fe2095..8ee11fa08d8549460e5b43094da4cf61167e7dc7 100644
--- a/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.C
+++ b/applications/solvers/combustion/PDRFoam/XiModels/XiModel/XiModel.C
@@ -31,7 +31,7 @@ namespace Foam
 {
     defineTypeNameAndDebug(XiModel, 0);
     defineRunTimeSelectionTable(XiModel, dictionary);
-};
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/applications/solvers/combustion/PDRFoam/XiModels/fixed/fixed.C b/applications/solvers/combustion/PDRFoam/XiModels/fixed/fixed.C
index f689a6d3cb1d037945f3c5e650056a76588f3a08..d8568f933d8c9b87ab565dc4303d19aec88b7042 100644
--- a/applications/solvers/combustion/PDRFoam/XiModels/fixed/fixed.C
+++ b/applications/solvers/combustion/PDRFoam/XiModels/fixed/fixed.C
@@ -34,8 +34,8 @@ namespace XiModels
 {
     defineTypeNameAndDebug(fixed, 0);
     addToRunTimeSelectionTable(XiModel, fixed, dictionary);
-};
-};
+}
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/applications/solvers/combustion/fireFoam/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C b/applications/solvers/combustion/fireFoam/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C
index cd708d8dc7a40634582cf1cbaf1b57df5e9fa343..d55b91403a990ed8e3468484fe2591400d093797 100644
--- a/applications/solvers/combustion/fireFoam/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C
+++ b/applications/solvers/combustion/fireFoam/combustionModels/infinitelyFastChemistry/infinitelyFastChemistry.C
@@ -39,8 +39,8 @@ namespace combustionModels
         infinitelyFastChemistry,
         dictionary
     );
-};
-};
+}
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/applications/solvers/combustion/fireFoam/combustionModels/noCombustion/noCombustion.C b/applications/solvers/combustion/fireFoam/combustionModels/noCombustion/noCombustion.C
index 9183844ba707d31631f6e6b09478497c215c56ab..104f6940e3d55c46e27e6db84c4da8597a644570 100644
--- a/applications/solvers/combustion/fireFoam/combustionModels/noCombustion/noCombustion.C
+++ b/applications/solvers/combustion/fireFoam/combustionModels/noCombustion/noCombustion.C
@@ -39,8 +39,8 @@ namespace combustionModels
         noCombustion,
         dictionary
     );
-};
-};
+}
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C
index 92f25ca30de605c8ae3ded7593fd041a789515f1..c9722f9dab781eca948b134fd163878647601235 100644
--- a/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C
+++ b/applications/solvers/compressible/rhoCentralFoam/BCs/T/smoluchowskiJumpTFvPatchScalarField.C
@@ -217,7 +217,7 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         smoluchowskiJumpTFvPatchScalarField
diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C
index 85f2db8d4cdc27c2df2875382b87abb376d3c133..6f79dc2bac40e2657493956ccbbebdfb9d442d44 100644
--- a/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C
+++ b/applications/solvers/compressible/rhoCentralFoam/BCs/U/maxwellSlipUFvPatchVectorField.C
@@ -198,7 +198,7 @@ void maxwellSlipUFvPatchVectorField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchVectorField,
     maxwellSlipUFvPatchVectorField
diff --git a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C
index c3340f69325a713e67bf710f7582ca251461d252..b94f72caf963d9924f0b7585eb77c71eed517704 100644
--- a/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C
+++ b/applications/solvers/compressible/rhoCentralFoam/BCs/rho/fixedRhoFvPatchScalarField.C
@@ -112,7 +112,7 @@ void fixedRhoFvPatchScalarField::updateCoeffs()
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     fixedRhoFvPatchScalarField
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
index 93caaf34fb8d35f50d436bcd9092260f331d4561..815bce3c803389c502efdacebe3b35ec801c1c88 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/derivedFvPatchFields/solidWallHeatFluxTemperature/solidWallHeatFluxTemperatureFvPatchScalarField.C
@@ -203,7 +203,7 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::write
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         solidWallHeatFluxTemperatureFvPatchScalarField
diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C
index 0d94768b236e41975a434c58b1dd94222c2f19e1..5614578429eeb521768fb9ce6c8e27dc78a7d268 100644
--- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C
+++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletPressure/adjointOutletPressureFvPatchScalarField.C
@@ -121,7 +121,7 @@ void Foam::adjointOutletPressureFvPatchScalarField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         adjointOutletPressureFvPatchScalarField
diff --git a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C
index dbde31a88a6b4164344469e5d2953a0e8eafe050..0f72c88e3e13c28e0266cc01ca8a6d6e5d8e3c71 100644
--- a/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C
+++ b/applications/solvers/incompressible/adjointShapeOptimizationFoam/adjointOutletVelocity/adjointOutletVelocityFvPatchVectorField.C
@@ -119,7 +119,7 @@ void Foam::adjointOutletVelocityFvPatchVectorField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         adjointOutletVelocityFvPatchVectorField
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
index 9be378e5c579681a26f0f6763ec6934a7b8b4eed..11c844f8d932b4c2a90da1507bfae644fd1b87dc 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
+++ b/applications/solvers/multiphase/multiphaseInterFoam/multiphaseMixture/alphaContactAngle/alphaContactAngleFvPatchScalarField.C
@@ -133,7 +133,7 @@ void alphaContactAngleFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     alphaContactAngleFvPatchScalarField
diff --git a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C
index 46a947ef0b6e8cdfd8914afde4212a91ca4f3199..f3f0c0798e26df418b898aed2bc268f49c0ec163 100644
--- a/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C
+++ b/applications/solvers/stressAnalysis/solidDisplacementFoam/tractionDisplacement/tractionDisplacementFvPatchVectorField.C
@@ -207,7 +207,7 @@ void tractionDisplacementFvPatchVectorField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchVectorField,
     tractionDisplacementFvPatchVectorField
diff --git a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C
index 0bf83bcca559831f670fcb9451a25de173679e4a..cbe9b31b35f7cfa6d57cb2c120438c3a877957c3 100644
--- a/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C
+++ b/applications/solvers/stressAnalysis/solidEquilibriumDisplacementFoam/tractionDisplacementCorrection/tractionDisplacementCorrectionFvPatchVectorField.C
@@ -194,7 +194,7 @@ void tractionDisplacementCorrectionFvPatchVectorField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchVectorField,
     tractionDisplacementCorrectionFvPatchVectorField
diff --git a/applications/utilities/mesh/conversion/Optional/Allwmake b/applications/utilities/mesh/conversion/Optional/Allwmake
index 2791c1121e2f77b7a7a60ed67ceb7db539d5e836..25800377a1cc0691573b3f8d6941c9ded767f9b2 100755
--- a/applications/utilities/mesh/conversion/Optional/Allwmake
+++ b/applications/utilities/mesh/conversion/Optional/Allwmake
@@ -9,7 +9,7 @@ set -x
 $WM_THIRD_PARTY_DIR/AllwmakeLibccmio
 
 # if the library built properly, the headers should exist too
-if [ -e $FOAM_LIBBIN/libccmio.so ]
+if [ -e $FOAM_EXT_LIBBIN/libccmio.so ]
 then
     wmake ccm26ToFoam
 fi
diff --git a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/Make/options b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/Make/options
index e87c735e37d1ef96d887aa2ecfb06af748ce8f1c..e2cdbcd1c2001b5640dddc0017ef8f989fd8a52d 100644
--- a/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/Make/options
+++ b/applications/utilities/mesh/conversion/Optional/ccm26ToFoam/Make/options
@@ -1,10 +1,12 @@
+LIBCCMIO_DIR = $(WM_THIRD_PARTY_DIR)/libccmio-2.6.1
+
 EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude \
     -I$(LIB_SRC)/meshTools/lnInclude \
-    -I${WM_THIRD_PARTY_DIR}/libccmio-2.6.1 \
-    -I${WM_THIRD_PARTY_DIR}/libccmio-2.6.1/lnInclude
+    -I$(LIBCCMIO_DIR) \
+    -I$(LIBCCMIO_DIR)/lnInclude
 
 EXE_LIBS = \
     -lfiniteVolume \
     -lmeshTools \
-    -lccmio
+    -L$(FOAM_EXT_LIBBIN) -lccmio
diff --git a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C
index bc7d988358fe8d55e00977de3703b4dd40561a22..fe7e858b9a93b75a434d85e612e4cbe6eccfda5f 100644
--- a/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C
+++ b/applications/utilities/parallelProcessing/redistributeMeshPar/redistributeMeshPar.C
@@ -53,6 +53,7 @@ Description
 #include "fvMeshDistribute.H"
 #include "mapDistributePolyMesh.H"
 #include "IOobjectList.H"
+#include "globalIndex.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -107,7 +108,9 @@ autoPtr<fvMesh> createMesh
     fvMesh& mesh = meshPtr();
 
 
-    // Determine patches.
+    // Sync patches
+    // ~~~~~~~~~~~~
+
     if (Pstream::master())
     {
         // Send patches
@@ -118,14 +121,14 @@ autoPtr<fvMesh> createMesh
             slave++
         )
         {
-            OPstream toSlave(Pstream::blocking, slave);
+            OPstream toSlave(Pstream::scheduled, slave);
             toSlave << mesh.boundaryMesh();
         }
     }
     else
     {
         // Receive patches
-        IPstream fromMaster(Pstream::blocking, Pstream::masterNo());
+        IPstream fromMaster(Pstream::scheduled, Pstream::masterNo());
         PtrList<entry> patchEntries(fromMaster);
 
         if (haveMesh)
@@ -224,6 +227,58 @@ autoPtr<fvMesh> createMesh
         }
     }
 
+
+    // Determine zones
+    // ~~~~~~~~~~~~~~~
+
+    wordList pointZoneNames(mesh.pointZones().names());
+    Pstream::scatter(pointZoneNames);
+    wordList faceZoneNames(mesh.faceZones().names());
+    Pstream::scatter(faceZoneNames);
+    wordList cellZoneNames(mesh.cellZones().names());
+    Pstream::scatter(cellZoneNames);
+
+    if (!haveMesh)
+    {
+        // Add the zones
+        List<pointZone*> pz(pointZoneNames.size());
+        forAll(pointZoneNames, i)
+        {
+            pz[i] = new pointZone
+            (
+                pointZoneNames[i],
+                labelList(0),
+                i,
+                mesh.pointZones()
+            );
+        }
+        List<faceZone*> fz(faceZoneNames.size());
+        forAll(faceZoneNames, i)
+        {
+            fz[i] = new faceZone
+            (
+                faceZoneNames[i],
+                labelList(0),
+                boolList(0),
+                i,
+                mesh.faceZones()
+            );
+        }
+        List<cellZone*> cz(cellZoneNames.size());
+        forAll(cellZoneNames, i)
+        {
+            cz[i] = new cellZone
+            (
+                cellZoneNames[i],
+                labelList(0),
+                i,
+                mesh.cellZones()
+            );
+        }
+        mesh.addZones(pz, fz, cz);        
+    }
+
+
     if (!haveMesh)
     {
         // We created a dummy mesh file above. Delete it.
@@ -236,6 +291,21 @@ autoPtr<fvMesh> createMesh
     mesh.clearOut();
     mesh.globalData();
 
+
+    // Do some checks.
+
+    // Check if the boundary definition is unique
+    mesh.boundaryMesh().checkDefinition(true);
+    // Check if the boundary processor patches are correct
+    mesh.boundaryMesh().checkParallelSync(true);
+    // Check names of zones are equal
+    mesh.cellZones().checkDefinition(true);
+    mesh.cellZones().checkParallelSync(true);
+    mesh.faceZones().checkDefinition(true);
+    mesh.faceZones().checkParallelSync(true);
+    mesh.pointZones().checkDefinition(true);
+    mesh.pointZones().checkParallelSync(true);
+
     return meshPtr;
 }
 
@@ -292,6 +362,59 @@ void printMeshData(Ostream& os, const polyMesh& mesh)
         << "          face zones:       " << mesh.faceZones().size() << nl
         << "          cell zones:       " << mesh.cellZones().size() << nl;
 }
+void printMeshData(const polyMesh& mesh)
+{
+    // Collect all data on master
+
+    globalIndex globalCells(mesh.nCells());
+    labelListList patchNeiProcNo(Pstream::nProcs());
+    labelListList patchSize(Pstream::nProcs());
+    const labelList& pPatches = mesh.globalData().processorPatches();
+    patchNeiProcNo[Pstream::myProcNo()].setSize(pPatches.size());
+    patchSize[Pstream::myProcNo()].setSize(pPatches.size());
+    forAll(pPatches, i)
+    {
+        const processorPolyPatch& ppp = refCast<const processorPolyPatch>
+        (
+            mesh.boundaryMesh()[pPatches[i]]
+        );
+        patchNeiProcNo[Pstream::myProcNo()][i] = ppp.neighbProcNo();
+        patchSize[Pstream::myProcNo()][i] = ppp.size();
+    }
+    Pstream::gatherList(patchNeiProcNo);
+    Pstream::gatherList(patchSize);
+
+
+    // Print stats
+
+    globalIndex globalBoundaryFaces(mesh.nFaces()-mesh.nInternalFaces());
+
+    for (label procI = 0; procI < Pstream::nProcs(); procI++)
+    {
+        Info<< endl
+            << "Processor " << procI << nl
+            << "    Number of cells = " << globalCells.localSize(procI)
+            << endl;
+
+        label nProcFaces = 0;
+
+        const labelList& nei = patchNeiProcNo[procI];
+        
+        forAll(patchNeiProcNo[procI], i)
+        {
+            Info<< "    Number of faces shared with processor "
+                << patchNeiProcNo[procI][i] << " = " << patchSize[procI][i]
+                << endl;
+
+            nProcFaces += patchSize[procI][i];
+        }
+
+        Info<< "    Number of processor patches = " << nei.size() << nl
+            << "    Number of processor faces = " << nProcFaces << nl
+            << "    Number of boundary faces = "
+            << globalBoundaryFaces.localSize(procI) << endl;
+    }
+}
 
 
 // Debugging: write volScalarField with decomposition for post processing.
@@ -507,6 +630,7 @@ void compareFields
 int main(int argc, char *argv[])
 {
 #   include "addRegionOption.H"
+#   include "addOverwriteOption.H"
     argList::addOption
     (
         "mergeTol",
@@ -539,6 +663,8 @@ int main(int argc, char *argv[])
     }
     Info<< "Using mesh subdirectory " << meshSubDir << nl << endl;
 
+    const bool overwrite = args.optionFound("overwrite");
+
 
     // Get time instance directory. Since not all processors have meshes
     // just use the master one everywhere.
@@ -573,9 +699,11 @@ int main(int argc, char *argv[])
     );
     fvMesh& mesh = meshPtr();
 
-    Pout<< "Read mesh:" << endl;
-    printMeshData(Pout, mesh);
-    Pout<< endl;
+    //Pout<< "Read mesh:" << endl;
+    //printMeshData(Pout, mesh);
+    //Pout<< endl;
+
+
 
     IOdictionary decompositionDict
     (
@@ -618,7 +746,10 @@ int main(int argc, char *argv[])
     }
 
     // Dump decomposition to volScalarField
-    writeDecomposition("decomposition", mesh, finalDecomp);
+    if (!overwrite)
+    {
+        writeDecomposition("decomposition", mesh, finalDecomp);
+    }
 
 
     // Create 0 sized mesh to do all the generation of zero sized
@@ -796,12 +927,20 @@ int main(int argc, char *argv[])
 
 
     // Print a bit
-    Pout<< "After distribution mesh:" << endl;
-    printMeshData(Pout, mesh);
-    Pout<< endl;
+    // Print some statistics
+    Info<< "After distribution:" << endl;
+    printMeshData(mesh);
+
 
-    runTime++;
-    Pout<< "Writing redistributed mesh to " << runTime.timeName() << nl << endl;
+    if (!overwrite)
+    {
+        runTime++;
+    }
+    else
+    {
+        mesh.setInstance(masterInstDir);
+    }
+    Info<< "Writing redistributed mesh to " << runTime.timeName() << nl << endl;
     mesh.write();
 
 
diff --git a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Make/options b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Make/options
index c3569ababfb50304be5ed98797bcf83fdd38c0d5..97a2251f7bb9bf8d90bb23bd4ddbccf3c74a04a9 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Make/options
+++ b/applications/utilities/postProcessing/dataConversion/foamToTecplot360/Make/options
@@ -6,8 +6,8 @@ EXE_INC = \
 
 
 EXE_LIBS = \
-    -ltecio \
     -llagrangian \
     -lfiniteVolume \
     -lgenericPatchFields \
-    -lmeshTools
+    -lmeshTools \
+    -L$(FOAM_EXT_LIBBIN) -ltecio
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake b/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake
index cd3a58ffedc2fd1bb0ee8aeb3e833e18bdf69490..308eaaf175dcf284868848abb49796acd8d64ddc 100755
--- a/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/Allwmake
@@ -13,6 +13,9 @@ then
             exit 1
         fi
 
+        # ensure CMake gets the correct C++ compiler
+        [ -n "$WM_CXX" ] && export CXX="$WM_CXX"
+
         wmake libso vtkPV3Readers
         PV3blockMeshReader/Allwmake
         PV3FoamReader/Allwmake
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt
index ea50923e6a7528e5f987f7e5896211c864af6f2b..93dc9f702ef6899b14de013b222db6a32848f22a 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/PV3FoamReader/CMakeLists.txt
@@ -14,6 +14,7 @@ INCLUDE(${PARAVIEW_USE_FILE})
 
 LINK_DIRECTORIES(
     $ENV{FOAM_LIBBIN}
+    $ENV{FOAM_EXT_LIBBIN}
 )
 
 INCLUDE_DIRECTORIES(
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files
index e71b857bb2e229412366860d8eaef07c1192bf3b..90ac11a3e8d1b040eac3f50e87be93b35aa1bfa9 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/files
@@ -9,4 +9,4 @@ vtkPV3FoamMeshZone.C
 vtkPV3FoamUpdateInfo.C
 vtkPV3FoamUtils.C
 
-LIB = $(FOAM_LIBBIN)/libvtkPV3Foam
+LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3Foam
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options
index b10a420add997d2d9c932f410b943ab5f8a907ed..6d10cc1a05bceb1c5ccdcb66e377f22ba64f35fa 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/Make/options
@@ -1,6 +1,6 @@
 /* Note: enable vtkPolyhedron when available */
 
-PARAVIEW_INC=$(ParaView_DIR)/include/paraview-$(ParaView_MAJOR)
+PARAVIEW_INC = $(ParaView_DIR)/include/paraview-$(ParaView_MAJOR)
 
 EXE_INC = \
     -I$(LIB_SRC)/meshTools/lnInclude \
@@ -15,9 +15,9 @@ EXE_INC = \
     )
 
 LIB_LIBS = \
-    -lvtkPV3Readers \
     -lmeshTools \
     -lfiniteVolume \
     -lgenericPatchFields \
     -llagrangian \
+    -L$(FOAM_EXT_LIBBIN) -lvtkPV3Readers \
     $(GLIBS)
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt
index 3376fa0d91caec4c8734f5d24626759caf8a64c5..f5d9f3f8678e3c7757de0a053cd7ac5bef58aa6c 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/PV3blockMeshReader/CMakeLists.txt
@@ -14,6 +14,7 @@ INCLUDE(${PARAVIEW_USE_FILE})
 
 LINK_DIRECTORIES(
     $ENV{FOAM_LIBBIN}
+    $ENV{FOAM_EXT_LIBBIN}
 )
 
 INCLUDE_DIRECTORIES(
@@ -36,7 +37,8 @@ SET(
 #
 # Define combined plugin
 #
-# Try to extend the auto-generated panel
+
+# Extend the auto-generated panel
 QT4_WRAP_CPP(MOC_SRCS pqPV3blockMeshReaderPanel.h)
 
 ADD_PARAVIEW_OBJECT_PANEL(IFACES IFACE_SRCS
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files
index f084cc9f28fbc5faa5d02b2a857a9e4fc7f5eaf5..3d452f747a10e0ef24ab3166dd858a1f31dda161 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/files
@@ -2,4 +2,4 @@ vtkPV3blockMesh.C
 vtkPV3blockMeshConvert.C
 vtkPV3blockMeshUtils.C
 
-LIB = $(FOAM_LIBBIN)/libvtkPV3blockMesh
+LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3blockMesh
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options
index 6001799a6c6646ffc2012e7db9623b02de98d0f3..1964824e54c7348e5c27582d82be8614ead694dc 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3blockMeshReader/vtkPV3blockMesh/Make/options
@@ -1,12 +1,14 @@
+PARAVIEW_INC = $(ParaView_DIR)/include/paraview-$(ParaView_MAJOR)
+
 EXE_INC = \
     -I$(LIB_SRC)/meshTools/lnInclude \
     -I$(LIB_SRC)/mesh/blockMesh/lnInclude \
-    -I$(ParaView_DIR)/include/paraview-$(ParaView_MAJOR) \
+    -I$(PARAVIEW_INC) \
     -I../../vtkPV3Readers/lnInclude \
     -I../PV3blockMeshReader
 
 LIB_LIBS = \
-    -lvtkPV3Readers \
     -lmeshTools \
     -lblockMesh \
+    -L$(FOAM_EXT_LIBBIN) -lvtkPV3Readers \
     $(GLIBS)
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files
index 134b8de963e813e2955fdac51ea10d5e684e6c94..c5f3c12ebd1700638c358ed7f95d99222663d9b6 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/files
@@ -1,3 +1,3 @@
 vtkPV3Readers.C
 
-LIB = $(FOAM_LIBBIN)/libvtkPV3Readers
+LIB = $(FOAM_EXT_LIBBIN)/libvtkPV3Readers
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/options b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/options
index 55e559dd0502539268ec176477ca094d5da45db5..4b2b1a3289e26da1d003a99442cdc1c1e95aed02 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/options
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/vtkPV3Readers/Make/options
@@ -1,5 +1,7 @@
+PARAVIEW_INC = $(ParaView_DIR)/include/paraview-$(ParaView_MAJOR)
+
 EXE_INC = \
-    -I$(ParaView_DIR)/include/paraview-$(ParaView_MAJOR)
+    -I$(PARAVIEW_INC)
 
 LIB_LIBS = \
     $(GLIBS)
diff --git a/applications/utilities/surface/surfaceCheck/surfaceCheck.C b/applications/utilities/surface/surfaceCheck/surfaceCheck.C
index 1f1ef8c64fc96378980c5bbbab462bb5321d6963..b02c71756f90ba271fe0b5db44e1f03113e0a088 100644
--- a/applications/utilities/surface/surfaceCheck/surfaceCheck.C
+++ b/applications/utilities/surface/surfaceCheck/surfaceCheck.C
@@ -392,13 +392,17 @@ int main(int argc, char *argv[])
                     problemFaces.append(faceI);
                 }
             }
-            OFstream str("badFaces");
 
-            Info<< "Dumping bad quality faces to " << str.name() << endl
-                << "Paste this into the input for surfaceSubset" << nl
-                << nl << endl;
+            if (!problemFaces.empty())
+            {
+                OFstream str("badFaces");
+
+                Info<< "Dumping bad quality faces to " << str.name() << endl
+                    << "Paste this into the input for surfaceSubset" << nl
+                    << nl << endl;
 
-            str << problemFaces;
+                str << problemFaces;
+            }
         }
     }
 
diff --git a/bin/foamBinDirs b/bin/foamBinDirs
deleted file mode 100755
index ef96dee328db3882d6bd9e5c4504a70970687391..0000000000000000000000000000000000000000
--- a/bin/foamBinDirs
+++ /dev/null
@@ -1,60 +0,0 @@
-#!/bin/sh
-#---------------------------------*- sh -*-------------------------------------
-# =========                 |
-# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-#  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 1991-2010 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
-#     foamBinDirs <packDir> <arch>
-#
-# Description
-#     Returns all directories containing binary files of OpenFOAM
-#
-#------------------------------------------------------------------------------
-
-if [ $# -ne 2 ]
-then
-    echo "Error: architecture type expected, exiting"
-    echo
-    echo "Usage : ${0##*/} <packDir> <arch>"
-    echo
-    exit 1
-fi
-packDir=$1
-arch=$2
-
-# base arch (w/o precision, optimization, etc)
-baseArch=$(echo "$arch" | sed -e 's@[DS]P.*$@@')
-
-# get list of directories
-(
-    for dir in \
-        $packDir/lib/$arch \
-        $packDir/applications/bin/$arch \
-        $packDir/wmake/rules \
-        $packDir/wmake/bin/$baseArch \
-        ;
-    do
-        [ -d $dir ] && echo $dir
-    done
-)
-
-#------------------------------------------------------------------------------
diff --git a/bin/foamPack b/bin/foamPack
index 920bfaf52b1c5e64977b0fc1d05de413bb6f05d4..dd8dab951c47e5cf551fc0b2855555760783d584 100755
--- a/bin/foamPack
+++ b/bin/foamPack
@@ -1,9 +1,9 @@
 #!/bin/sh
-#---------------------------------*- sh -*-------------------------------------
+#------------------------------------------------------------------------------
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+#   \\  /    A nd           | Copyright (C) 1991-2011 OpenCFD Ltd.
 #    \\/     M anipulation  |
 #------------------------------------------------------------------------------
 # License
@@ -23,47 +23,102 @@
 #     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 #
 # Script
-#     foamPack [outputDir]
+#     foamPack [OPTION]
 #
 # Description
-#     Packs and compresses the OpenFOAM directory for release
+#     Pack and compress the OpenFOAM directory for release
 #
 #------------------------------------------------------------------------------
-
-timeStamp=$(date +%Y-%m-%d)
 packDir=$WM_PROJECT-$WM_PROJECT_VERSION
-packFile=${packDir}_${timeStamp}.gtgz
+toolsDir="${0%/*}/tools"  # this script is located in the tools/ parent dir
 
-if [ ! -d $packDir ]
-then
-    echo "Error: directory $packDir does not exist"
+usage() {
+    while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done
+cat <<USAGE 1>&2
+Usage: ${0##*/} [OPTION]
+options:
+  -o <dir>          specify alternative output directory
+  -nogit            bypass using 'git archive'
+
+* Pack and compress OpenFOAM directory for release
+
+USAGE
     exit 1
-fi
+}
+
+unset prefix outputDir nogit
+# parse options
+while [ "$#" -gt 0 ]
+do
+    case "$1" in
+    -h | -help)
+        usage
+        ;;
+    -nogit)
+        nogit=true
+        shift
+        ;;
+    -o | -output)
+        [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
+        outputDir=${2%%/}
+        shift 2
+        ;;
+    -*)
+        usage "unknown option: '$*'"
+        ;;
+    *)
+        break
+        ;;
+    esac
+done
+
+# check for essential directories
+for dir in $packDir
+do
+    [ -d $dir ] || {
+        echo "Error: directory $dir does not exist" 1>&2
+        exit 1
+    }
+done
+
+
+#------------------------------------------------------------------------------
+timeStamp=$(date +%Y-%m-%d)
+packExt=tgz
+packBase=${packDir}_${timeStamp}
 
 # add optional output directory
-if [ -d "$1" ]
-then
-    packFile="$1/$packFile"
-fi
+[ -d "$outputDir" ] && packBase="$outputDir/$packBase"
+packFile=$packBase.$packExt
 
+# avoid overwriting old pack file
 if [ -f $packFile ]
 then
-    echo "Error: $packFile already exists"
+    echo "Error: $packFile already exists" 1>&2
     exit 1
 fi
 
-# Create time stamp file
-# ~~~~~~~~~~~~~~~~~~~~~~
-
+# add time-stamp file before packing
 echo $timeStamp 2>/dev/null > $packDir/.timeStamp
 
-# Pack and compress the packFile
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+# check for git (program and .git directory)
+(cd $packDir && git branch) > /dev/null 2>&1 || nogit=true
+
+if [ "$nogit" = true ]
+then
+    echo "pack manually" 1>&2
+    $toolsDir/foamPackSource $packDir $packFile
+else
+    echo "pack with git-archive" 1>&2
+    ( cd $packDir && git archive --format=tar --prefix=$packDir/ HEAD) > $packBase.tar
 
-echo
-echo "Packing $packDir source files into $packFile"
-echo
+    echo "add in time-stamp and lnInclude directories" 1>&2
+    tar cf $packBase.tar2 $packDir/.timeStamp $packDir/.build `find -H $packDir -type d -name lnInclude`
+    tar Af $packBase.tar $packBase.tar2
 
-foamPackSource $packDir $packFile
+    echo "gzip tar file" 1>&2
+    gzip -c9 $packBase.tar > $packFile
+    rm -f $packBase.tar $packBase.tar2 2>/dev/null
+fi
 
 #------------------------------------------------------------------------------
diff --git a/bin/foamPackBin b/bin/foamPackBin
index 3a6358f5970def5c8910a0463a9e50441e6bf638..fa0fb00150940e0840182eb8f27ee588e0ab1bc8 100755
--- a/bin/foamPackBin
+++ b/bin/foamPackBin
@@ -3,7 +3,7 @@
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+#   \\  /    A nd           | Copyright (C) 1991-2011 OpenCFD Ltd.
 #    \\/     M anipulation  |
 #-------------------------------------------------------------------------------
 # License
@@ -23,66 +23,119 @@
 #     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 #
 # Script
-#     foamPackBin <arch> [outputDir]
+#     foamPackBin [OPTION] <archOptions>
 #
 # Description
-#     Packs and compresses binary version of OpenFOAM for release
+#     Pack and compress binary version of OpenFOAM for release
+#
+# Script
+#     foamPackThirdPartyBin [OPTION] <archOptions>
+#
+# Description
+#     Pack and compress binary version of OpenFOAM ThirdParty for release
 #
 #------------------------------------------------------------------------------
+toolsDir="${0%/*}/tools"  # this script is located in the tools/ parent dir
 
-if [ $# -eq 0 ]
-then
-    echo "Error: architecture type expected, exiting"
-    echo
-    echo "Usage : ${0##*/} <arch> [outputDir]"
-    echo
+case "${0##*/}" in
+*ThirdParty*)
+    # for ThirdParty
+    codeBase="OpenFOAM ThirdParty"
+    packDir=ThirdParty-$WM_PROJECT_VERSION
+    listBinDirs=$toolsDir/foamListThirdPartyBinDirs
+    ;;
+*)
+    # regular
+    codeBase="OpenFOAM ThirdParty"
+    packDir=$WM_PROJECT-$WM_PROJECT_VERSION
+    listBinDirs=$toolsDir/foamListBinDirs
+    ;;
+esac
+
+
+usage() {
+    while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done
+cat <<USAGE 1>&2
+Usage: ${0##*/} [OPTION] <archOptions>
+options:
+  -o <dir>          specify alternative output directory
+
+* Pack and compress binary version of $codeBase for release
+
+    The value of 'archOptions' normally corresponds to \$WM_OPTIONS
+    The current value of \$WM_OPTIONS = $WM_OPTIONS
+
+USAGE
     exit 1
-fi
-arch=$1
+}
 
-# base arch (w/o precision, optimization, etc)
-baseArch=$(echo "$arch" | sed -e 's@[DS]P.*$@@')
 
+unset prefix outputDir
+# parse options
+while [ "$#" -gt 0 ]
+do
+    case "$1" in
+    -h | -help)
+        usage
+        ;;
+    -o | -output)
+        [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
+        outputDir=${2%%/}
+        shift 2
+        ;;
+    -*)
+        usage "unknown option: '$*'"
+        ;;
+    *)
+        break
+        ;;
+    esac
+done
+
+[ $# -eq 1 ] || usage "Error: specify architecture"
+
+# same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
+archOptions="$1"
+
+#------------------------------------------------------------------------------
 timeStamp=$(date +%Y-%m-%d)
-packDir=$WM_PROJECT-$WM_PROJECT_VERSION
-packFile=${packDir}.${arch}_${timeStamp}.gtgz
+packExt=tgz
+packBase=${packDir}.${archOptions}_${timeStamp}
 
 # add optional output directory
-if [ -d "$2" ]
-then
-    packFile="$2/$packFile"
-fi
+[ -d "$outputDir" ] && packBase="$outputDir/$packBase"
+packFile=$packBase.$packExt
 
+# avoid overwriting old pack file
 if [ -f $packFile ]
 then
-    echo "Error: $packFile already exists"
+    echo "Error: $packFile already exists" 1>&2
     exit 1
 fi
 
-# check for essential directories
-for dir in $packDir $packDir/lib/$arch $packDir/applications/bin/$arch
-do
-    if [ ! -d $dir ]
-    then
-        echo "Error: directory $dir does not exist"
-        exit 1
-    fi
-done
+
+#------------------------------------------------------------------------------
 
 # get list of directories
-dirList=`foamBinDirs $packDir $arch`
+dirList=$( $listBinDirs $packDir $archOptions )
+if [ $? -eq 0 -a -n "$dirList" ]
+then
+    echo "Pack into $packFile" 1>&2
+    echo 1>&2
+else
+    exit 1
+fi
 
-echo
-echo "Packing $arch ($baseArch) port of $packDir into $packFile"
-echo
 
-tar czpf $packFile $dirList
+# Clean up on Ctrl-C
+trap 'rm -f $packFile 2>/dev/null' INT
 
+tar cpzf $packFile $dirList
 if [ $? -eq 0 ]
 then
-    echo "Finished packing and compressing file $packFile"
+    echo "Finished packing file $packFile" 1>&2
 else
-    echo "Error: failure packing $packFile"
+    echo "Error: failure packing $packFile" 1>&2
     rm -f $packFile 2>/dev/null
 fi
 
diff --git a/bin/foamPackBinAll b/bin/foamPackBinAll
index ce16058b64f26882261486dcc310b882c2881706..8d56e5701f150107f93e8ea0c8176df02a3e76ad 100755
--- a/bin/foamPackBinAll
+++ b/bin/foamPackBinAll
@@ -3,7 +3,7 @@
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+#   \\  /    A nd           | Copyright (C) 1991-2011 OpenCFD Ltd.
 #    \\/     M anipulation  |
 #-------------------------------------------------------------------------------
 # License
@@ -23,24 +23,44 @@
 #     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 #
 # Script
-#     foamPackBinAll [outputDir]
+#     foamPackBinAll [OPTION]
 #
 # Description
-#     Packs and compresses all binary versions of foam for release
+#     Pack and compress all binary versions of OpenFOAM for release
+#
+# Script
+#     foamPackThirdPartyBinAll [OPTION]
+#
+# Description
+#     Pack and compress all binary versions of OpenFOAM ThirdParty for release
 #
 #------------------------------------------------------------------------------
-packDir=$WM_PROJECT-$WM_PROJECT_VERSION
+binDir="${0%/*}"  # this script is located in the bin/ dir
 
-if [ ! -d $packDir ]
-then
-    echo "Error: directory $packDir does not exist"
+case "${0##*/}" in
+*ThirdParty*)
+    # for ThirdParty
+    packDir=ThirdParty-$WM_PROJECT_VERSION
+    packBin=foamPackThirdPartyBin
+    ;;
+*)
+    # regular
+    packDir=$WM_PROJECT-$WM_PROJECT_VERSION
+    packBin=foamPackBin
+    ;;
+esac
+
+
+[ -d $packDir ] || {
+    echo "Error: directory $packDir does not exist" 1>&2
     exit 1
-fi
+}
+
 
-# obtain arch types from lib/
-for bin in $packDir/lib/*
+# obtain archOptions types from lib/
+for archOptions in $packDir/lib/*
 do
-    foamPackBin ${bin##*/} $@
+    $binDir/$packBin $@ ${archOptions##*/}
 done
 
 #------------------------------------------------------------------------------
diff --git a/bin/foamPackDoxygen b/bin/foamPackDoxygen
index f93e41cd6df9212508b53cb45d957efdefaf8c42..c9337e972f4ce3a9262087f42d5e5947eb397670 100755
--- a/bin/foamPackDoxygen
+++ b/bin/foamPackDoxygen
@@ -3,7 +3,7 @@
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+#   \\  /    A nd           | Copyright (C) 2008-2011 OpenCFD Ltd.
 #    \\/     M anipulation  |
 #-------------------------------------------------------------------------------
 # License
@@ -26,39 +26,44 @@
 #     foamPackDoxygen [-prefix DIR] [-o outputDir]
 #
 # Description
-#     Packs and compresses the OpenFOAM doxygen html for release
+#     Pack and compress the OpenFOAM doxygen html for release
 #
 #------------------------------------------------------------------------------
 packDir=$WM_PROJECT-$WM_PROJECT_VERSION
-packTag=_Doxygen.gtgz
+htmlDir=doc/Doxygen/html
 
 usage() {
     while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done
 cat <<USAGE 1>&2
-Usage: ${0##*/} [-prefix DIR] [-o outputDir]
+Usage: ${0##*/} [OPTION]
+options:
+  -prefix <dir>     use alternative prefix
+  -o <dir>          specify alternative output directory
 
-    Packs and compresses the OpenFOAM doxygen html for release
+* Pack and compress the OpenFOAM doxygen html for release
 
 USAGE
     exit 1
 }
 
 unset prefix outputDir
-
+# parse options
 while [ "$#" -gt 0 ]
 do
     case $1 in
-    -prefix | --prefix )
+    -h | -help)
+        usage
+        ;;
+    -prefix | --prefix)
+        [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
         prefix=${2%%/}
         shift 2
         ;;
-    -o | -output )
+    -o | -output)
+        [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
         outputDir=${2%%/}
         shift 2
         ;;
-    -h | -help )
-        usage
-        ;;
     -*)
         usage "unknown option: '$*'"
         ;;
@@ -81,41 +86,44 @@ then
     exit 1
 fi
 
-#
+#------------------------------------------------------------------------------
+packExt=tgz
+packName=${packDir}_Doxygen
+
 # add optional output directory
-#
-if [ -d "$outputDir" ]
-then
-    packFile="$outputDir/$packDir$packTag"
-else
-    packFile="$packDir$packTag"
-fi
+[ -d "$outputDir" ] && packName="$outputDir/$packName"
+packFile=$packName.$packExt
 
 
 if [ -f $packFile ]
 then
-    echo "Error: $packFile already exists"
+    echo "Error: $packFile already exists" 1>&2
     exit 1
 fi
 
-# Pack and compress the packFile using GNU tar
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-echo
-echo "Packing doxygen html into $packFile"
-echo
+cat <<INFO 1>&2
+-------------------------------------------------------------------------------
+Packing doxygen html into $packFile
+
+INFO
+
+# Clean up on Ctrl-C
+trap 'rm -f $packFile 2>/dev/null' INT
 
 if [ -n "$prefix" ]
 then
-    tar czpf $packFile --transform="s@^@$prefix/@" doc/Doxygen/html
+    # requires GNU tar
+    tar cpzf $packFile --transform="s@^@$prefix/@" $htmlDir
 else
-    tar czpf $packFile $packDir/doc/Doxygen/html
+    tar cpzf $packFile $packDir/$htmlDir
 fi
 
 if [ $? -eq 0 ]
 then
-    echo "Finished packing doxygen html into file $packFile"
+    echo "Finished packing doxygen html into file $packFile" 1>&2
 else
-    echo "Error: failure packing doxygen html file $packFile"
+    echo "Error: failure packing doxygen html file $packFile" 1>&2
+    rm -f $packFile 2>/dev/null
 fi
 
 #------------------------------------------------------------------------------
diff --git a/bin/foamPackThirdParty b/bin/foamPackThirdParty
index 4cd5b9c9ee6dd2bb4885a96f46b303e475d3866c..e0f07178d74e541a8a5e06339479f5b7e49b72c9 100755
--- a/bin/foamPackThirdParty
+++ b/bin/foamPackThirdParty
@@ -1,9 +1,9 @@
 #!/bin/sh
-#---------------------------------*- sh -*-------------------------------------
+#------------------------------------------------------------------------------
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+#   \\  /    A nd           | Copyright (C) 2008-2011 OpenCFD Ltd.
 #    \\/     M anipulation  |
 #------------------------------------------------------------------------------
 # License
@@ -23,48 +23,86 @@
 #     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 #
 # Script
-#     foamPackThirdParty [outputDir]
+#     foamPackThirdParty [OPTION]
 #
 # Description
-#     Packs and compresses the OpenFOAM ThirdParty directory for release
+#     Pack and compress the OpenFOAM ThirdParty directory for release
 #
 #------------------------------------------------------------------------------
+packDir=ThirdParty-$WM_PROJECT_VERSION
+toolsDir="${0%/*}/tools"  # this script is located in the tools/ parent dir
 
-timeStamp=$(date +%Y-%m-%d)
-packDir=${WM_THIRD_PARTY_DIR:-ThirdParty}
-packDir=${packDir##*/}
-packFile=${packDir}_${timeStamp}.gtgz
+usage() {
+    while [ $# -gt 0 ]; do echo "$1" 1>&2; shift; done
+cat <<USAGE 1>&2
+Usage: ${0##*/} [OPTION]
+options:
+  -o <dir>          specify alternative output directory
 
-if [ ! -d $packDir ]
-then
-    echo "Error: directory $packDir does not exist"
+* Pack and compress ThirdParty directory for release
+
+USAGE
     exit 1
-fi
+}
+
+unset prefix outputDir nogit
+# parse options
+while [ "$#" -gt 0 ]
+do
+    case "$1" in
+    -h | -help)
+        usage
+        ;;
+    -nogit)
+        nogit=true
+        shift
+        ;;
+    -o | -output)
+        [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
+        outputDir=${2%%/}
+        shift 2
+        ;;
+    -*)
+        usage "unknown option: '$*'"
+        ;;
+    *)
+        break
+        ;;
+    esac
+done
+
+# check for essential directories
+for dir in $packDir
+do
+    [ -d $dir ] || {
+        echo "Error: directory $dir does not exist" 1>&2
+        exit 1
+    }
+done
+
+
+#------------------------------------------------------------------------------
+timeStamp=$(date +%Y-%m-%d)
+packExt=tgz
+packBase=${packDir}_${timeStamp}
 
 # add optional output directory
-if [ -d "$1" ]
-then
-    packFile="$1/$packFile"
-fi
+[ -d "$outputDir" ] && packBase="$outputDir/$packBase"
+packFile=$packBase.$packExt
 
+# avoid overwriting old pack file
 if [ -f $packFile ]
 then
     echo "Error: $packFile already exists"
     exit 1
 fi
 
-# Create time stamp file
-# ~~~~~~~~~~~~~~~~~~~~~~
 
-echo $timeStamp 2>/dev/null > $packDir/.timeStamp
-
-# Pack and compress the packFile
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-
-echo
-echo "Packing $packDir source files into $packFile"
-echo
+#------------------------------------------------------------------------------
 
-foamPackSource $packDir $packFile
+# add time-stamp file before packing
+echo $timeStamp 2>/dev/null > $packDir/.timeStamp
+echo "pack manually" 1>&2
+$toolsDir/foamPackSource $packDir $packFile
 
 #------------------------------------------------------------------------------
diff --git a/bin/foamPackThirdPartyBin b/bin/foamPackThirdPartyBin
deleted file mode 100755
index 8e478ddcd49b948aae6a134e9deaae71e65ffbf0..0000000000000000000000000000000000000000
--- a/bin/foamPackThirdPartyBin
+++ /dev/null
@@ -1,88 +0,0 @@
-#!/bin/sh
-#------------------------------------------------------------------------------
-# =========                 |
-# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-#  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 1991-2010 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
-#     foamPackThirdPartyBin <archOptions> [outputDir]
-#
-# Description
-#     Packs and compresses binary version of OpenFOAM ThirdParty for release
-#
-#------------------------------------------------------------------------------
-
-if [ $# -eq 0 ]
-then
-    echo "Error: archOptions type expected, exiting"
-    echo
-    echo "Usage : ${0##*/} <archOptions> [outputDir]"
-    echo
-    exit 1
-fi
-archOptions=$1
-arch=${archOptions%%G*}  # TODO: works for Gcc only
-arch3264=$(echo "$arch" | sed -e 's@64@-64@')
-
-echo "archOptions=$archOptions"
-echo "arch=$arch"
-echo "arch3264=$arch3264"
-
-timeStamp=$(date +%Y-%m-%d)
-packDir=${WM_THIRD_PARTY_DIR:-ThirdParty}
-packDir=${packDir##*/}
-packFile=${packDir}.${archOptions}_${timeStamp}.gtgz
-
-if [ ! -d $packDir ]
-then
-    echo "Error: directory $packDir does not exist"
-    exit 1
-fi
-
-# add optional output directory
-if [ -d "$2" ]
-then
-    packFile="$2/$packFile"
-fi
-
-if [ -f $packFile ]
-then
-    echo "Error: $packFile already exists"
-    exit 1
-fi
-
-# get list of directories
-dirList=`find $packDir -type d -name $arch -o -type d -name $archOptions'*' -o -type l -name $arch3264`
-echo
-echo "Packing $archOptions port of $packDir into $packFile"
-echo
-
-tar czpf $packFile $dirList
-
-if [ $? -eq 0 ]
-then
-    echo "Finished packing and compressing file $packFile"
-else
-    echo "Error: failure packing $packFile"
-    rm -f $packFile 2>/dev/null
-fi
-
-#------------------------------------------------------------------------------
diff --git a/bin/foamPackThirdPartyBin b/bin/foamPackThirdPartyBin
new file mode 120000
index 0000000000000000000000000000000000000000..4841836eb6bbfc8fc3a822e242ee8974357770e9
--- /dev/null
+++ b/bin/foamPackThirdPartyBin
@@ -0,0 +1 @@
+foamPackBin
\ No newline at end of file
diff --git a/bin/foamPackThirdPartyBinAll b/bin/foamPackThirdPartyBinAll
new file mode 120000
index 0000000000000000000000000000000000000000..d37f60a48ac388b34e6eb1f4b31e885f7205b79e
--- /dev/null
+++ b/bin/foamPackThirdPartyBinAll
@@ -0,0 +1 @@
+foamPackBinAll
\ No newline at end of file
diff --git a/bin/foamSourceFiles b/bin/foamSourceFiles
deleted file mode 100755
index f20e7927ce754504ddd95610c269e6dee0d3b979..0000000000000000000000000000000000000000
--- a/bin/foamSourceFiles
+++ /dev/null
@@ -1,81 +0,0 @@
-#!/bin/sh
-#---------------------------------*- sh -*-------------------------------------
-# =========                 |
-# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-#  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 1991-2010 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
-#     foamSourceFiles <directory>
-#
-# Description
-#     Returns all the .C and .H files and Make/options
-#     and Make/files in a given directory.
-#
-#------------------------------------------------------------------------------
-
-if [ $# -ne 1 ]
-then
-    echo "Usage : ${0##*/} directory"
-    echo ""
-    echo "Returns all .C and .H files and Make/options and Make/files."
-    echo ""
-    exit 1
-fi
-
-# canonical form (no double and no trailing dashes)
-packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@')
-
-if [ ! -d $packDir ]
-then
-    echo "Error: directory $packDir does not exist"
-    exit 1
-fi
-
-find -H $packDir               \
-    ! -type d                  \
-   \( -type f -o -type l \)    \
-    ! -name "*~"               \
- -a ! -name ".*~"              \
- -a ! -name "*.orig"           \
- -a ! -name "*.dep"            \
- -a ! -name "*.o"              \
- -a ! -name "*.so"             \
- -a ! -name "*.a"              \
- -a ! -name "*.tgz"            \
- -a ! -name "core"             \
- -a ! -name "core.[1-9]*"      \
- -a ! -name "libccmio*"        \
-| sed                          \
- -e "\@$packDir/lib/@d"        \
- -e '\@/\.git/@d'              \
- -e '\@/\.gitignore@d'         \
- -e '\@/\.tags/@d'             \
- -e '\@/\README\.org@d'        \
- -e '\@applications/bin/@d'    \
- -e '\@wmake/bin/@d'           \
- -e '\@/t/@d'                  \
- -e '\@/Make[.A-Za-z]*/[^/]*/@d'\
- -e '\@/platforms/@d'          \
- -e '\@/download/@d'           \
- -e '\@/libccmio-.*/@d'        \
- -e '\@/debian/@d'
-
-#------------------------------------------------------------------------------
diff --git a/bin/tools/CleanFunctions b/bin/tools/CleanFunctions
index bc5c81e94de6bf06f94a4b563d493903637cae7d..11185647041334e3235e0b50c6f4341ab620726d 100644
--- a/bin/tools/CleanFunctions
+++ b/bin/tools/CleanFunctions
@@ -2,7 +2,7 @@
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+#   \\  /    A nd           | Copyright (C) 2008-2011 OpenCFD Ltd.
 #    \\/     M anipulation  |
 #------------------------------------------------------------------------------
 # License
@@ -25,7 +25,7 @@
 #     CleanFunctions
 #
 # Description
-#
+#     Miscellaneous cleanup functions for tutorial cases
 #------------------------------------------------------------------------------
 
 #cleanTimeDirectories()
@@ -46,15 +46,12 @@
 cleanTimeDirectories()
 {
     echo "Cleaning $PWD case"
-    nZeros=0
     zeros=""
-    while [ $nZeros -lt 8 ]
+    while [ ${#zeros} -lt 8 ]
     do
         timeDir="0.${zeros}[1-9]*"
-        rm -rf ${timeDir} > /dev/null 2>&1
-        rm -rf ./-${timeDir} > /dev/null 2>&1
-        zeros=`printf %0${nZeros}d 0`
-        nZeros=$(($nZeros + 1))
+        rm -rf ./${timeDir} ./-${timeDir} > /dev/null 2>&1
+        zeros="0$zeros"
     done
     rm -rf ./[1-9]* ./-[1-9]* ./log ./log.* ./log-* ./logSummary.* ./.fxLock ./*.xml ./ParaView* ./paraFoam* ./*.OpenFOAM > /dev/null 2>&1
 }
diff --git a/bin/tools/RunFunctions b/bin/tools/RunFunctions
index 20a9cd080c10cc036be9a38fbe24b7543808e55c..bfaf58c39caf1b825d8e2b1b0a87c79a338d3031 100644
--- a/bin/tools/RunFunctions
+++ b/bin/tools/RunFunctions
@@ -2,7 +2,7 @@
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+#   \\  /    A nd           | Copyright (C) 2008-2011 OpenCFD Ltd.
 #    \\/     M anipulation  |
 #------------------------------------------------------------------------------
 # License
@@ -25,23 +25,23 @@
 #     RunFunctions
 #
 # Description
-#
+#     Miscellaneous functions for running tutorial cases
 #------------------------------------------------------------------------------
 
 getApplication()
 {
-    grep application system/controlDict | sed "s/application *\([a-zA-Z]*\);/\1/"
+    sed -ne 's/^ *application *\([a-zA-Z]*\) *;.*$/\1/p' system/controlDict
 }
 
 runApplication()
 {
     APP_RUN=$1
+    APP_NAME=${1##*/}
     shift
-    APP_NAME=${APP_RUN##*/}
 
     if [ -f log.$APP_NAME ]
     then
-        echo "$APP_NAME already run on $PWD: remove log file to run"
+        echo "$APP_NAME already run on $PWD: remove log file to re-run"
     else
         echo "Running $APP_RUN on $PWD"
         $APP_RUN $* > log.$APP_NAME 2>&1
@@ -51,16 +51,17 @@ runApplication()
 runParallel()
 {
     APP_RUN=$1
+    APP_NAME=${1##*/}
     shift
 
-    if [ -f $log.$APP_RUN ]
+    if [ -f log.$APP_NAME ]
     then
-        echo "$APP_RUN already run on $PWD: remove log file to run"
+        echo "$APP_NAME already run on $PWD: remove log file to re-run"
     else
         nProcs=$1
         shift
         echo "Running $APP_RUN in parallel on $PWD using $nProcs processes"
-        ( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_RUN 2>&1 )
+        ( mpirun -np $nProcs $APP_RUN -parallel $* < /dev/null > log.$APP_NAME 2>&1 )
     fi
 }
 
diff --git a/bin/tools/foamConfigurePaths b/bin/tools/foamConfigurePaths
index 2b7bf40bad3ef3fb64b56ac10d329d3bdd7090e5..acaa5455aad742257aa35132712b63a27ddddfbf 100644
--- a/bin/tools/foamConfigurePaths
+++ b/bin/tools/foamConfigurePaths
@@ -50,15 +50,30 @@ USAGE
 # inlineSed <file> <sedCommand> <description>
 _inlineSed()
 {
-    backup=`tempfile`
+    [ -f "$1" ] || {
+        echo "Missing file: $1"
+        exit 1
+    }
+
+    backup="temp.$$"
     cp $1 $backup
     sed -i -e "$2" $1
-    cmp --quiet $1 $backup && usage "Failed : $3"
+
+    if cmp $1 $backup > /dev/null 2>&1
+    then
+        echo "Failed: $3 in $1"
+        rm $backup 2>/dev/null
+        exit 1
+    else
+        echo "Okay: $3 in $1"
+        rm $backup 2>/dev/null
+    fi
+
     return 0
 }
 
 
-[ -f etc/bashrc -a -f etc/settings.sh ] || usage "Please run from top-level directory of installation"
+[ -f etc/bashrc ] || usage "Please run from top-level directory of installation"
 
 unset foamInstall projectName archOption paraviewInstall
 
@@ -66,43 +81,47 @@ unset foamInstall projectName archOption paraviewInstall
 while [ "$#" -gt 0 ]
 do
     case "$1" in
-    -h | --help)
+    -h | -help | --help)
         usage
         ;;
-    --foamInstall)
+    -foamInstall | --foamInstall)
         [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
         foamInstall="$2"
+        # replace foamInstall=...
         _inlineSed \
             etc/bashrc \
             '/^[^#]/s@foamInstall=.*@foamInstall='"$foamInstall@" \
-            "Replacing foamInstall setting by $foamInstall"
+            "Replacing foamInstall setting by '$foamInstall'"
         shift 2
         ;;
-   --projectName)
+   -projectName | --projectName)
         [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
         projectName="$2"
+        # replace WM_PROJECT_DIR=...
         _inlineSed \
             etc/bashrc \
             '/^[^#]/s@WM_PROJECT_DIR=.*@WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/'"$projectName@" \
-            "Replacing WM_PROJECT_DIR setting by $projectName"
+            "Replacing WM_PROJECT_DIR setting by '$projectName'"
         shift 2
         ;;
-    --archOption)
+    -archOption | --archOption)
         [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
         archOption="$2"
+        # replace WM_ARCH_OPTION=...
         _inlineSed \
             etc/bashrc \
-            '/^[^#]/s@: ${WM_ARCH_OPTION:=64}@WM_ARCH_OPTION='"$archOption@" \
-             "Replacing WM_ARCH_OPTION setting by $archOption"
+            '/^[^#]/s@WM_ARCH_OPTION=.*@WM_ARCH_OPTION='"$archOption@" \
+             "Replacing WM_ARCH_OPTION setting by '$archOption'"
         shift 2
         ;;
-    --paraviewInstall)
+    -paraviewInstall | --paraviewInstall)
         [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
         paraviewInstall="$2"
+        # replace ParaView_DIR=...
         _inlineSed \
             etc/apps/paraview3/bashrc \
             '/^[^#]/s@ParaView_DIR=.*@ParaView_DIR='"$paraviewInstall@" \
-             "Replacing ParaView_DIR setting by $paraviewInstall"
+             "Replacing ParaView_DIR setting by '$paraviewInstall'"
         shift 2
         ;;
     *)
@@ -113,18 +132,19 @@ done
 
 [ -n "$foamInstall" -o -n "$projectName" -o -n "$archOption"  -o -n "$paraviewInstall" ] || usage "Please specify at least one configure option"
 
-#echo "Replacing WM_PROJECT setting by $projectName"
+#echo "Replacing WM_PROJECT setting by '$projectName'"
 #sed -i -e 's@WM_PROJECT=.*@WM_PROJECT='"$projectName@" etc/bashrc
 
-# Replace the WM_MPLIB always
+# Set WM_MPLIB=SYSTEMOPENMPI always
 _inlineSed \
     etc/bashrc \
-    '/^[^#]/s@: ${WM_MPLIB:=.*}@WM_MPLIB=SYSTEMOPENMPI@' \
-    "Replacing WM_MPLIB setting by SYSTEMOPENMPI"
-# Replace the compilerInstall always
+    '/^[^#]/s@export WM_MPLIB=.*@export WM_MPLIB=SYSTEMOPENMPI@' \
+    "Replacing WM_MPLIB setting by 'SYSTEMOPENMPI'"
+
+# set foamCompiler=system always
 _inlineSed \
-    etc/settings.sh \
-    '/^[^#]/s@: ${compilerInstall:=.*}@compilerInstall=system@' \
-    "Replacing compilerInstall setting by system"
+    etc/bashrc \
+    '/^[^#]/s@foamCompiler=.*@foamCompiler=system@' \
+    "Replacing foamCompiler setting by 'system'"
 
 #------------------------------------------------------------------------------
diff --git a/bin/tools/foamListBinDirs b/bin/tools/foamListBinDirs
new file mode 100755
index 0000000000000000000000000000000000000000..ac67b796d045e05bd34ead416cc1f2b64ed1ce4f
--- /dev/null
+++ b/bin/tools/foamListBinDirs
@@ -0,0 +1,121 @@
+#!/bin/sh
+#------------------------------------------------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 1991-2011 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
+#     foamListBinDirs <directory> <archOptions>
+#
+# Description
+#     Lists directories containing binary files of OpenFOAM
+#
+# Note
+#     Not normally called directly by the user.
+#------------------------------------------------------------------------------
+toolsDir="${0%/*}"  # this script is already located in the tools/ directory
+
+[ $# -eq 2 ] || {
+cat <<USAGE 1>&2
+Usage : ${0##*/} <packDir> <archOptions>
+
+* Lists directories containing binary files for OpenFOAM
+
+    The value of 'archOptions' normally corresponds to \$WM_OPTIONS
+    The current value of \$WM_OPTIONS = $WM_OPTIONS
+
+USAGE
+    exit 1
+}
+
+#------------------------------------------------------------------------------
+packDir="$1"
+
+# same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
+archOptions="$2"
+
+# base arch (w/o precision, optimization, etc)
+# same as "$WM_ARCH$WM_COMPILER"
+archCompiler=$(echo "$archOptions" | sed -e 's@[DS]P.*$@@')
+
+# same as $WM_ARCH - eg, 'linux64'
+# TODO: only works for Gcc, Icc, Clang
+archOS=$(echo "$archOptions" | sed -e 's@[GI]cc.*$@@' -e 's@Clang.*$@@')
+
+# links for 32-bit version, eg convert linux64 -> linux-64
+arch3264=$(echo "$archOS" | sed -e 's@64@-64@')
+
+
+#------------------------------------------------------------------------------
+
+# check for essential directories
+for dir in $packDir $packDir/lib/$archOptions
+do
+    [ -d $dir ] || {
+        echo "Error: directory $dir does not exist" 1>&2
+        exit 1
+    }
+done
+
+# check new/old places for executables - same as $FOAM_APPBIN
+[ -d $packDir/bin/$archOptions -o -d $packDir/applications/bin/$archOptions ] || {
+cat <<BIN_CHECK 1>&2
+Error: no directory for executables exists:
+    $packDir/bin/$archOptions
+    $packDir/applications/bin/$archOptions
+BIN_CHECK
+    exit 1
+}
+
+
+#------------------------------------------------------------------------------
+# list of directories
+dirList=$(
+    for dir in \
+        $packDir/bin/$archOptions \
+        $packDir/lib/$archOptions \
+        $packDir/applications/bin/$archOptions \
+        $packDir/wmake/bin/$archCompiler \
+        $packDir/wmake/bin/$archOS \
+        $packDir/wmake/rules/General \
+        $packDir/wmake/rules/$archCompiler \
+        $packDir/wmake/rules/$archOS \
+        ;
+    do
+        [ -d $dir ] && echo $dir
+    done
+)
+
+
+cat <<INFO 1>&2
+-------------------------------------------------------------------------------
+Packing $archOptions ($archCompiler) port of $packDir
+    archOS       = $archOS
+    32bit archOS = $arch3264
+
+dirs:
+    $(echo ${dirList:-NONE})
+
+INFO
+
+echo "$dirList"
+
+#------------------------------------------------------------------------------
diff --git a/bin/tools/foamListSourceFiles b/bin/tools/foamListSourceFiles
new file mode 100755
index 0000000000000000000000000000000000000000..81e299c4a15f0d4967785178465ac90a95d836e5
--- /dev/null
+++ b/bin/tools/foamListSourceFiles
@@ -0,0 +1,93 @@
+#!/bin/sh
+#------------------------------------------------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 1991-2011 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
+#     foamListSourceFiles <directory>
+#
+# Description
+#     Lists source files and Make/{files,options} in given directory
+#
+# Note
+#     Not normally called directly by the user.
+#------------------------------------------------------------------------------
+
+[ $# -eq 1 ] || {
+cat <<USAGE 1>&2
+Usage : ${0##*/} directory
+
+* Lists source files and Make/{files,options} in given directory
+
+USAGE
+    exit 1
+}
+
+# canonical form (no double and no trailing dashes)
+packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@')
+
+# check for essential directories
+[ -d $packDir ] || {
+    echo "Error: directory $packDir does not exist" 1>&2
+    exit 1
+}
+
+
+#
+# list of files but excluding
+# - dependent files (dep, obj, lib), archives
+# - exclude Doxygen documentation etc
+#
+
+find -H $packDir                                                              \
+    ! -type d                                                                 \
+   \( -type f -o -type l \)                                                   \
+    ! -name "*~"                                                              \
+ -a ! -name ".*~"                                                             \
+ -a ! -name "*.orig"                                                          \
+ -a ! -name "*.dep"                                                           \
+ -a ! -name "*.o"                                                             \
+ -a ! -name "*.so"                                                            \
+ -a ! -name "*.a"                                                             \
+ -a ! -name "*.tar"                                                           \
+ -a ! -name "*.tar.gz"                                                        \
+ -a ! -name "*.tgz"                                                           \
+ -a ! -name "core"                                                            \
+ -a ! -name "core.[1-9]*"                                                     \
+ -a ! -name "libccmio*"                                                       \
+| sed                                                                         \
+ -e "\@$packDir/lib/@d"                                                       \
+ -e '\@/\.git/@d'                                                             \
+ -e '\@/\.tags/@d'                                                            \
+ -e '\@/README\.org@d'                                                        \
+ -e '\@/bin/[^/]*/@{ \@/bin/tools/@!d }'                                      \
+ -e '\@/lib/@d'                                                               \
+ -e '\@/platforms/@d'                                                         \
+ -e '\@/t/@d'                                                                 \
+ -e '\@/Make[.A-Za-z]*/[^/]*/@d'                                              \
+ -e '\@/[Dd]oxygen/html/@d'                                                   \
+ -e '\@/download/@d'                                                          \
+ -e '\@/libccmio-.*/@d'                                                       \
+ -e '\@/debian/@d'
+
+
+#------------------------------------------------------------------------------
diff --git a/bin/tools/foamListThirdPartyBinDirs b/bin/tools/foamListThirdPartyBinDirs
new file mode 100755
index 0000000000000000000000000000000000000000..319961b944173c234be9971193e8c7af8af066ad
--- /dev/null
+++ b/bin/tools/foamListThirdPartyBinDirs
@@ -0,0 +1,121 @@
+#!/bin/sh
+#------------------------------------------------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2011-2011 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
+#     foamListThirdPartyBinDirs <directory> <archOptions>
+#
+# Description
+#     Lists directories containing binary files for OpenFOAM ThirdParty
+#
+# Note
+#     Not normally called directly by the user.
+#------------------------------------------------------------------------------
+toolsDir="${0%/*}"  # this script is already located in the tools/ directory
+
+[ $# -eq 2 ] || {
+cat <<USAGE 1>&2
+Usage : ${0##*/} <packDir> <archOptions>
+
+* List directories containing binary files for OpenFOAM ThirdParty
+
+    The value of 'archOptions' normally corresponds to \$WM_OPTIONS
+    The current value of \$WM_OPTIONS = $WM_OPTIONS
+
+USAGE
+    exit 1
+}
+
+#------------------------------------------------------------------------------
+packDir="$1"
+
+# same as $WM_OPTIONS - eg, 'linux64GccDPOpt'
+archOptions="$2"
+
+# base arch (w/o precision, optimization, etc)
+# same as "$WM_ARCH$WM_COMPILER"
+archCompiler=$(echo "$archOptions" | sed -e 's@[DS]P.*$@@')
+
+# same as $WM_ARCH - eg, 'linux64'
+# TODO: only works for Gcc, Icc, Clang
+archOS=$(echo "$archOptions" | sed -e 's@[GI]cc.*$@@' -e 's@Clang.*$@@')
+
+# links for 32-bit version, eg convert linux64 -> linux-64
+arch3264=$(echo "$archOS" | sed -e 's@64@-64@')
+
+
+#------------------------------------------------------------------------------
+# check for essential directories
+for dir in $packDir $packDir/lib/$archOptions
+do
+    [ -d $dir ] || {
+        echo "Error: directory $dir does not exist" 1>&2
+        exit 1
+    }
+done
+
+#------------------------------------------------------------------------------
+# list of directories
+dirList=$(
+    for dir in \
+        $packDir/bin/$archOptions \
+        $packDir/bin/$archCompiler \
+        $packDir/bin/$archOS \
+        $packDir/lib/$archOptions \
+        $packDir/lib/$archCompiler \
+        $packDir/lib/$archOS \
+        $packDir/platforms/$archOptions \
+        $packDir/platforms/$archCompiler \
+        $packDir/platforms/$archOS \
+        ;
+    do
+        [ -d $dir ] && echo $dir
+    done
+
+    # add in links for 32-bit version
+    if [ "$archOS" != "$arch3264" ]
+    then
+        for dir in \
+            $packDir/platforms/$arch3264 \
+            ;
+        do
+            [ -d $dir -a -L $dir ] && echo $dir
+        done
+     fi
+)
+
+
+cat <<INFO 1>&2
+-------------------------------------------------------------------------------
+Packing $archOptions ($archCompiler) port of $packDir
+    archOS       = $archOS
+    32bit archOS = $arch3264
+
+dirs:
+    $(echo ${dirList:-NONE})
+
+INFO
+
+echo "$dirList"
+
+#------------------------------------------------------------------------------
diff --git a/bin/foamPackSource b/bin/tools/foamPackSource
similarity index 61%
rename from bin/foamPackSource
rename to bin/tools/foamPackSource
index 8305a929a8251208ebcc5a71ce1dcd04a6d7cd10..3f6d547895c2217554343cdcf5da0f0ece3a0ef8 100755
--- a/bin/foamPackSource
+++ b/bin/tools/foamPackSource
@@ -3,7 +3,7 @@
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+#   \\  /    A nd           | Copyright (C) 1991-2011 OpenCFD Ltd.
 #    \\/     M anipulation  |
 #-------------------------------------------------------------------------------
 # License
@@ -26,54 +26,67 @@
 #     foamPackSource <directory> <tarFile>
 #
 # Description
-#     Packs and compresses the .C and .H files and Make/options
-#     and Make/files in a given directory.
+#     Pack and compress all source files from a given directory.
 #
+# Note
+#     Not normally called directly by the user
 #------------------------------------------------------------------------------
 tmpFile=${TMPDIR:-/tmp}/foamPackFiles.$$
+toolsDir="${0%/*}"  # this script is already located in the tools/ directory
 
-if [ $# -ne 2 ]
-then
-    echo "Usage : ${0##*/} directory tarFile"
-    echo ""
-    echo "Packs all .C and .H files and Make/options and Make/files into"
-    echo "<tarFile>"
-    echo ""
+[ $# -eq 2 ] || {
+cat <<USAGE 1>&2
+Usage : ${0##*/} directory tarFile
+
+* Pack and compress all source files from a given directory into <tarFile>
+
+USAGE
     exit 1
-fi
+}
 
 # canonical form (no double and no trailing dashes)
 packDir=$(echo "$1" | sed -e 's@//*@/@g' -e 's@/$@@')
 packFile=$2
 
-if [ ! -d $packDir ]
-then
-    echo "Error: directory $packDir does not exist"
+# check for essential directories
+[ -d $packDir ] || {
+    echo "Error: directory $packDir does not exist" 1>&2
     exit 1
-fi
+}
+
 
+# avoid overwriting old pack file
 if [ -f $packFile ]
 then
-    echo "Error: $packFile already exists"
+    echo "Error: $packFile already exists" 1>&2
     exit 1
 fi
 
 # Clean up on termination and on Ctrl-C
 trap 'rm -f $tmpFile 2>/dev/null; exit 0' EXIT TERM INT
 
-foamSourceFiles $packDir > $tmpFile
+# get all names
+$toolsDir/foamListSourceFiles $packDir > $tmpFile
 
 
 # provide some feedback
-wc $tmpFile | awk '{print "Packing",$1,"files - this could take some time ..."}'
+cat <<INFO 1>&2
+-------------------------------------------------------------------------------
+Packing $packDir source files into $packFile
+
+INFO
+wc $tmpFile | awk '{print "Packing",$1,"files - this could take some time ..."}' 1>&2
+
 
-tar czpf $packFile --files-from $tmpFile
+# Clean up on Ctrl-C
+trap 'rm -f $packFile $tmpFile 2>/dev/null' INT
 
+tar cpzf $packFile --files-from $tmpFile
 if [ $? -eq 0 ]
 then
-    echo "Finished packing and compressing $packDir into file $packFile"
+    echo "Finished packing $packDir into file $packFile" 1>&2
 else
-    echo "Error: failure packing $packDir into file $packFile"
+    echo "Error: failure packing $packDir into file $packFile" 1>&2
     rm -f $packFile 2>/dev/null
 fi
 
diff --git a/doc/doxygen/css/doxyTabs.css b/doc/doxygen/css/doxyTabs.css
index 1cc5525827bbbf7270e1e4ede0aa27ab87898613..58f32ccf4127128f36340f18f6e58a9ea0f24a0e 100644
--- a/doc/doxygen/css/doxyTabs.css
+++ b/doc/doxygen/css/doxyTabs.css
@@ -11,7 +11,8 @@ div.navigation
 }
 
 
-div.tabs
+div.tabs,
+div.tabs2
 {
     width           : 100%;
     padding-top     : 5px;
@@ -20,7 +21,8 @@ div.tabs
     border-bottom: 1px solid rgb(175,175,175);
 }
 
-div.tabs ul
+div.tabs ul,
+div.tabs2 ul
 {
     margin: 0px;
     padding-left: 10px;
@@ -30,26 +32,30 @@ div.tabs ul
 }
 
 
-div.tabs li, div.tabs form
+div.tabs li, div.tabs form,
+div.tabs2 li, div.tabs2 form
 {
     display         : inline;
     margin          : 0px;
     padding         : 0px;
 }
 
-div.tabs ul li
+div.tabs ul li,
+div.tabs2 ul li
 {
     padding-top: 10px;
     padding-bottom: 10px;
     height: 100%;
 }
 
-div.tabs form
+div.tabs form,
+div.tabs2 form
 {
     padding         : 0px 9px;
 }
 
-div.tabs a
+div.tabs a,
+div.tabs2 a
 {
     font-size       : 12px;
     font-weight     : normal;
@@ -58,7 +64,8 @@ div.tabs a
 }
 
 /* not needed - no image */
-div.tabs a:hover
+div.tabs a:hover,
+div.tabs2 a:hover
 {
     background-position: 100% -150px;
 }
@@ -66,13 +73,18 @@ div.tabs a:hover
 div.tabs a:link,
 div.tabs a:visited,
 div.tabs a:active,
-div.tabs a:hover
+div.tabs a:hover,
+div.tabs2 a:link,
+div.tabs2 a:visited,
+div.tabs2 a:active,
+div.tabs2 a:hover
 {
     color           : #000000;
     color:#555;
 }
 
-div.tabs span
+div.tabs span,
+div.tabs2 span
 {
     display         : inline;
     padding         : 0px 9px;
@@ -80,7 +92,8 @@ div.tabs span
 }
 
 /* client-side search */
-div.tabs #MSearchBox
+div.tabs #MSearchBox,
+div.tabs2 #MSearchBox
 {
    float            : right;
    background       : white;
@@ -88,7 +101,8 @@ div.tabs #MSearchBox
    font-size        : 1em;
 }
 
-div.tabs #MSearchSelect
+div.tabs #MSearchSelect,
+div.tabs2 #MSearchSelect
 {
    float            : left;
    display          : inline;
@@ -96,14 +110,16 @@ div.tabs #MSearchSelect
 }
 
 /* old name? */
-div.tabs input
+div.tabs input,
+div.tabs2 input
 {
     float           : right;
     display         : inline;
     font-size       : 1em;
 }
 
-div.tabs td
+div.tabs td,
+div.tabs2 td
 {
     font-size       : 80%;
     font-weight     : bold;
@@ -120,14 +136,16 @@ div.tabs a:hover span
     background-position: 0% -150px;
 }
 
-div.tabs li.current a
+div.tabs li.current a,
+div.tabs2 li.current a
 {
     border-width    : 0px;
     border-right: 1px solid rgb(175,175,175);
     color           : #555;
 }
 
-div.tabs li.current span
+div.tabs li.current span,
+div.tabs2 li.current span
 {
     padding-bottom: 0px;
     white-space: nowrap;
diff --git a/etc/apps/paraview3/bashrc b/etc/apps/paraview3/bashrc
index 5487d2e8db113fc891775931d428be6c07824daf..1387f08d9e87ed00d061aa0871f85bb37264b87d 100644
--- a/etc/apps/paraview3/bashrc
+++ b/etc/apps/paraview3/bashrc
@@ -26,7 +26,7 @@
 #
 # Description
 #     Setup file for paraview-3.x
-#     Sourced from OpenFOAM-*/etc/bashrc or from foamPV alias
+#     Sourced from OpenFOAM-<VERSION>/etc/bashrc or from foamPV alias
 #
 # Note
 #     The env. variables 'ParaView_DIR' and 'ParaView_MAJOR'
@@ -38,7 +38,7 @@ cleaned=`$WM_PROJECT_DIR/bin/foamCleanPath "$PATH" "$WM_THIRD_PARTY_DIR/platform
 
 # determine the cmake to be used
 unset CMAKE_HOME
-for cmake in cmake-2.8.3 cmake-2.8.1 cmake-2.8.0 cmake-2.6.4
+for cmake in cmake-2.8.3 cmake-2.8.1
 do
     cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
     if [ -r $cmake ]
@@ -51,8 +51,14 @@ done
 
 
 # set VERSION and MAJOR (version) variables
-ParaView_VERSION=3.8.0
-ParaView_MAJOR=unknown
+if [ -z "$ParaView_VERSION" ]
+then
+    ParaView_VERSION=3.8.0
+    ParaView_MAJOR=unknown
+    echo "Warning in app/paraview3/bashrc:" 1>&2
+    echo "    ParaView_VERSION not set, using '$ParaView_VERSION'" 1>&2
+fi
+[ -n "$ParaView_MAJOR" ] || ParaView_MAJOR=unknown
 
 # if needed, set MAJOR version to correspond to VERSION
 # ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
@@ -76,7 +82,7 @@ if [ -r $ParaView_DIR -o -r $paraviewInstDir ]
 then
     export PATH=$ParaView_DIR/bin:$PATH
     export LD_LIBRARY_PATH=$ParaView_DIR/lib/paraview-$ParaView_MAJOR:$LD_LIBRARY_PATH
-    export PV_PLUGIN_PATH=$FOAM_LIBBIN/paraview-$ParaView_MAJOR
+    export PV_PLUGIN_PATH=$FOAM_EXT_LIBBIN/paraview-$ParaView_MAJOR
 
     # add in python libraries if required
     paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
diff --git a/etc/apps/paraview3/cshrc b/etc/apps/paraview3/cshrc
index 850eb78d27983bbbef90f55332c185c60fedb5f4..96f404db4673d86d37bead07c97bff7be5fff902 100644
--- a/etc/apps/paraview3/cshrc
+++ b/etc/apps/paraview3/cshrc
@@ -26,7 +26,7 @@
 #
 # Description
 #     Setup file for paraview-3.x
-#     Sourced from OpenFOAM-*/etc/cshrc or from foamPV alias
+#     Sourced from OpenFOAM-<VERSION>/etc/cshrc or from foamPV alias
 #
 # Note
 #     The env. variables 'ParaView_DIR' and 'ParaView_MAJOR'
@@ -39,7 +39,7 @@ if ( $status == 0 ) setenv PATH $cleaned
 
 # determine the cmake to be used
 unsetenv CMAKE_HOME
-foreach cmake ( cmake-2.8.3 cmake-2.8.1 cmake-2.8.0 cmake-2.6.4 )
+foreach cmake ( cmake-2.8.3 cmake-2.8.1 )
     set cmake=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$cmake
     if ( -r $cmake ) then
         setenv CMAKE_HOME $cmake
@@ -49,8 +49,14 @@ foreach cmake ( cmake-2.8.3 cmake-2.8.1 cmake-2.8.0 cmake-2.6.4 )
 end
 
 # set VERSION and MAJOR (version) variables
-setenv ParaView_VERSION 3.8.0
-setenv ParaView_MAJOR unknown
+if ( ! $?ParaView_VERSION )
+then
+    setenv ParaView_VERSION 3.8.0
+    setenv ParaView_MAJOR unknown
+    echo "Warning in app/paraview3/cshrc:"
+    echo "    ParaView_VERSION not set, using '$ParaView_VERSION'"
+fi
+if ( ! $?ParaView_MAJOR ) setenv ParaView_MAJOR unknown
 
 # if needed, set MAJOR version to correspond to VERSION
 # ParaView_MAJOR is "<digits>.<digits>" from ParaView_VERSION
@@ -74,7 +80,7 @@ setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-
 if ( -r $ParaView_DIR || -r $paraviewInstDir ) then
     setenv PATH ${ParaView_DIR}/bin:${PATH}
     setenv LD_LIBRARY_PATH "${ParaView_DIR}/lib/paraview-${ParaView_MAJOR}:${LD_LIBRARY_PATH}"
-    setenv PV_PLUGIN_PATH $FOAM_LIBBIN/paraview-${ParaView_MAJOR}
+    setenv PV_PLUGIN_PATH $FOAM_EXT_LIBBIN/paraview-${ParaView_MAJOR}
 
     # add in python libraries if required
     set paraviewPython=$ParaView_DIR/Utilities/VTKPythonWrapping
diff --git a/etc/apps/scotch/bashrc b/etc/apps/scotch/bashrc
index 5058df0ed1a2187e1492fc24f153e94fbd2b463b..fcd19bfaa35cd49306fb7e6901c6efc948f1f82b 100644
--- a/etc/apps/scotch/bashrc
+++ b/etc/apps/scotch/bashrc
@@ -2,7 +2,7 @@
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+#   \\  /    A nd           | Copyright (C) 2010-2011 OpenCFD Ltd.
 #    \\/     M anipulation  |
 #------------------------------------------------------------------------------
 # License
@@ -33,7 +33,13 @@
 #     during the wmake process
 #------------------------------------------------------------------------------
 
-export SCOTCH_VERSION=scotch_5.1.10b
+export SCOTCH_VERSION=scotch_5.1.11
 export SCOTCH_ARCH_PATH=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/$SCOTCH_VERSION
 
+# mpi-qualified include directory
+export SCOTCH_MPI_INCLUDE=$SCOTCH_ARCH_PATH/include/${FOAM_MPI_LIBBIN##*/}
+
+# mpi-qualified lib directory
+export SCOTCH_MPI_LIBBIN=$SCOTCH_ARCH_PATH/lib/${FOAM_MPI_LIBBIN##*/}
+
 # -----------------------------------------------------------------------------
diff --git a/etc/bashrc b/etc/bashrc
index 2b0e3d0be71897e8f825e5d6dcb0a40f7a6b8f05..c95a7951bba68b7f91627faf5a9840a511e6ba7e 100644
--- a/etc/bashrc
+++ b/etc/bashrc
@@ -35,24 +35,73 @@ export WM_PROJECT=OpenFOAM
 export WM_PROJECT_VERSION=dev
 
 ################################################################################
-# USER EDITABLE PART. Note changes made here may be lost with the next upgrade
+# USER EDITABLE PART: Changes made here may be lost with the next upgrade
 #
 # either set $FOAM_INST_DIR before sourcing this file or set
-#    $foamInstall below to where OpenFOAM is installed
+# 'foamInstall' below to where OpenFOAM is installed
 #
 # Location of the OpenFOAM installation
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 foamInstall=$HOME/$WM_PROJECT
 # foamInstall=~$WM_PROJECT
-# foamInstall=/usr/local/$WM_PROJECT
 # foamInstall=/opt/$WM_PROJECT
+# foamInstall=/usr/local/$WM_PROJECT
 #
 # END OF (NORMAL) USER EDITABLE PART
 ################################################################################
 
-# note the location for later use (eg, in job scripts)
+#
+# These are the defaults for this version which should generally be
+# overridden from the prefs.sh file or from command-line specification
+#
+#- note the location for later use (eg, in job scripts)
 : ${FOAM_INST_DIR:=$foamInstall}; export FOAM_INST_DIR
 
+#- ParaView version, automatically determine major version:
+export ParaView_VERSION=3.8.0
+export ParaView_MAJOR=unknown
+
+#- Compiler location:
+#    foamCompiler= system | ThirdParty (OpenFOAM)
+foamCompiler=system
+
+#- Compiler:
+#    WM_COMPILER = Gcc | Gcc43 | Gcc44 | Gcc45 | Clang | Icc (Intel icc)
+export WM_COMPILER=Gcc
+unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
+
+#- Architecture:
+#    WM_ARCH_OPTION = 32 | 64
+export WM_ARCH_OPTION=64
+
+#- Precision:
+#    WM_PRECISION_OPTION = DP | SP
+export WM_PRECISION_OPTION=DP
+
+#- Optimised, debug, profiling:
+#    WM_COMPILE_OPTION = Opt | Debug | Prof
+export WM_COMPILE_OPTION=Opt
+
+#- MPI implementation:
+#    WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI
+#               | GAMMA | MPI | QSMPI
+export WM_MPLIB=OPENMPI
+
+#- Operating System:
+#    WM_OSTYPE = POSIX | ???
+export WM_OSTYPE=POSIX
+
+#- Floating-point signal handling:
+#    set or unset
+export FOAM_SIGFPE=
+
+#- memory initialisation:
+#    set or unset
+#export FOAM_SETNAN=
+
+
+################################################################################
+
 # The old dirs to be cleaned from the various environment variables
 # - remove anything under top-level directory.
 # NB: the WM_PROJECT_INST_DIR might not be identical between versions
@@ -90,6 +139,7 @@ _foamSource()
 _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.sh`
 
 # Evaluate command-line parameters and record settings for later
+# these can be used to set/unset values, or specify prefs files
 export FOAM_SETTINGS="$@"
 while [ $# -gt 0 ]
 do
@@ -116,41 +166,6 @@ do
 done
 
 
-# Operating System/Platform
-# ~~~~~~~~~~~~~~~~~~~~~~~~~
-# WM_OSTYPE = POSIX | ????
-: ${WM_OSTYPE:=POSIX}; export WM_OSTYPE
-
-
-# Compiler: set to Gcc, Gcc43, Gcc44, or Icc (for Intel's icc)
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-: ${WM_COMPILER:=Gcc}; export WM_COMPILER
-
-unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
-
-
-# Compilation options (architecture, precision, optimised, debug or profiling)
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-# WM_ARCH_OPTION = 32 | 64
-: ${WM_ARCH_OPTION:=64}; export WM_ARCH_OPTION
-
-# WM_PRECISION_OPTION = DP | SP
-: ${WM_PRECISION_OPTION:=DP}; export WM_PRECISION_OPTION
-
-# WM_COMPILE_OPTION = Opt | Debug | Prof
-: ${WM_COMPILE_OPTION:=Opt}; export WM_COMPILE_OPTION
-
-# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA
-#                          | MPI | QSMPI
-: ${WM_MPLIB:=OPENMPI}; export WM_MPLIB
-
-
-# Run options (floating-point signal handling and memory initialisation)
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-export FOAM_SIGFPE=
-# export FOAM_SETNAN=
-
-
 # Detect system type and set environment variables appropriately
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 export WM_ARCH=`uname -s`
@@ -165,7 +180,7 @@ Linux)
         ;;
 
     x86_64)
-        case $WM_ARCH_OPTION in
+        case "$WM_ARCH_OPTION" in
         32)
             export WM_COMPILER_ARCH='-64'
             export WM_CC='gcc'
@@ -196,13 +211,13 @@ Linux)
 
     mips64)
         WM_ARCH=SiCortex64
+        WM_MPLIB=MPI
         export WM_COMPILER_LIB_ARCH=64
         export WM_CC='gcc'
         export WM_CXX='g++'
         export WM_CFLAGS='-mabi=64 -fPIC'
         export WM_CXXFLAGS='-mabi=64 -fPIC'
         export WM_LDFLAGS='-mabi=64 -G0'
-        export WM_MPLIB=MPI
         ;;
 
     ppc64)
@@ -223,13 +238,13 @@ Linux)
 
 SunOS)
     WM_ARCH=SunOS64
+    WM_MPLIB=FJMPI
     export WM_COMPILER_LIB_ARCH=64
     export WM_CC='gcc'
     export WM_CXX='g++'
     export WM_CFLAGS='-mabi=64 -fPIC'
     export WM_CXXFLAGS='-mabi=64 -fPIC'
     export WM_LDFLAGS='-mabi=64 -G0'
-    export WM_MPLIB=FJMPI
     ;;
 
 *)    # an unsupported operating system
diff --git a/etc/codeTemplates/foamScript b/etc/codeTemplates/foamScript
index 57c5f68d4a4197385d6d1e3772d794e2fa6f23a2..21d54cf40019a0d2344d14815e924e711a5c5949 100644
--- a/etc/codeTemplates/foamScript
+++ b/etc/codeTemplates/foamScript
@@ -3,7 +3,7 @@
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
-#   \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+#   \\  /    A nd           | Copyright (C) 2011-2011 OpenCFD Ltd.
 #    \\/     M anipulation  |
 #------------------------------------------------------------------------------
 # License
diff --git a/etc/codeTemplates/source/_Template.C b/etc/codeTemplates/source/_Template.C
index ed2b7283afc91975595c8b62adc8876d60973472..150d79e8c037034bc37bab4e21e0ef9c49600b77 100644
--- a/etc/codeTemplates/source/_Template.C
+++ b/etc/codeTemplates/source/_Template.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2011-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/etc/codeTemplates/source/_Template.H b/etc/codeTemplates/source/_Template.H
index 14abca0f60f74c0ed53489180442e38a5389b333..f68ec751b1f02c4c4277962e52d9b055b42ae5f8 100644
--- a/etc/codeTemplates/source/_Template.H
+++ b/etc/codeTemplates/source/_Template.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2011-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/etc/codeTemplates/source/_TemplateApp.C b/etc/codeTemplates/source/_TemplateApp.C
index 15e857a6fc091318b8d5add11e066f885f5718bd..58e4f4965936470f3688110befcd0f2b589b7da3 100644
--- a/etc/codeTemplates/source/_TemplateApp.C
+++ b/etc/codeTemplates/source/_TemplateApp.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2011-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/etc/codeTemplates/source/_TemplateI.H b/etc/codeTemplates/source/_TemplateI.H
index fbe257009724c10b4030ffa1208e8532c5783b40..718179dd651e4b7477295303b00a213c438393b0 100644
--- a/etc/codeTemplates/source/_TemplateI.H
+++ b/etc/codeTemplates/source/_TemplateI.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2011-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/etc/codeTemplates/source/_TemplateIO.C b/etc/codeTemplates/source/_TemplateIO.C
index 5ce56619156daf885006e1387119d59cfa6f0e6b..a43b52f8d88ab399569d36624f710875da632ba1 100644
--- a/etc/codeTemplates/source/_TemplateIO.C
+++ b/etc/codeTemplates/source/_TemplateIO.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2011-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/etc/codeTemplates/template/_TemplateTemplate.C b/etc/codeTemplates/template/_TemplateTemplate.C
index 712ac72122b2480ef04ab07a120f4b811821f7bc..6627c3ac140a25e943c4939fd4387267eb5f5547 100644
--- a/etc/codeTemplates/template/_TemplateTemplate.C
+++ b/etc/codeTemplates/template/_TemplateTemplate.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2011-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/etc/codeTemplates/template/_TemplateTemplate.H b/etc/codeTemplates/template/_TemplateTemplate.H
index fca7e2722c949d46661c07b423473b3f91a5c130..52aa72647bdcc8305aabff1ee5e9be3a18e8aec3 100644
--- a/etc/codeTemplates/template/_TemplateTemplate.H
+++ b/etc/codeTemplates/template/_TemplateTemplate.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2011-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/etc/codeTemplates/template/_TemplateTemplateI.H b/etc/codeTemplates/template/_TemplateTemplateI.H
index fbe257009724c10b4030ffa1208e8532c5783b40..718179dd651e4b7477295303b00a213c438393b0 100644
--- a/etc/codeTemplates/template/_TemplateTemplateI.H
+++ b/etc/codeTemplates/template/_TemplateTemplateI.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2011-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/etc/codeTemplates/template/_TemplateTemplateIO.C b/etc/codeTemplates/template/_TemplateTemplateIO.C
index 7da36ef885f3bb096fccf0667fe92d51c9c292d8..f1ed4c1b6ac8952b14643b3a57b2e87167661193 100644
--- a/etc/codeTemplates/template/_TemplateTemplateIO.C
+++ b/etc/codeTemplates/template/_TemplateTemplateIO.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2011-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/etc/cshrc b/etc/cshrc
index 0ef3f0ce78ce345c33d931f32ced7fe6c155a4d5..2a7369913779bc24c3a66e47dd79220b3e27f82c 100644
--- a/etc/cshrc
+++ b/etc/cshrc
@@ -34,24 +34,74 @@ setenv WM_PROJECT OpenFOAM
 setenv WM_PROJECT_VERSION dev
 
 ################################################################################
-# USER EDITABLE PART. Note changes made here may be lost with the next upgrade
+# USER EDITABLE PART: Changes made here may be lost with the next upgrade
 #
-#    either setenv FOAM_INST_DIR before sourcing this file or set
-#    foamInstall below to where OpenFOAM is installed
+# either setenv FOAM_INST_DIR before sourcing this file or set
+# 'foamInstall' below to where OpenFOAM is installed
 #
 # Location of the OpenFOAM installation
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 set foamInstall = $HOME/$WM_PROJECT
 # set foamInstall = ~$WM_PROJECT
-# set foamInstall = /usr/local/$WM_PROJECT
 # set foamInstall = /opt/$WM_PROJECT
+# set foamInstall = /usr/local/$WM_PROJECT
 #
 # END OF (NORMAL) USER EDITABLE PART
 ################################################################################
 
-# note the location for later use (eg, in job scripts)
+#
+# These are the defaults for this version which should generally be
+# overridden from the prefs.csh file or from command-line specification
+#
+#- note the location for later use (eg, in job scripts)
 if ( ! $?FOAM_INST_DIR ) setenv FOAM_INST_DIR $foamInstall
 
+#- ParaView version, automatically determine major version:
+setenv ParaView_VERSION 3.8.0
+setenv ParaView_MAJOR unknown
+
+#- Compiler location:
+#    foamCompiler= system | ThirdParty (OpenFOAM)
+set foamCompiler=system
+
+#- Compiler:
+#    WM_COMPILER = Gcc | Gcc43 | Gcc44 | Gcc45 | Clang | Icc (Intel icc)
+setenv WM_COMPILER Gcc
+setenv WM_COMPILER_ARCH # defined but empty
+setenv WM_COMPILER_LIB_ARCH # defined but empty
+#
+#- Architecture:
+#    WM_ARCH_OPTION = 32 | 64
+setenv WM_ARCH_OPTION 64
+
+#- Precision:
+#    WM_PRECISION_OPTION = DP | SP
+setenv WM_PRECISION_OPTION DP
+
+#- Optimised, debug, profiling:
+#    WM_COMPILE_OPTION = Opt | Debug | Prof
+setenv WM_COMPILE_OPTION Opt
+
+#- MPI implementation:
+#    WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI
+#               | GAMMA | MPI | QSMPI
+setenv WM_MPLIB OPENMPI
+
+#- Operating System:
+#    WM_OSTYPE = POSIX | ???
+setenv WM_OSTYPE POSIX
+
+#- Floating-point signal handling:
+#    set or unset
+setenv FOAM_SIGFPE
+
+#- memory initialisation:
+#    set or unset
+#setenv FOAM_SETNAN
+
+
+################################################################################
+
 # The old dirs to be cleaned from the various environment variables
 # - remove anything under top-level directory.
 # NB: the WM_PROJECT_INST_DIR might not be identical between versions
@@ -75,6 +125,7 @@ alias _foamSource 'if ($?FOAM_VERBOSE && $?prompt) echo "Sourcing: \!*"; if (\!*
 _foamSource `$WM_PROJECT_DIR/bin/foamEtcFile prefs.csh`
 
 # Evaluate command-line parameters and record settings for later
+# these can be used to set/unset values, or specify prefs files
 setenv FOAM_SETTINGS "${*}"
 while ( $#argv > 0 )
     switch ($argv[1])
@@ -99,41 +150,6 @@ while ( $#argv > 0 )
 end
 
 
-# Operating System/Platform
-# ~~~~~~~~~~~~~~~~~~~~~~~~~
-# WM_OSTYPE = POSIX | ????
-if ( ! $?WM_OSTYPE ) setenv WM_OSTYPE POSIX
-
-
-# Compiler: set to Gcc, Gcc43, Gcc44 or Icc (for Intel's icc)
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-if ( ! $?WM_COMPILER ) setenv WM_COMPILER Gcc
-
-setenv WM_COMPILER_ARCH
-setenv WM_COMPILER_LIB_ARCH
-
-
-# Compilation options (architecture, precision, optimised, debug or profiling)
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-# WM_ARCH_OPTION = 32 | 64
-if ( ! $?WM_ARCH_OPTION ) setenv WM_ARCH_OPTION 64
-
-# WM_PRECISION_OPTION = DP | SP
-if ( ! $?WM_PRECISION_OPTION ) setenv WM_PRECISION_OPTION DP
-
-# WM_COMPILE_OPTION = Opt | Debug | Prof
-if ( ! $?WM_COMPILE_OPTION ) setenv WM_COMPILE_OPTION Opt
-
-# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
-if ( ! $?WM_MPLIB ) setenv WM_MPLIB OPENMPI
-
-
-# Run options (floating-point signal handling and memory initialisation)
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-setenv FOAM_SIGFPE
-# setenv FOAM_SETNAN
-
-
 # Detect system type and set environment variables
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 setenv WM_ARCH `uname -s`
@@ -181,13 +197,13 @@ case Linux:
 
     case mips64:
         setenv WM_ARCH SiCortex64
+        setenv WM_MPLIB MPI
         setenv WM_COMPILER_LIB_ARCH 64
         setenv WM_CC 'gcc'
         setenv WM_CXX 'g++'
         setenv WM_CFLAGS '-mabi=64 -fPIC'
         setenv WM_CXXFLAGS '-mabi=64 -fPIC'
         setenv WM_LDFLAGS '-mabi=64 -G0'
-        setenv WM_MPLIB MPI
         breaksw
 
     case ppc64:
@@ -209,13 +225,13 @@ case Linux:
 
 case SunOS:
     setenv WM_ARCH SunOS64
+    setenv WM_MPLIB FJMPI
     setenv WM_COMPILER_LIB_ARCH 64
     setenv WM_CC 'gcc'
     setenv WM_CXX 'g++'
     setenv WM_CFLAGS '-mabi=64 -fPIC'
     setenv WM_CXXFLAGS '-mabi=64 -fPIC'
     setenv WM_LDFLAGS '-mabi=64 -G0'
-    setenv WM_MPLIB FJMPI
     breaksw
 
 default:
diff --git a/etc/prefs.csh-EXAMPLE b/etc/prefs.csh-EXAMPLE
index 6222054e278286298cb81471c70e46ffdb4672c7..256381c54b2db5b896d73d6d5610c4098c8de51a 100644
--- a/etc/prefs.csh-EXAMPLE
+++ b/etc/prefs.csh-EXAMPLE
@@ -38,7 +38,7 @@
 
 ## Specify system compiler
 ## ~~~~~~~~~~~~~~~~~~~~~~~
-#set compilerInstall=system
+#set foamCompiler=system
 
 ## Specify system openmpi
 ## ~~~~~~~~~~~~~~~~~~~~~~
diff --git a/etc/prefs.sh-EXAMPLE b/etc/prefs.sh-EXAMPLE
index 598c5710c9e71570b13543cc2a1b1e135d7dbe7d..60d4a21cd1e742f06db52411230117fa3787767e 100644
--- a/etc/prefs.sh-EXAMPLE
+++ b/etc/prefs.sh-EXAMPLE
@@ -38,7 +38,7 @@
 
 # Specify system compiler
 # ~~~~~~~~~~~~~~~~~~~~~~~
-compilerInstall=system
+foamCompiler=system
 
 # Specify system openmpi
 # ~~~~~~~~~~~~~~~~~~~~~~
diff --git a/etc/settings.csh b/etc/settings.csh
index 366f1e2a50bb0c3be1bd6f3349b1b8f9ac271709..3ebb1939f81461969993c7599533340f89bdea0b 100644
--- a/etc/settings.csh
+++ b/etc/settings.csh
@@ -26,7 +26,7 @@
 #
 # Description
 #     Startup file for OpenFOAM
-#     Sourced from OpenFOAM-??/etc/cshrc
+#     Sourced from OpenFOAM-<VERSION>/etc/cshrc
 #
 #------------------------------------------------------------------------------
 
@@ -47,33 +47,39 @@ setenv WM_DIR $WM_PROJECT_DIR/wmake
 setenv WM_LINK_LANGUAGE c++
 setenv WM_OPTIONS $WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
 
-# base configuration
-setenv FOAM_APP $WM_PROJECT_DIR/applications
-setenv FOAM_APPBIN $WM_PROJECT_DIR/applications/bin/$WM_OPTIONS
-setenv FOAM_LIB $WM_PROJECT_DIR/lib
+# base executables/libraries
+setenv FOAM_APPBIN $WM_PROJECT_DIR/bin/$WM_OPTIONS
 setenv FOAM_LIBBIN $WM_PROJECT_DIR/lib/$WM_OPTIONS
-setenv FOAM_SRC $WM_PROJECT_DIR/src
 
-# shared site configuration - similar naming convention as ~OpenFOAM expansion
+# external (ThirdParty) libraries
+setenv FOAM_EXT_LIBBIN $WM_THIRD_PARTY_DIR/lib/$WM_OPTIONS
+
+# shared site executables/libraries
+# similar naming convention as ~OpenFOAM expansion
 setenv FOAM_SITE_APPBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS
 setenv FOAM_SITE_LIBBIN $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS
 
-# user configuration
-setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
+# user executables/libraries
+setenv FOAM_USER_APPBIN $WM_PROJECT_USER_DIR/bin/$WM_OPTIONS
 setenv FOAM_USER_LIBBIN $WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
 
 # convenience
+setenv FOAM_APP $WM_PROJECT_DIR/applications
+setenv FOAM_LIB $WM_PROJECT_DIR/lib
+setenv FOAM_SRC $WM_PROJECT_DIR/src
 setenv FOAM_TUTORIALS $WM_PROJECT_DIR/tutorials
 setenv FOAM_UTILITIES $FOAM_APP/utilities
 setenv FOAM_SOLVERS $FOAM_APP/solvers
 setenv FOAM_RUN $WM_PROJECT_USER_DIR/run
 
-# add OpenFOAM scripts and wmake to the path
-setenv PATH ${WM_DIR}:${WM_PROJECT_DIR}/bin:${PATH}
+# add wmake to the path - not required for runtime only environment
+if ( -d "${WM_DIR}" ) setenv PATH ${WM_DIR}:${PATH}
+# add OpenFOAM scripts to the path
+setenv PATH ${WM_PROJECT_DIR}/bin:${PATH}
 
 _foamAddPath ${FOAM_USER_APPBIN}:${FOAM_SITE_APPBIN}:${FOAM_APPBIN}
- # Make sure to pick up dummy versions of external libraries last
-_foamAddLib  ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_LIBBIN}/dummy
+# Make sure to pick up dummy versions of external libraries last
+_foamAddLib  ${FOAM_USER_LIBBIN}:${FOAM_SITE_LIBBIN}:${FOAM_LIBBIN}:${FOAM_EXT_LIBBIN}:${FOAM_LIBBIN}/dummy
 
 # Compiler settings
 # ~~~~~~~~~~~~~~~~~
@@ -81,13 +87,18 @@ unset gcc_version gmp_version mpfr_version mpc_version
 unsetenv MPFR_ARCH_PATH
 
 
-# Select compiler installation
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-# compilerInstall = OpenFOAM | system
-if ( ! $?compilerInstall ) set compilerInstall=system
+# Location of compiler installation
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+if ( ! $?foamCompiler ) then
+then
+    foamCompiler=system
+    echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
+    echo "    foamCompiler not set, using '$foamCompiler'"
+fi
 
-switch ("$compilerInstall")
+switch ("$foamCompiler")
 case OpenFOAM:
+case ThirdParty:
     switch ("$WM_COMPILER")
     case Gcc:
     case Gcc++0x:
@@ -143,7 +154,7 @@ case OpenFOAM:
             echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
             echo "    Cannot find $gccDir installation."
             echo "    Please install this compiler version or if you wish to use the system compiler,"
-            echo "    change the 'compilerInstall' setting to 'system' in this file"
+            echo "    change the 'foamCompiler' setting to 'system'"
             echo
         endif
 
@@ -181,7 +192,7 @@ case OpenFOAM:
             echo "Warning in $WM_PROJECT_DIR/etc/settings.csh:"
             echo "    Cannot find $clangDir installation."
             echo "    Please install this compiler version or if you wish to use the system compiler,"
-            echo "    change the 'compilerInstall' setting to 'system' in this file"
+            echo "    change the 'foamCompiler' setting to 'system'"
             echo
         endif
 
@@ -191,6 +202,15 @@ case OpenFOAM:
     unset clang_version clangDir
 
     breaksw
+
+case system:
+    # okay, use system compiler
+    breaksw
+
+default:
+    echo "Warn: foamCompiler='$foamCompiler' is unsupported"
+    echo "   treating as 'system' instead"
+    breaksw
 endsw
 
 
@@ -248,7 +268,7 @@ case OPENMPI:
     _foamAddLib     $MPI_ARCH_PATH/lib
     _foamAddMan     $MPI_ARCH_PATH/man
 
-    setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
+    setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/$mpi_version
     unset mpi_version
     breaksw
 
@@ -270,7 +290,7 @@ case SYSTEMOPENMPI:
 
     _foamAddLib     $libDir
 
-    setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
+    setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/$mpi_version
     unset mpi_version libDir
     breaksw
 
@@ -283,7 +303,7 @@ case MPICH:
     _foamAddLib     $MPI_ARCH_PATH/lib
     _foamAddMan     $MPI_ARCH_PATH/share/man
 
-    setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/$mpi_version
+    setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/$mpi_version
     unset mpi_version
     breaksw
 
@@ -296,7 +316,7 @@ case MPICH-GM:
     _foamAddLib     $MPI_ARCH_PATH/lib
     _foamAddLib     $GM_LIB_PATH
 
-    setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpich-gm
+    setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/mpich-gm
     breaksw
 
 case HPMPI:
@@ -320,22 +340,22 @@ case HPMPI:
         breaksw
     endsw
 
-    setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/hpmpi
+    setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/hpmpi
     breaksw
 
 case GAMMA:
     setenv MPI_ARCH_PATH /usr
-    setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/gamma
+    setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/gamma
     breaksw
 
 case MPI:
     setenv MPI_ARCH_PATH /opt/mpi
-    setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
+    setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/mpi
     breaksw
 
 case FJMPI:
     setenv MPI_ARCH_PATH /opt/FJSVmpi2
-    setenv FOAM_MPI_LIBBIN $FOAM_LIBBIN/mpi
+    setenv FOAM_MPI_LIBBIN $FOAM_EXT_LIBBIN/mpi
     _foamAddPath    $MPI_ARCH_PATH/bin
     _foamAddLib     $MPI_ARCH_PATH/lib/sparcv9
     _foamAddLib     /opt/FSUNf90/lib/sparcv9
@@ -374,14 +394,14 @@ endif
 
 # Enable the hoard memory allocator if available
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#if ( -f $FOAM_LIBBIN/libhoard.so ) then
-#    setenv LD_PRELOAD $FOAM_LIBBIN/libhoard.so:$LD_PRELOAD
+#if ( -f $FOAM_EXT_LIBBIN/libhoard.so ) then
+#    setenv LD_PRELOAD $FOAM_EXT_LIBBIN/libhoard.so:$LD_PRELOAD
 #endif
 
 
 # cleanup environment:
 # ~~~~~~~~~~~~~~~~~~~~
 unalias _foamAddPath _foamAddLib _foamAddMan
-unset compilerInstall minBufferSize
+unset foamCompiler minBufferSize
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/etc/settings.sh b/etc/settings.sh
index 8412505be6dd0aa50cd19cdf199a0554533d2957..b466cd4fe71798b1c16c57415760f14a76aec886 100644
--- a/etc/settings.sh
+++ b/etc/settings.sh
@@ -26,7 +26,7 @@
 #
 # Description
 #     Startup file for OpenFOAM
-#     Sourced from OpenFOAM-??/etc/bashrc
+#     Sourced from OpenFOAM-<VERSION>/etc/bashrc
 #
 #------------------------------------------------------------------------------
 
@@ -70,46 +70,56 @@ export WM_DIR=$WM_PROJECT_DIR/wmake
 export WM_LINK_LANGUAGE=c++
 export WM_OPTIONS=$WM_ARCH$WM_COMPILER$WM_PRECISION_OPTION$WM_COMPILE_OPTION
 
-# base configuration
-export FOAM_APP=$WM_PROJECT_DIR/applications
-export FOAM_APPBIN=$WM_PROJECT_DIR/applications/bin/$WM_OPTIONS
-export FOAM_LIB=$WM_PROJECT_DIR/lib
+# base executables/libraries
+export FOAM_APPBIN=$WM_PROJECT_DIR/bin/$WM_OPTIONS
 export FOAM_LIBBIN=$WM_PROJECT_DIR/lib/$WM_OPTIONS
-export FOAM_SRC=$WM_PROJECT_DIR/src
 
-# shared site configuration - similar naming convention as ~OpenFOAM expansion
+# external (ThirdParty) libraries
+export FOAM_EXT_LIBBIN=$WM_THIRD_PARTY_DIR/lib/$WM_OPTIONS
+
+# shared site executables/libraries
+# similar naming convention as ~OpenFOAM expansion
 export FOAM_SITE_APPBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/bin/$WM_OPTIONS
 export FOAM_SITE_LIBBIN=$WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION/lib/$WM_OPTIONS
 
-# user configuration
-export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
+# user executables/libraries
+export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/bin/$WM_OPTIONS
 export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
 
 # convenience
+export FOAM_APP=$WM_PROJECT_DIR/applications
+export FOAM_LIB=$WM_PROJECT_DIR/lib
+export FOAM_SRC=$WM_PROJECT_DIR/src
 export FOAM_TUTORIALS=$WM_PROJECT_DIR/tutorials
 export FOAM_UTILITIES=$FOAM_APP/utilities
 export FOAM_SOLVERS=$FOAM_APP/solvers
 export FOAM_RUN=$WM_PROJECT_USER_DIR/run
 
-# add OpenFOAM scripts and wmake to the path
-export PATH=$WM_DIR:$WM_PROJECT_DIR/bin:$PATH
+# add wmake to the path - not required for runtime only environment
+[ -d "$WM_DIR" ] && PATH=$WM_DIR:$PATH
+# add OpenFOAM scripts to the path
+export PATH=$WM_PROJECT_DIR/bin:$PATH
 
 _foamAddPath $FOAM_USER_APPBIN:$FOAM_SITE_APPBIN:$FOAM_APPBIN
- # Make sure to pick up dummy versions of external libraries last
-_foamAddLib  $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_LIBBIN/dummy
+# Make sure to pick up dummy versions of external libraries last
+_foamAddLib  $FOAM_USER_LIBBIN:$FOAM_SITE_LIBBIN:$FOAM_LIBBIN:$FOAM_EXT_LIBBIN:$FOAM_LIBBIN/dummy
 
 # Compiler settings
 # ~~~~~~~~~~~~~~~~~
 unset gcc_version gmp_version mpfr_version mpc_version
 unset MPFR_ARCH_PATH
 
-# Select compiler installation
-# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-# compilerInstall = OpenFOAM | system
-: ${compilerInstall:=system}
+# Location of compiler installation
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+if [ -z "$foamCompiler" ]
+then
+    foamCompiler=system
+    echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:" 1>&2
+    echo "    foamCompiler not set, using '$foamCompiler'" 1>&2
+fi
 
-case "${compilerInstall:-OpenFOAM}" in
-OpenFOAM)
+case "${foamCompiler}" in
+OpenFOAM | ThirdParty)
     case "$WM_COMPILER" in
     Gcc | Gcc++0x)
         gcc_version=gcc-4.4.3
@@ -161,7 +171,7 @@ OpenFOAM)
             echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
             echo "    Cannot find $gccDir installation."
             echo "    Please install this compiler version or if you wish to use the system compiler,"
-            echo "    change the 'compilerInstall' setting to 'system' in this file"
+            echo "    change the 'foamCompiler' setting to 'system'"
             echo
         }
 
@@ -202,7 +212,7 @@ OpenFOAM)
             echo "Warning in $WM_PROJECT_DIR/etc/settings.sh:"
             echo "    Cannot find $clangDir installation."
             echo "    Please install this compiler version or if you wish to use the system compiler,"
-            echo "    change the 'compilerInstall' setting to 'system' in this file"
+            echo "    change the 'foamCompiler' setting to 'system'"
             echo
         }
 
@@ -211,6 +221,13 @@ OpenFOAM)
     fi
     unset clang_version clangDir
     ;;
+system)
+    # okay, use system compiler
+    ;;
+*)
+    echo "Warn: foamCompiler='$foamCompiler' is unsupported" 1>&2
+    echo "   treating as 'system' instead" 1>&2
+    ;;
 esac
 
 
@@ -271,7 +288,7 @@ OPENMPI)
     _foamAddLib     $MPI_ARCH_PATH/lib
     _foamAddMan     $MPI_ARCH_PATH/man
 
-    export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version
+    export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/$mpi_version
     unset mpi_version
     ;;
 
@@ -294,7 +311,7 @@ SYSTEMOPENMPI)
 
     _foamAddLib     $libDir
 
-    export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version
+    export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/$mpi_version
     unset mpi_version libDir
     ;;
 
@@ -307,7 +324,7 @@ MPICH)
     _foamAddLib     $MPI_ARCH_PATH/lib
     _foamAddMan     $MPI_ARCH_PATH/share/man
 
-    export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/$mpi_version
+    export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/$mpi_version
     unset mpi_version
     ;;
 
@@ -320,7 +337,7 @@ MPICH-GM)
     _foamAddLib     $MPI_ARCH_PATH/lib
     _foamAddLib     $GM_LIB_PATH
 
-    export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpich-gm
+    export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/mpich-gm
     ;;
 
 HPMPI)
@@ -345,22 +362,22 @@ HPMPI)
         ;;
     esac
 
-    export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/hpmpi
+    export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/hpmpi
     ;;
 
 GAMMA)
     export MPI_ARCH_PATH=/usr
-    export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/gamma
+    export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/gamma
     ;;
 
 MPI)
     export MPI_ARCH_PATH=/opt/mpi
-    export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpi
+    export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/mpi
     ;;
 
 FJMPI)
     export MPI_ARCH_PATH=/opt/FJSVmpi2
-    export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/mpi
+    export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/mpi
 
     _foamAddPath    $MPI_ARCH_PATH/bin
     _foamAddLib     $MPI_ARCH_PATH/lib/sparcv9
@@ -370,7 +387,7 @@ FJMPI)
 
 QSMPI)
     export MPI_ARCH_PATH=/usr/lib/mpi
-    export FOAM_MPI_LIBBIN=$FOAM_LIBBIN/qsmpi
+    export FOAM_MPI_LIBBIN=$FOAM_EXT_LIBBIN/qsmpi
 
     _foamAddPath    $MPI_ARCH_PATH/bin
     _foamAddLib     $MPI_ARCH_PATH/lib
@@ -398,14 +415,14 @@ export MPI_BUFFER_SIZE
 
 # Enable the hoard memory allocator if available
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-#if [ -f $FOAM_LIBBIN/libhoard.so ]
+#if [ -f $FOAM_EXT_LIBBIN/libhoard.so ]
 #then
-#    export LD_PRELOAD=$FOAM_LIBBIN/libhoard.so:$LD_PRELOAD
+#    export LD_PRELOAD=$FOAM_EXT_LIBBIN/libhoard.so:$LD_PRELOAD
 #fi
 
 
 # cleanup environment:
 # ~~~~~~~~~~~~~~~~~~~~
-unset _foamAddPath _foamAddLib _foamAddMan compilerInstall minBufferSize
+unset _foamAddPath _foamAddLib _foamAddMan foamCompiler minBufferSize
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/src/Allwmake b/src/Allwmake
index 2fd099352dc9e53155bf3675491dd1e944b621a4..f3c4420474f56a0740a88658e236f11e72325074 100755
--- a/src/Allwmake
+++ b/src/Allwmake
@@ -8,6 +8,12 @@ wmakeCheckPwd "$WM_PROJECT_DIR/src" || {
     exit 1
 }
 
+[ -n "$FOAM_EXT_LIBBIN" ] || {
+    echo "Error: FOAM_EXT_LIBBIN not set"
+    echo "    Check the OpenFOAM entries in your dot-files and source them."
+    exit 1
+}
+
 set -x
 
 # update OpenFOAM version strings if required
diff --git a/src/ODE/ODESolvers/KRR4/KRR4.C b/src/ODE/ODESolvers/KRR4/KRR4.C
index 09df33ad9d1d970bc4b8315861d5fddce4a1a759..114c72980afd4e8ec561e0368f94c9b5c8a5ec48 100644
--- a/src/ODE/ODESolvers/KRR4/KRR4.C
+++ b/src/ODE/ODESolvers/KRR4/KRR4.C
@@ -50,7 +50,7 @@ const scalar
     KRR4::c1X = 1.0/2.0, KRR4::c2X = -3.0/2.0, KRR4::c3X = 121.0/50.0,
     KRR4::c4X = 29.0/250.0,
     KRR4::a2X = 1.0, KRR4::a3X = 3.0/5.0;
-};
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/ODE/ODESolvers/ODESolver/ODESolver.C b/src/ODE/ODESolvers/ODESolver/ODESolver.C
index f0c04518beea8a230a404fd252895ae2d8513f82..0ebdf756bd2fb495ec7992a8083bb44aabe3e259 100644
--- a/src/ODE/ODESolvers/ODESolver/ODESolver.C
+++ b/src/ODE/ODESolvers/ODESolver/ODESolver.C
@@ -31,7 +31,7 @@ defineTypeNameAndDebug(Foam::ODESolver, 0);
 namespace Foam
 {
     defineRunTimeSelectionTable(ODESolver, ODE);
-};
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/ODE/ODESolvers/RK/RK.C b/src/ODE/ODESolvers/RK/RK.C
index 3b74eb8f4578080c3e438e02a81d021700e81822..2036211ef9d5c0ab97453b8cbe60b67458ef5897 100644
--- a/src/ODE/ODESolvers/RK/RK.C
+++ b/src/ODE/ODESolvers/RK/RK.C
@@ -49,7 +49,7 @@ const scalar
     RK::dc1 = RK::c1 - 2825.0/27648.0, RK::dc3 = RK::c3 - 18575.0/48384.0,
     RK::dc4 = RK::c4 - 13525.0/55296.0, RK::dc5 = -277.00/14336.0,
     RK::dc6 = RK::c6 - 0.25;
-};
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/ODE/ODESolvers/SIBS/SIBS.C b/src/ODE/ODESolvers/SIBS/SIBS.C
index acaa5c9e765773f66e5dd5ecbcf469b2a0e415a5..ce7d09fcc4eccda631cd359cbf3b0f7fa317d89a 100644
--- a/src/ODE/ODESolvers/SIBS/SIBS.C
+++ b/src/ODE/ODESolvers/SIBS/SIBS.C
@@ -42,7 +42,7 @@ namespace Foam
         SIBS::redMax = 1.0e-5,
         SIBS::redMin = 0.7,
         SIBS::scaleMX = 0.1;
-};
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C
index 380c785c0b83fe4c92cbf89c0ec622107e59d679..ec0d1e79f4b2192cb3b81b890daa7de7306eda9f 100644
--- a/src/OSspecific/POSIX/POSIX.C
+++ b/src/OSspecific/POSIX/POSIX.C
@@ -111,16 +111,16 @@ bool Foam::setEnv
 
 Foam::word Foam::hostName(bool full)
 {
-    char buf[256];
-    gethostname(buf, 256);
+    char buf[128];
+    gethostname(buf, sizeof(buf));
 
+    // implementation as per hostname from net-tools
     if (full)
     {
-        struct hostent *hptr = gethostbyname(buf);
-
-        if (hptr)
+        struct hostent *hp = gethostbyname(buf);
+        if (hp)
         {
-            return hptr->h_name;
+            return hp->h_name;
         }
     }
 
@@ -128,6 +128,27 @@ Foam::word Foam::hostName(bool full)
 }
 
 
+Foam::word Foam::domainName()
+{
+    char buf[128];
+    gethostname(buf, sizeof(buf));
+
+    // implementation as per hostname from net-tools
+    struct hostent *hp = gethostbyname(buf);
+    if (hp)
+    {
+        char *p = strchr(hp->h_name, '.');
+        if (p)
+        {
+            ++p;
+            return p;
+        }
+    }
+
+    return word::null;
+}
+
+
 Foam::word Foam::userName()
 {
     struct passwd* pw = getpwuid(getuid());
@@ -201,8 +222,8 @@ Foam::fileName Foam::home(const word& userName)
 
 Foam::fileName Foam::cwd()
 {
-    char buf[255];
-    if (getcwd(buf, 255))
+    char buf[256];
+    if (getcwd(buf, sizeof(buf)))
     {
         return buf;
     }
@@ -957,8 +978,6 @@ bool Foam::ping
     const label timeOut
 )
 {
-    char *serverAddress;
-    struct in_addr *ptr;
     struct hostent *hostPtr;
     volatile int sockfd;
     struct sockaddr_in destAddr;      // will hold the destination addr
@@ -968,15 +987,13 @@ bool Foam::ping
     {
         FatalErrorIn
         (
-            "Foam::ping(const word&, const label)"
+            "Foam::ping(const word&, ...)"
         )   << "gethostbyname error " << h_errno << " for host " << destName
             << abort(FatalError);
     }
 
     // Get first of the SLL of addresses
-    serverAddress = *(hostPtr->h_addr_list);
-    ptr = reinterpret_cast<struct in_addr*>(serverAddress);
-    addr = ptr->s_addr;
+    addr = (reinterpret_cast<struct in_addr*>(*(hostPtr->h_addr_list)))->s_addr;
 
     // Allocate socket
     sockfd = socket(AF_INET, SOCK_STREAM, 0);
@@ -990,7 +1007,7 @@ bool Foam::ping
     }
 
     // Fill sockaddr_in structure with dest address and port
-    memset (reinterpret_cast<char *>(&destAddr), '\0', sizeof(destAddr));
+    memset(reinterpret_cast<char *>(&destAddr), '\0', sizeof(destAddr));
     destAddr.sin_family = AF_INET;
     destAddr.sin_port = htons(ushort(destPort));
     destAddr.sin_addr.s_addr = addr;
diff --git a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H
index 183c2edeac0e2848c7d122f0634b27b54981a601..4439817ab2df4b1767d1c3f80ada6d4802e78bd8 100644
--- a/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H
+++ b/src/OpenFOAM/fields/pointPatchFields/pointPatchField/pointPatchField.H
@@ -500,20 +500,7 @@ const pointPatchField<Type>& operator+
 #endif
 
 
-#define makePointPatchTypeFieldTypeName(type)                                 \
-    defineNamedTemplateTypeNameAndDebug(type, 0);
-
-
-#define makePointPatchFieldsTypeName(type)                                    \
-    makePointPatchTypeFieldTypeName(type##PointPatchScalarField);             \
-    makePointPatchTypeFieldTypeName(type##PointPatchVectorField);             \
-    makePointPatchTypeFieldTypeName(type##PointPatchSphericalTensorField);    \
-    makePointPatchTypeFieldTypeName(type##PointPatchSymmTensorField);         \
-    makePointPatchTypeFieldTypeName(type##PointPatchTensorField);
-
-
 #define addToPointPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField)      \
-                                                                              \
     addToRunTimeSelectionTable                                                \
     (                                                                         \
         PatchTypeField,                                                       \
@@ -533,46 +520,58 @@ const pointPatchField<Type>& operator+
         dictionary                                                            \
     );
 
+
 // for non-templated patch fields
-#define makeNonTemplatedPointPatchTypeField(PatchTypeField,typePatchTypeField)\
+#define makePointPatchTypeField(PatchTypeField,typePatchTypeField)            \
     defineTypeNameAndDebug(typePatchTypeField, 0);                            \
     addToPointPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField)
 
 
 // for templated patch fields
-#define makePointPatchTypeField(PatchTypeField, typePatchTypeField)           \
+#define makeTemplatePointPatchTypeField(PatchTypeField, typePatchTypeField)   \
     defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0);               \
     addToPointPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField)
 
 
 #define makePointPatchFields(type)                                            \
-    makePointPatchTypeField                                                   \
+    makeTemplatePointPatchTypeField                                           \
     (                                                                         \
         pointPatchScalarField,                                                \
         type##PointPatchScalarField                                           \
     );                                                                        \
-    makePointPatchTypeField                                                   \
+    makeTemplatePointPatchTypeField                                           \
     (                                                                         \
         pointPatchVectorField,                                                \
         type##PointPatchVectorField                                           \
     );                                                                        \
-    makePointPatchTypeField                                                   \
+    makeTemplatePointPatchTypeField                                           \
     (                                                                         \
         pointPatchSphericalTensorField,                                       \
         type##PointPatchSphericalTensorField                                  \
     );                                                                        \
-    makePointPatchTypeField                                                   \
+    makeTemplatePointPatchTypeField                                           \
     (                                                                         \
         pointPatchSymmTensorField,                                            \
         type##PointPatchSymmTensorField                                       \
     );                                                                        \
-    makePointPatchTypeField                                                   \
+    makeTemplatePointPatchTypeField                                           \
     (                                                                         \
         pointPatchTensorField,                                                \
         type##PointPatchTensorField                                           \
 );
 
 
+#define makePointPatchFieldsTypeName(type)                                    \
+    defineNamedTemplateTypeNameAndDebug(type##PointPatchScalarField, 0);      \
+    defineNamedTemplateTypeNameAndDebug(type##PointPatchVectorField, 0);      \
+    defineNamedTemplateTypeNameAndDebug                                       \
+    (                                                                         \
+        type##PointPatchSphericalTensorField, 0                               \
+    );                                                                        \
+    defineNamedTemplateTypeNameAndDebug(type##PointPatchSymmTensorField, 0);  \
+    defineNamedTemplateTypeNameAndDebug(type##PointPatchTensorField, 0)
+
+
 #define makePointPatchFieldTypedefs(type)                                     \
     typedef type##PointPatchField<scalar> type##PointPatchScalarField;        \
     typedef type##PointPatchField<vector> type##PointPatchVectorField;        \
diff --git a/src/OpenFOAM/graph/writers/gnuplotGraph/gnuplotGraph.C b/src/OpenFOAM/graph/writers/gnuplotGraph/gnuplotGraph.C
index cb353e2e4de4b57338291f0cf08cea7f282542a5..32b27539bf2efb8aad4a7a3866ad2b59abf7e16c 100644
--- a/src/OpenFOAM/graph/writers/gnuplotGraph/gnuplotGraph.C
+++ b/src/OpenFOAM/graph/writers/gnuplotGraph/gnuplotGraph.C
@@ -35,7 +35,7 @@ namespace Foam
 {
     typedef graph::writer graphWriter;
     addToRunTimeSelectionTable(graphWriter, gnuplotGraph, word);
-};
+}
 
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/graph/writers/jplotGraph/jplotGraph.C b/src/OpenFOAM/graph/writers/jplotGraph/jplotGraph.C
index 7d7e0d5e41ad3be934c274fd06765b7127b641ca..4f826f3e969f7b9d50cf21c456619629e596406a 100644
--- a/src/OpenFOAM/graph/writers/jplotGraph/jplotGraph.C
+++ b/src/OpenFOAM/graph/writers/jplotGraph/jplotGraph.C
@@ -35,7 +35,7 @@ namespace Foam
 {
     typedef graph::writer graphWriter;
     addToRunTimeSelectionTable(graphWriter, jplotGraph, word);
-};
+}
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/graph/writers/rawGraph/rawGraph.C b/src/OpenFOAM/graph/writers/rawGraph/rawGraph.C
index ff4de814ceb345dbfcfbcbbd7f9cdb0858da2f83..19e23098a7513e0a15b6d9e2a98cd7fbd943773a 100644
--- a/src/OpenFOAM/graph/writers/rawGraph/rawGraph.C
+++ b/src/OpenFOAM/graph/writers/rawGraph/rawGraph.C
@@ -35,7 +35,7 @@ namespace Foam
 {
     typedef graph::writer graphWriter;
     addToRunTimeSelectionTable(graphWriter, rawGraph, word);
-};
+}
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
diff --git a/src/OpenFOAM/graph/writers/xmgrGraph/xmgrGraph.C b/src/OpenFOAM/graph/writers/xmgrGraph/xmgrGraph.C
index 00a36a8fa60193965fe10bbc8737313f3db49384..0c21dc3d8cc3f29323e83693aa7460240c7994e0 100644
--- a/src/OpenFOAM/graph/writers/xmgrGraph/xmgrGraph.C
+++ b/src/OpenFOAM/graph/writers/xmgrGraph/xmgrGraph.C
@@ -35,7 +35,7 @@ namespace Foam
 {
     typedef graph::writer graphWriter;
     addToRunTimeSelectionTable(graphWriter, xmgrGraph, word);
-};
+}
 
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
diff --git a/src/OpenFOAM/include/OSspecific.H b/src/OpenFOAM/include/OSspecific.H
index 3ee759a5968e8639d9274421947399d9c786d4d0..df867a589b6a1624d2282e904a21dd4691e936b0 100644
--- a/src/OpenFOAM/include/OSspecific.H
+++ b/src/OpenFOAM/include/OSspecific.H
@@ -67,10 +67,13 @@ string getEnv(const word&);
 //- Set an environment variable
 bool setEnv(const word& name, const string& value, const bool overwrite);
 
-//- Return the system's host name
-//  Optionally the full name reported from gethostbyname
+//- Return the system's host name, as per hostname(1)
+//  Optionally with the full name (as per the '-f' option)
 word hostName(const bool full=false);
 
+//- Return the system's domain name, as per hostname(1) with the '-d' option
+word domainName();
+
 //- Return the user's login name
 word userName();
 
diff --git a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.C b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.C
index 21e97d74d453a6aa55998911ce8f20f8b5f104e9..55892869eaad3d8ffb3126297a15c7d12218f08f 100644
--- a/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.C
+++ b/src/OpenFOAM/meshes/polyMesh/globalMeshData/globalIndex.C
@@ -34,7 +34,7 @@ Foam::globalIndex::globalIndex(const label localSize)
     labelList localSizes(Pstream::nProcs());
     localSizes[Pstream::myProcNo()] = localSize;
     Pstream::gatherList(localSizes);
-    Pstream::scatterList(localSizes);   // just to balance out comms
+    Pstream::scatterList(localSizes);
 
     label offset = 0;
     offsets_[0] = 0;
diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C
index af5b4393b82e6364f783cf8d8df90c1e5be0c6dc..8315d3de2117cc6249b4e074aee471d8ff13dff6 100644
--- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C
+++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.C
@@ -307,7 +307,7 @@ Foam::mapDistribute::mapDistribute
         {
             label globalIndex = elements[i];
 
-            if (!globalNumbering.isLocal(globalIndex))
+            if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex))
             {
                 label procI = globalNumbering.whichProcID(globalIndex);
                 nNonLocal[procI]++;
@@ -329,7 +329,7 @@ Foam::mapDistribute::mapDistribute
         {
             label globalIndex = elements[i];
 
-            if (!globalNumbering.isLocal(globalIndex))
+            if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex))
             {
                 label procI = globalNumbering.whichProcID(globalIndex);
                 label index = globalNumbering.toLocal(procI, globalIndex);
@@ -452,7 +452,7 @@ Foam::mapDistribute::mapDistribute
             {
                 label globalIndex = cCells[i];
 
-                if (!globalNumbering.isLocal(globalIndex))
+                if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex))
                 {
                     label procI = globalNumbering.whichProcID(globalIndex);
                     nNonLocal[procI]++;
@@ -482,7 +482,7 @@ Foam::mapDistribute::mapDistribute
             {
                 label globalIndex = cCells[i];
 
-                if (!globalNumbering.isLocal(globalIndex))
+                if (globalIndex != -1 && !globalNumbering.isLocal(globalIndex))
                 {
                     label procI = globalNumbering.whichProcID(globalIndex);
                     label index = globalNumbering.toLocal(procI, globalIndex);
@@ -603,6 +603,10 @@ Foam::label Foam::mapDistribute::renumber
     const label globalI
 )
 {
+    if (globalI == -1)
+    {
+        return globalI;
+    }
     if (globalNumbering.isLocal(globalI))
     {
         return globalNumbering.toLocal(globalI);
diff --git a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H
index ddd04867079026f1d7280bbafc63718ae23951e7..86895114e40a9d01482206429eb644097d8787a6 100644
--- a/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H
+++ b/src/OpenFOAM/meshes/polyMesh/mapPolyMesh/mapDistribute/mapDistribute.H
@@ -123,7 +123,7 @@ public:
         );
 
         //- Construct from list of (possibly) remote elements in globalIndex
-        //  numbering. Determines compact numbering (see above) and
+        //  numbering (or -1). Determines compact numbering (see above) and
         //  distribute map to get data into this ordering and renumbers the
         //  elements to be in compact numbering.
         mapDistribute
@@ -133,7 +133,7 @@ public:
             List<Map<label> >& compactMap
         );
 
-        //- Special variant that works with the into sorted into bins
+        //- Special variant that works with the info sorted into bins
         //  according to local indices. E.g. think cellCells where
         //  cellCells[localCellI] is a list of global cells
         mapDistribute
diff --git a/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H b/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H
index b6792529b8330018cc290fac942823b7f0ea3d62..a8bde775c7ffc67608301dea4a8ea3040e1f1278 100644
--- a/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H
+++ b/src/OpenFOAM/meshes/primitiveShapes/tetrahedron/tetrahedronI.H
@@ -156,10 +156,7 @@ inline Point Foam::tetrahedron<Point, PointRef>::circumCentre() const
 
     if (Foam::mag(denom) < ROOTVSMALL)
     {
-        WarningIn("Point tetrahedron<Point, PointRef>::circumCentre() const")
-            << "Degenerate tetrahedron:" << nl << *this << nl
-            <<"Returning centre instead of circumCentre."
-            << endl;
+        // Degenerate tetrahedron, returning centre instead of circumCentre.
 
         return centre();
     }
@@ -186,11 +183,7 @@ inline Foam::scalar Foam::tetrahedron<Point, PointRef>::circumRadius() const
 
     if (Foam::mag(denom) < ROOTVSMALL)
     {
-        WarningIn("Point tetrahedron<Point, PointRef>::circumCentre() const")
-            << "Degenerate tetrahedron:" << nl << *this << nl
-            << "Returning GREAT for circumRadius."
-            << endl;
-
+        // Degenerate tetrahedron, returning GREAT for circumRadius.
         return GREAT;
     }
 
@@ -272,16 +265,7 @@ Foam::scalar Foam::tetrahedron<Point, PointRef>::barycentric
 
     if (Foam::mag(detT) < SMALL)
     {
-        WarningIn
-        (
-            "List<scalar> tetrahedron<Point, PointRef>::barycentric"
-            "("
-                "const point& pt"
-            ") const"
-        )
-            << "Degenerate tetrahedron:" << nl << *this << nl
-            << "Returning 1/4 barycentric coordinates."
-            << endl;
+        // Degenerate tetrahedron, returning 1/4 barycentric coordinates.
 
         bary = List<scalar>(4, 0.25);
 
diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H
index f7578f8ce39268be10ae6afffc5fa89d143c4552..6e7a0302f5a20c253b1cd804bbd6e830926f7d7f 100644
--- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H
+++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H
@@ -121,10 +121,7 @@ inline Point Foam::triangle<Point, PointRef>::circumCentre() const
 
     if (Foam::mag(c) < ROOTVSMALL)
     {
-        WarningIn("Point triangle<Point, PointRef>::circumCentre() const")
-            << "Degenerate triangle:" << nl << *this << nl
-            << "Returning centre instead of circumCentre."
-            << endl;
+        // Degenerate triangle, returning centre instead of circumCentre.
 
         return centre();
     }
@@ -147,10 +144,7 @@ inline Foam::scalar Foam::triangle<Point, PointRef>::circumRadius() const
 
     if (Foam::mag(denom) < VSMALL)
     {
-        WarningIn("scalar triangle<Point, PointRef>::circumRadius() const")
-            << "Degenerate triangle:" << nl << *this << nl
-            << "Returning GREAT for circumRadius."
-            << endl;
+        // Degenerate triangle, returning GREAT for circumRadius.
 
         return GREAT;
     }
@@ -266,16 +260,7 @@ Foam::scalar Foam::triangle<Point, PointRef>::barycentric
 
     if (Foam::mag(denom) < SMALL)
     {
-        WarningIn
-        (
-            "List<scalar> triangle<Point, PointRef>::barycentric"
-            "("
-                "const point& pt"
-            ") const"
-        )
-            << "Degenerate triangle:" << nl << *this << nl
-            << "Returning 1/3 barycentric coordinates."
-            << endl;
+        // Degenerate triangle, returning 1/3 barycentric coordinates.
 
         bary = List<scalar>(3, 1.0/3.0);
 
@@ -540,20 +525,7 @@ Foam::pointHit Foam::triangle<Point, PointRef>::nearestPointClassify
     {
         if ((d1 - d3) < ROOTVSMALL)
         {
-            WarningIn
-            (
-                "pointHit triangle<Point, PointRef>::nearestPointClassify"
-                "("
-                    "const point& p,"
-                    "label& nearType,"
-                    "label& nearLabel"
-                ") const"
-            )
-                << "Degenerate triangle:" << nl << *this << nl
-                << "d1, d3: " << d1 << ", " << d3 << endl;
-
-            // For d1 = d3, a_ and b_ are likely coincident.
-
+            // Degenerate triangle, for d1 = d3, a_ and b_ are likely coincident
             nearType = POINT;
             nearLabel = 0;
             return pointHit(false, a_, Foam::mag(a_ - p), true);
@@ -589,20 +561,7 @@ Foam::pointHit Foam::triangle<Point, PointRef>::nearestPointClassify
     {
         if ((d2 - d6) < ROOTVSMALL)
         {
-            WarningIn
-            (
-                "pointHit triangle<Point, PointRef>::nearestPointClassify"
-                "("
-                    "const point& p,"
-                    "label& nearType,"
-                    "label& nearLabel"
-                ") const"
-            )
-                << "Degenerate triangle:" << nl << *this << nl
-                << "d2, d6: " << d2 << ", " << d6 << endl;
-
-            // For d2 = d6, a_ and c_ are likely coincident.
-
+            // Degenerate triangle, for d2 = d6, a_ and c_ are likely coincident
             nearType = POINT;
             nearLabel = 0;
             return pointHit(false, a_, Foam::mag(a_ - p), true);
@@ -624,21 +583,8 @@ Foam::pointHit Foam::triangle<Point, PointRef>::nearestPointClassify
     {
         if (((d4 - d3) + (d5 - d6)) < ROOTVSMALL)
         {
-            WarningIn
-            (
-                "pointHit triangle<Point, PointRef>::nearestPointClassify"
-                "("
-                    "const point& p,"
-                    "label& nearType,"
-                    "label& nearLabel"
-                ") const"
-            )
-                << "Degenerate triangle:" << nl << *this << nl
-                << "(d4 - d3), (d6 - d5): " << (d4 - d3) << ", " << (d6 - d5)
-                << endl;
-
-            // For (d4 - d3) = (d6 - d5), b_ and c_ are likely coincident.
-
+            // Degenerate triangle, for (d4 - d3) = (d6 - d5), b_ and c_ are
+            // likely coincident
             nearType = POINT;
             nearLabel = 1;
             return pointHit(false, b_, Foam::mag(b_ - p), true);
@@ -658,19 +604,8 @@ Foam::pointHit Foam::triangle<Point, PointRef>::nearestPointClassify
 
     if ((va + vb + vc) < ROOTVSMALL)
     {
-        WarningIn
-        (
-            "pointHit triangle<Point, PointRef>::nearestPointClassify"
-            "("
-                "const point& p,"
-                "label& nearType,"
-                "label& nearLabel"
-            ") const"
-        )
-            << "Degenerate triangle:" << nl << *this << nl
-            << "va, vb, vc: " << va << ", " << vb << ", " << vc
-            << endl;
-
+        // Degenerate triangle, return the centre because no edge or points are
+        // closest
         point nearPt = centre();
         nearType = NONE,
         nearLabel = -1;
diff --git a/src/OpenFOAM/primitives/hashes/Hasher/Hasher.C b/src/OpenFOAM/primitives/hashes/Hasher/Hasher.C
index dddd523d36ce631d2ac2c5995a144e9a93b0734f..9c6582fa9c323f7c54b6e98c1cd41967fd45b10f 100644
--- a/src/OpenFOAM/primitives/hashes/Hasher/Hasher.C
+++ b/src/OpenFOAM/primitives/hashes/Hasher/Hasher.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2009-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -490,7 +490,7 @@ unsigned Foam::Hasher
     const short endianTest = 0x0100;
 
     // yields 0x01 for big endian
-    if (*(reinterpret_cast<const char *>(&endianTest)))
+    if (*(reinterpret_cast<const char*>(&endianTest)))
     {
         return jenkins_hashbig(key, length, initval);
     }
diff --git a/src/OpenFOAM/primitives/hashes/Hasher/Hasher.H b/src/OpenFOAM/primitives/hashes/Hasher/Hasher.H
index 1fa68d4919330ed1540bd7f7e686818c99ff73d1..85a7ea202c03754cd158fca66c27aa11e6bd3c02 100644
--- a/src/OpenFOAM/primitives/hashes/Hasher/Hasher.H
+++ b/src/OpenFOAM/primitives/hashes/Hasher/Hasher.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2009-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/OpenFOAM/primitives/hashes/Hasher/HasherInt.H b/src/OpenFOAM/primitives/hashes/Hasher/HasherInt.H
index 96be6188a9878e2620d8dc3a181fb4b9f8e2d2a5..f5a1e8b3ff132b1e1b60048e978460ca7c4cd1a8 100644
--- a/src/OpenFOAM/primitives/hashes/Hasher/HasherInt.H
+++ b/src/OpenFOAM/primitives/hashes/Hasher/HasherInt.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2009-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/OpenFOAM/primitives/hashes/SHA1/SHA1.C b/src/OpenFOAM/primitives/hashes/SHA1/SHA1.C
index d6c99831854489b107f1f425d3c591e01823c5ee..4a9444b6a6bf0cb2c6ca65de5ede8df23b695c25 100644
--- a/src/OpenFOAM/primitives/hashes/SHA1/SHA1.C
+++ b/src/OpenFOAM/primitives/hashes/SHA1/SHA1.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2009-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -74,7 +74,7 @@ inline uint32_t Foam::SHA1::swapBytes(uint32_t n)
     const short x = 0x0100;
 
     // yields 0x01 for big endian
-    if (*(reinterpret_cast<const char *>(&x)))
+    if (*(reinterpret_cast<const char*>(&x)))
     {
         return n;
     }
@@ -459,10 +459,5 @@ Foam::SHA1Digest Foam::SHA1::digest() const
 //     }
 // }
 
-// * * * * * * * * * * * * * * Friend Functions  * * * * * * * * * * * * * * //
-
-
-// * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
-
 
 // ************************************************************************* //
diff --git a/src/OpenFOAM/primitives/hashes/SHA1/SHA1.H b/src/OpenFOAM/primitives/hashes/SHA1/SHA1.H
index 4b7080e3df0fe8e362a7206d16773003e16d0544..da19da2d182c0d35189d7bbddcd32b67b05e95f0 100644
--- a/src/OpenFOAM/primitives/hashes/SHA1/SHA1.H
+++ b/src/OpenFOAM/primitives/hashes/SHA1/SHA1.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2009-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -115,10 +115,10 @@ public:
         //- Construct null
         inline SHA1();
 
-        //- Construct and append initial std::string
+        //- Construct null and append initial std::string
         explicit inline SHA1(const std::string&);
 
-        //- Construct and append initial string
+        //- Construct null and append initial string
         explicit inline SHA1(const char*);
 
     // Member Functions
@@ -145,25 +145,44 @@ public:
 
     // Member Operators
 
-        //- Equality operator
+        //- Equality operator, compares %digests
+        inline bool operator==(const SHA1&) const;
+
+        //- Compare %digest
         inline bool operator==(const SHA1Digest&) const;
 
-        //- Inequality operator
-        inline bool operator!=(const SHA1Digest&) const;
+        //- Compare %digest to (40-byte) text representation (eg, from sha1sum)
+        //  An %empty string is equivalent to
+        //  "0000000000000000000000000000000000000000"
+        inline bool operator==(const std::string& hexdigits) const;
+
+        //- Compare %digest to (40-byte) text representation (eg, from sha1sum)
+        //  A %null or %empty string is equivalent to
+        //  "0000000000000000000000000000000000000000"
+        inline bool operator==(const char* hexdigits) const;
 
-        //- Equality operator
-        inline bool operator==(const SHA1&) const;
 
-        //- Inequality operator
+        //- Inequality operator, compares %digests
         inline bool operator!=(const SHA1&) const;
 
-        //- Convert to a digest, calculate current digest from appended data.
+        //- Inequality operator, compare %digest
+        inline bool operator!=(const SHA1Digest&) const;
+
+        //- Inequality operator, compares %digests
+        inline bool operator!=(const std::string& hexdigits) const;
+
+        //- Inequality operator, compare %digest
+        inline bool operator!=(const char* hexdigits) const;
+
+
+        //- Convert to a SHA1Digest,
+        //  calculate current %digest from appended data
         inline operator SHA1Digest() const;
 
-    // Friend Functions
 
     // Friend Operators
 
+        //- Output the %digest
         inline friend Ostream& operator<<(Ostream&, const SHA1&);
 
 };
diff --git a/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C b/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C
index a270dd1d774960297818a47da54bf1b92a433785..7b5d16d722a18a9791eb453f82de1db5408eac54 100644
--- a/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C
+++ b/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2009-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -105,7 +105,7 @@ bool Foam::SHA1Digest::operator==(const SHA1Digest& rhs) const
 
 bool Foam::SHA1Digest::operator!=(const SHA1Digest& rhs) const
 {
-    return !operator==(rhs);
+    return !this->operator==(rhs);
 }
 
 
diff --git a/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.H b/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.H
index 0402dc9884c7ab37450341e28ec2e076b0c88cb2..19c9698d13d860d63082a4f60c14d34bc589774a 100644
--- a/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.H
+++ b/src/OpenFOAM/primitives/hashes/SHA1/SHA1Digest.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2009-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -38,6 +38,8 @@ SourceFiles
 #ifndef SHA1Digest_H
 #define SHA1Digest_H
 
+#include <string>
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 namespace Foam
@@ -75,12 +77,33 @@ public:
     //- Reset the digest to zero
     void clear();
 
+    //- Return true if the digest is empty (ie, all zero).
+    bool empty() const;
+
     //- Equality operator
     bool operator==(const SHA1Digest&) const;
 
+    //- Compare to (40-byte) text representation (eg, from sha1sum)
+    //  An %empty string is equivalent to
+    //  "0000000000000000000000000000000000000000"
+    bool operator==(const std::string& hexdigits) const;
+
+    //- Compare to (40-byte) text representation (eg, from sha1sum)
+    //  A %null or %empty string is equivalent to
+    //  "0000000000000000000000000000000000000000"
+    bool operator==(const char* hexdigits) const;
+
+
     //- Inequality operator
     bool operator!=(const SHA1Digest&) const;
 
+    //- Inequality operator
+    bool operator!=(const std::string& hexdigits) const;
+
+    //- Inequality operator
+    bool operator!=(const char* hexdigits) const;
+
+
     friend Ostream& operator<<(Ostream&, const SHA1Digest&);
     friend Istream& operator>>(Istream&, SHA1Digest&);
 
diff --git a/src/OpenFOAM/primitives/hashes/SHA1/SHA1I.H b/src/OpenFOAM/primitives/hashes/SHA1/SHA1I.H
index e1715bc4c139c7b3303fffc58c7e809188f4e78c..aa05de558c11fc2cb6e1105861e1760948624948 100644
--- a/src/OpenFOAM/primitives/hashes/SHA1/SHA1I.H
+++ b/src/OpenFOAM/primitives/hashes/SHA1/SHA1I.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2009-2011 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -48,9 +48,6 @@ inline Foam::SHA1::SHA1(const char* str)
 }
 
 
-// * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * * //
-
-
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 inline Foam::SHA1& Foam::SHA1::append(const char* data, size_t len)
@@ -79,55 +76,66 @@ inline Foam::SHA1& Foam::SHA1::append(const char* str)
 
 // * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
 
+inline bool Foam::SHA1::operator==(const SHA1& rhs) const
+{
+    return this->digest() == rhs.digest();
+}
+
+
 inline bool Foam::SHA1::operator==(const SHA1Digest& rhs) const
 {
     return this->digest() == rhs;
 }
 
 
-inline bool Foam::SHA1::operator!=(const SHA1Digest& rhs) const
+inline bool Foam::SHA1::operator==(const std::string& hexdigits) const
 {
-    return this->digest() != rhs;
+    return this->digest() == hexdigits;
 }
 
 
-inline bool Foam::SHA1::operator==(const SHA1& rhs) const
+inline bool Foam::SHA1::operator==(const char* hexdigits) const
 {
-    return digest() == rhs.digest();
+    return this->digest() == hexdigits;
 }
 
 
 inline bool Foam::SHA1::operator!=(const SHA1& rhs) const
 {
-    return digest() != rhs.digest();
+    return !this->operator==(rhs);
 }
 
 
-inline Foam::SHA1::operator
-Foam::SHA1Digest () const
+inline bool Foam::SHA1::operator!=(const SHA1Digest& rhs) const
 {
-    return digest();
+    return !this->operator==(rhs);
 }
 
 
-// * * * * * * * * * * * * * * * Friend Functions  * * * * * * * * * * * * * //
+inline bool Foam::SHA1::operator!=(const std::string& rhs) const
+{
+    return !this->operator==(rhs);
+}
 
 
-// * * * * * * * * * * * * * * * Friend Operators  * * * * * * * * * * * * * //
+inline bool Foam::SHA1::operator!=(const char* rhs) const
+{
+    return !this->operator==(rhs);
+}
 
 
-// * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * * //
+inline Foam::SHA1::operator Foam::SHA1Digest() const
+{
+    return digest();
+}
 
 
 // * * * * * * * * * * * * * * * Ostream Operator  * * * * * * * * * * * * * //
 
 inline Foam::Ostream& Foam::operator<<(Ostream& os, const SHA1& sha)
 {
-    return os << sha.digest();
+    return os  << sha.digest();
 }
 
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-
 // ************************************************************************* //
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.C
index fd9928066cec34fdba521c5d74170de1e0709194..e35114025b9ca1ce4bca1e38c087501e3f025ef7 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.C
+++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/SDA/SDA.C
@@ -37,8 +37,8 @@ namespace solidBodyMotionFunctions
 {
     defineTypeNameAndDebug(SDA, 0);
     addToRunTimeSelectionTable(solidBodyMotionFunction, SDA, dictionary);
-};
-};
+}
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.C
index 80f745e7ecf2a3bc4cada3cd6f5859c40b8da6a7..9c8ac0e115b1189f73c06b4c109b27a027474d6f 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.C
+++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/linearMotion/linearMotion.C
@@ -39,8 +39,8 @@ namespace solidBodyMotionFunctions
         linearMotion,
         dictionary
     );
-};
-};
+}
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.C
index 1e42e32555075d882384df3bfbbaacbaf6c04451..9b5008498b6994e8f5aa066e67efc0f9d3368df4 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.C
+++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/multiMotion/multiMotion.C
@@ -39,8 +39,8 @@ namespace solidBodyMotionFunctions
         multiMotion,
         dictionary
     );
-};
-};
+}
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.C
index 58f384c99e9a384c4fab01813279112b2bf3c5a1..6f9e5824a4556455159e95a2858681e360847e96 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.C
+++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingLinearMotion/oscillatingLinearMotion.C
@@ -39,8 +39,8 @@ namespace solidBodyMotionFunctions
         oscillatingLinearMotion,
         dictionary
     );
-};
-};
+}
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.C
index b0bf9d6825952a111ba711969822c69daa524075..55520433b9a7989082cb68e1cbb49783d32560d0 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.C
+++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/oscillatingRotatingMotion/oscillatingRotatingMotion.C
@@ -42,8 +42,8 @@ namespace solidBodyMotionFunctions
         oscillatingRotatingMotion,
         dictionary
     );
-};
-};
+}
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C
index ec95e6ecdd18c7fb1a710950f663269f4361386f..9472f12edab35b4267b070cb140263c1e37a3455 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C
+++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/rotatingMotion/rotatingMotion.C
@@ -42,8 +42,8 @@ namespace solidBodyMotionFunctions
         rotatingMotion,
         dictionary
     );
-};
-};
+}
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C
index adb53704e91a6bd2a1c33a432b1ee159ce7bc29d..e6a8c9ba860c1659dfbab64dd0b79f1545a7fa6f 100644
--- a/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C
+++ b/src/dynamicFvMesh/solidBodyMotionFvMesh/solidBodyMotionFunctions/tabulated6DoFMotion/tabulated6DoFMotion.C
@@ -45,8 +45,8 @@ namespace solidBodyMotionFunctions
         tabulated6DoFMotion,
         dictionary
     );
-};
-};
+}
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/dynamicMesh/polyTopoChange/polyTopoChange/localPointRegion.C b/src/dynamicMesh/polyTopoChange/polyTopoChange/localPointRegion.C
index a6f26df7c031d45784fd0b9e269b49bb11b5583f..96b75f889001c0adcb5cfeaea4ba1b848e3ed5c4 100644
--- a/src/dynamicMesh/polyTopoChange/polyTopoChange/localPointRegion.C
+++ b/src/dynamicMesh/polyTopoChange/polyTopoChange/localPointRegion.C
@@ -55,7 +55,7 @@ public:
                 j = y.rcIndex(j);
             }
         }
-    };
+    }
 };
 
 }
diff --git a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C
index 2f00ad181eea512529a8619e125093539c7bf921..0b66e0e6e6b22d22ef9f174708d8021363ae398a 100644
--- a/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/cfdTools/general/SRF/derivedFvPatchFields/SRFVelocityFvPatchVectorField/SRFVelocityFvPatchVectorField.C
@@ -164,7 +164,7 @@ void Foam::SRFVelocityFvPatchVectorField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         SRFVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFields.C
index 8d97c3818cfe136ea74804ac68fcea1118747a6d..bc8ad3410c259e34d400a34cb6911981d524409c 100644
--- a/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFields.C
+++ b/src/finiteVolume/fields/fvPatchFields/constraint/processorCyclic/processorCyclicFvPatchFields.C
@@ -35,7 +35,11 @@ namespace Foam
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
 makePatchFields(processorCyclic);
-//makePatchTypeField(fvPatchScalarField, processorCyclicFvPatchScalarField);
+// makeTemplatePatchTypeField
+// (
+//     fvPatchScalarField,
+//     processorCyclicFvPatchScalarField
+// );
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C
index 99549a8218394ed8917ab9e563405bfc25f79bd2..a2054b5f0b6b7e31dc1e47e77381a75ead5871ef 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/activeBaffleVelocity/activeBaffleVelocityFvPatchVectorField.C
@@ -310,7 +310,7 @@ void Foam::activeBaffleVelocityFvPatchVectorField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         activeBaffleVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/buoyantPressure/buoyantPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/buoyantPressure/buoyantPressureFvPatchScalarField.C
index cfd92b0c8dbb301efa24789863f9b783f49ff0e6..6b3cee22e02178089ab2a42cecd0fa70588428e8 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/buoyantPressure/buoyantPressureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/buoyantPressure/buoyantPressureFvPatchScalarField.C
@@ -145,7 +145,7 @@ void Foam::buoyantPressureFvPatchScalarField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         buoyantPressureFvPatchScalarField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C
index 6f5d368256ea2b58ff947b517d5627d1157fa30d..271349ef2950310f3861ea5cc78fd167f5e1ae3d 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/cylindricalInletVelocity/cylindricalInletVelocityFvPatchVectorField.C
@@ -161,7 +161,7 @@ void Foam::cylindricalInletVelocityFvPatchVectorField::write(Ostream& os) const
 
 namespace Foam
 {
-   makeNonTemplatedPatchTypeField
+   makePatchTypeField
    (
        fvPatchVectorField,
        cylindricalInletVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
index e83c36111f05434f2ccf841cb788003ceb87c265..9745a50715c5ce5dbe30f5546a224dd2092cb7ef 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
@@ -264,7 +264,7 @@ void Foam::directMappedVelocityFluxFixedValueFvPatchField::write
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         directMappedVelocityFluxFixedValueFvPatchField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H
index 31c51c999d4e9139cec0f556a519dec309a83d79..f7722670d325bac98c2db51bd104ca6eb4f94491 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchField.H
@@ -43,7 +43,7 @@ namespace Foam
 {
 
 /*---------------------------------------------------------------------------*\
-                           Class jumpCyclicFvPatch Declaration
+                       Class fanFvPatchField Declaration
 \*---------------------------------------------------------------------------*/
 
 template<class Type>
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C
index 6d41a654ea7a2777fd2501144601355ab02eb06c..80fff7da82584a37d3d1d7990e77de3474260241 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fan/fanFvPatchFields.C
@@ -35,7 +35,11 @@ namespace Foam
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
-makePatchTypeField(fvPatchScalarField, fanFvPatchScalarField);
+makeTemplatePatchTypeField
+(
+    fvPatchScalarField,
+    fanFvPatchScalarField
+);
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C
index 1c21f64d146b4086474636724009562b89ab353c..ab52c3061295be1586b5635dae43501fea3f180a 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedFluxPressure/fixedFluxPressureFvPatchScalarField.C
@@ -172,7 +172,7 @@ void Foam::fixedFluxPressureFvPatchScalarField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         fixedFluxPressureFvPatchScalarField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchFields.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchFields.C
index 5dbfd69a55c9db58417edae6683a43249c27b1ae..e0a1e082da53b6a06bb4cd8a9e8390af05596a11 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchFields.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedNormalSlip/fixedNormalSlipFvPatchFields.C
@@ -34,8 +34,16 @@ namespace Foam
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
-makePatchTypeField(fvPatchVectorField, fixedNormalSlipFvPatchVectorField);
-makePatchTypeField(fvPatchTensorField, fixedNormalSlipFvPatchTensorField);
+makeTemplatePatchTypeField
+(
+    fvPatchVectorField,
+    fixedNormalSlipFvPatchVectorField
+);
+makeTemplatePatchTypeField
+(
+    fvPatchTensorField,
+    fixedNormalSlipFvPatchTensorField
+);
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C
index 22fac73eeb41676efa6861e7e1cc939325c3ce82..c5487e94fd131242378ece391d0aa52c2d48ffab 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fixedPressureCompressibleDensity/fixedPressureCompressibleDensityFvPatchScalarField.C
@@ -137,7 +137,7 @@ void Foam::fixedPressureCompressibleDensityFvPatchScalarField::write
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         fixedPressureCompressibleDensityFvPatchScalarField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C
index 4d0652c665171e15e67e72ef67f917a9eef22252..28b28fa221d6103e55905b2121ce7d44af011b44 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/flowRateInletVelocity/flowRateInletVelocityFvPatchVectorField.C
@@ -168,7 +168,7 @@ void Foam::flowRateInletVelocityFvPatchVectorField::write(Ostream& os) const
 
 namespace Foam
 {
-   makeNonTemplatedPatchTypeField
+   makePatchTypeField
    (
        fvPatchVectorField,
        flowRateInletVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C
index bdaffac4bd294b80abfcaa3f44f9518b1bd522c2..4879450a2d3e58796bf4dd8b2f7234b871627366 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/fluxCorrectedVelocity/fluxCorrectedVelocityFvPatchVectorField.C
@@ -152,7 +152,7 @@ void Foam::fluxCorrectedVelocityFvPatchVectorField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         fluxCorrectedVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C
index 65b55658f9d567dabe10f23f697f5caaec176daa..18d344f8d32e5b79adc0d82d1cd500501ce882f2 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/freestreamPressure/freestreamPressureFvPatchScalarField.C
@@ -144,7 +144,7 @@ void Foam::freestreamPressureFvPatchScalarField::updateCoeffs()
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         freestreamPressureFvPatchScalarField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C
index 04eb43c98b4508cbc75834c90f2ade27b8a352e0..149f24420985f51efeeef7002f37677e6dd382ed 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/inletOutletTotalTemperature/inletOutletTotalTemperatureFvPatchScalarField.C
@@ -203,7 +203,7 @@ const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         inletOutletTotalTemperatureFvPatchScalarField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C
index aefa37b8f5f6f2e77985aa1283f9c788943f2aab..a9770b98673d9473e6bf856464c580c647384c7f 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/movingWallVelocity/movingWallVelocityFvPatchVectorField.C
@@ -148,7 +148,7 @@ void Foam::movingWallVelocityFvPatchVectorField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         movingWallVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C
index 980087821c2f433668ec6f6260e549bee1248e2c..04d7a3d67bad666167e9094930ad204dde050b11 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletOutletVelocity/pressureDirectedInletOutletVelocityFvPatchVectorField.C
@@ -218,7 +218,7 @@ void Foam::pressureDirectedInletOutletVelocityFvPatchVectorField::operator=
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         pressureDirectedInletOutletVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C
index 1ecafe0e0968f3e1b06ce4622eb68dcdf0e28eaa..8dd9a47481eaaa005d98c90b658e2f368da0a004 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureDirectedInletVelocity/pressureDirectedInletVelocityFvPatchVectorField.C
@@ -204,7 +204,7 @@ void Foam::pressureDirectedInletVelocityFvPatchVectorField::operator=
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         pressureDirectedInletVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C
index d4e4d8aa0a026ba3d202a43019c04076b877c481..6b62f901c5a4acff8392b510265be106eb17f64c 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletOutletVelocity/pressureInletOutletVelocityFvPatchVectorField.C
@@ -213,7 +213,7 @@ void Foam::pressureInletOutletVelocityFvPatchVectorField::operator=
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         pressureInletOutletVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C
index 1131b9a800a16c35d711c4d93acf5291a4415fb6..e26dde8506a6ae45d0d38bb6905ba933074199cb 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletUniformVelocity/pressureInletUniformVelocityFvPatchVectorField.C
@@ -117,7 +117,7 @@ void Foam::pressureInletUniformVelocityFvPatchVectorField::operator=
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         pressureInletUniformVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C
index 6ef3ff50956468064e04e941e3cc22a0f0908952..4cb8ecb67ead7c634a851eaecc0a976d20610f07 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureInletVelocity/pressureInletVelocityFvPatchVectorField.C
@@ -166,7 +166,7 @@ void Foam::pressureInletVelocityFvPatchVectorField::operator=
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         pressureInletVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C
index 0f1577ebcfc93f123d21ea16b53ad5a075e8b7e5..e634a1c0443d233f6850eb9d1a4056a7bef313da 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/pressureNormalInletOutletVelocity/pressureNormalInletOutletVelocityFvPatchVectorField.C
@@ -187,7 +187,7 @@ void Foam::pressureNormalInletOutletVelocityFvPatchVectorField::operator=
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         pressureNormalInletOutletVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C
index f32e945c9aace9826565bd9b7403fdc899a11334..31cbd431502ac2772345b6e76dba56d3e46e74dc 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingPressureInletOutletVelocity/rotatingPressureInletOutletVelocityFvPatchVectorField.C
@@ -134,7 +134,7 @@ void Foam::rotatingPressureInletOutletVelocityFvPatchVectorField::write
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         rotatingPressureInletOutletVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C
index fcde041a1beed49e13e999c90f372f8fb9b8c334..4697d6c88eb5706fd970150acf2befd87234c381 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingTotalPressure/rotatingTotalPressureFvPatchScalarField.C
@@ -127,7 +127,7 @@ void Foam::rotatingTotalPressureFvPatchScalarField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         rotatingTotalPressureFvPatchScalarField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C
index 5f7b493a5595bb790977b825b537b66367e160de..21af4453eafa58f8aa4d0433bc7551f974f95a4d 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/rotatingWallVelocity/rotatingWallVelocityFvPatchVectorField.C
@@ -143,7 +143,7 @@ void Foam::rotatingWallVelocityFvPatchVectorField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         rotatingWallVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C
index 785b03b2d104a2baf925bc5577aafbb0fa3626dc..664b8aa78f4bfc58aa7897046d3dc9dfdac7162c 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/supersonicFreestream/supersonicFreestreamFvPatchVectorField.C
@@ -300,7 +300,7 @@ void Foam::supersonicFreestreamFvPatchVectorField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         supersonicFreestreamFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C
index 300136c9cd2c324ca42435602554ae248502d591..e85efa260c2e536427a9eb8507c8372d14db8841 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/surfaceNormalFixedValue/surfaceNormalFixedValueFvPatchVectorField.C
@@ -134,7 +134,7 @@ void Foam::surfaceNormalFixedValueFvPatchVectorField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         surfaceNormalFixedValueFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
index 2943d37eab4a21a4aad794b8483e2a100e790398..64e9b94d82da3326c42f0e5d58f217856a3e0892 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/swirlFlowRateInletVelocity/swirlFlowRateInletVelocityFvPatchVectorField.C
@@ -189,7 +189,7 @@ void Foam::swirlFlowRateInletVelocityFvPatchVectorField::write
 
 namespace Foam
 {
-   makeNonTemplatedPatchTypeField
+   makePatchTypeField
    (
        fvPatchVectorField,
        swirlFlowRateInletVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C
index e93c26a36854298142ba3a1385a5d537282e46be..281591808ff66df8d83304919556d7d042ac8875 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/syringePressure/syringePressureFvPatchScalarField.C
@@ -247,7 +247,7 @@ void Foam::syringePressureFvPatchScalarField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         syringePressureFvPatchScalarField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C
index cfb2db6f0e1c2a80669a882ca54499dcf05d3436..b00a713b56b33203da88ce4facdc8c2e73015092 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingFlowRateInletVelocity/timeVaryingFlowRateInletVelocityFvPatchVectorField.C
@@ -121,7 +121,7 @@ write(Ostream& os) const
 
 namespace Foam
 {
-   makeNonTemplatedPatchTypeField
+   makePatchTypeField
    (
        fvPatchVectorField,
        timeVaryingFlowRateInletVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformTotalPressure/timeVaryingUniformTotalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformTotalPressure/timeVaryingUniformTotalPressureFvPatchScalarField.C
index c63da946e99b0c34fd6b34efb970e38afe1dd9e7..a0f03b4c6bafcfe025f377a2d7c952eea3c9a01a 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformTotalPressure/timeVaryingUniformTotalPressureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/timeVaryingUniformTotalPressure/timeVaryingUniformTotalPressureFvPatchScalarField.C
@@ -232,7 +232,7 @@ write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         timeVaryingUniformTotalPressureFvPatchScalarField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C
index 15be1f18e140120f234a785d8c224d15011caeec..c9890487fe3f82c24be39b123d5331fad975d77d 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/totalPressure/totalPressureFvPatchScalarField.C
@@ -241,7 +241,7 @@ void Foam::totalPressureFvPatchScalarField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         totalPressureFvPatchScalarField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C
index 5a6c89ec82eee606f704b494b42aeffc1a93d26f..5a3b0e4e1c91347058e0aa08ea50dc4b86fc5cbc 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/totalTemperature/totalTemperatureFvPatchScalarField.C
@@ -190,7 +190,7 @@ void Foam::totalTemperatureFvPatchScalarField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         totalTemperatureFvPatchScalarField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C b/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C
index 01c5f1f83788d2261a0dfa5d1de38b1ff6c155d3..3f8fcc878fd256d39a3bd99a8f3b88e1388d96cd 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/translatingWallVelocity/translatingWallVelocityFvPatchVectorField.C
@@ -124,7 +124,7 @@ void Foam::translatingWallVelocityFvPatchVectorField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         translatingWallVelocityFvPatchVectorField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C
index 944f143c9e66b955c36c33ccdd8d455a35e08044..4c53ea8f95a428e88af94e6ef8e8450bdb0541c3 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/turbulentIntensityKineticEnergyInlet/turbulentIntensityKineticEnergyInletFvPatchScalarField.C
@@ -147,7 +147,7 @@ void Foam::turbulentIntensityKineticEnergyInletFvPatchScalarField::write
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         turbulentIntensityKineticEnergyInletFvPatchScalarField
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
index ae0a92c04fa546614d20947d8f781e5065f5548e..564771b84c4a397f66f87e060f6ae8a0d4baa319 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/uniformDensityHydrostaticPressure/uniformDensityHydrostaticPressureFvPatchScalarField.C
@@ -155,7 +155,7 @@ void Foam::uniformDensityHydrostaticPressureFvPatchScalarField::write
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         uniformDensityHydrostaticPressureFvPatchScalarField
diff --git a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H
index 92f33bd79bfd6eff20e158f0c47c1e442e0b09b5..7d493ebe719377473509ecc9a3aac62547924cf4 100644
--- a/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H
+++ b/src/finiteVolume/fields/fvPatchFields/fvPatchField/fvPatchField.H
@@ -495,18 +495,6 @@ public:
 #endif
 
 
-#define makePatchTypeFieldTypeName(type)                                      \
-    defineNamedTemplateTypeNameAndDebug(type, 0)
-
-
-#define makePatchFieldsTypeName(type)                                         \
-    defineNamedTemplateTypeNameAndDebug(type##FvPatchScalarField, 0);         \
-    defineNamedTemplateTypeNameAndDebug(type##FvPatchVectorField, 0);         \
-    defineNamedTemplateTypeNameAndDebug(type##FvPatchSphericalTensorField, 0);\
-    defineNamedTemplateTypeNameAndDebug(type##FvPatchSymmTensorField, 0);     \
-    defineNamedTemplateTypeNameAndDebug(type##FvPatchTensorField, 0);
-
-
 #define addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField)   \
     addToRunTimeSelectionTable                                                \
     (                                                                         \
@@ -529,45 +517,53 @@ public:
 
 
 // for non-templated patch fields
-#define makeNonTemplatedPatchTypeField(PatchTypeField, typePatchTypeField)    \
+#define makePatchTypeField(PatchTypeField, typePatchTypeField)                \
     defineTypeNameAndDebug(typePatchTypeField, 0);                            \
     addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField)
 
 
 // for templated patch fields
-#define makePatchTypeField(PatchTypeField, typePatchTypeField)                \
+#define makeTemplatePatchTypeField(PatchTypeField, typePatchTypeField)        \
     defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0);               \
     addToPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField)
 
 
 #define makePatchFields(type)                                                 \
-    makePatchTypeField                                                        \
+    makeTemplatePatchTypeField                                                \
     (                                                                         \
         fvPatchScalarField,                                                   \
         type##FvPatchScalarField                                              \
     );                                                                        \
-    makePatchTypeField                                                        \
+    makeTemplatePatchTypeField                                                \
     (                                                                         \
         fvPatchVectorField,                                                   \
         type##FvPatchVectorField                                              \
     );                                                                        \
-    makePatchTypeField                                                        \
+    makeTemplatePatchTypeField                                                \
     (                                                                         \
         fvPatchSphericalTensorField,                                          \
         type##FvPatchSphericalTensorField                                     \
     );                                                                        \
-    makePatchTypeField                                                        \
+    makeTemplatePatchTypeField                                                \
     (                                                                         \
         fvPatchSymmTensorField,                                               \
         type##FvPatchSymmTensorField                                          \
     );                                                                        \
-    makePatchTypeField                                                        \
+    makeTemplatePatchTypeField                                                \
     (                                                                         \
         fvPatchTensorField,                                                   \
         type##FvPatchTensorField                                              \
     );
 
 
+#define makePatchFieldsTypeName(type)                                         \
+    defineNamedTemplateTypeNameAndDebug(type##FvPatchScalarField, 0);         \
+    defineNamedTemplateTypeNameAndDebug(type##FvPatchVectorField, 0);         \
+    defineNamedTemplateTypeNameAndDebug(type##FvPatchSphericalTensorField, 0);\
+    defineNamedTemplateTypeNameAndDebug(type##FvPatchSymmTensorField, 0);     \
+    defineNamedTemplateTypeNameAndDebug(type##FvPatchTensorField, 0)
+
+
 #define makePatchTypeFieldTypedefs(type)                                      \
     typedef type##FvPatchField<scalar> type##FvPatchScalarField;              \
     typedef type##FvPatchField<vector> type##FvPatchVectorField;              \
diff --git a/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options
index 26c2b8abfbc8e6badc58d08bd78c6c53e49a1438..80b316975051c739f21062e1a524716e274317bd 100644
--- a/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options
+++ b/src/fvAgglomerationMethods/MGridGenGamgAgglomeration/Make/options
@@ -12,4 +12,4 @@ EXE_INC = \
     $(TYPE_REAL)
 
 LIB_LIBS = \
-    -lMGridGen
+    -L$(FOAM_EXT_LIBBIN) -lMGridGen
diff --git a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C
index 786c3b600809e03ec87c7e5b26b98e548432c459..ca5a17e793b9eb2de3ae9b7c4f3e952344e4c789 100644
--- a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C
+++ b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingDisplacement/angularOscillatingDisplacementPointPatchVectorField.C
@@ -196,7 +196,7 @@ void angularOscillatingDisplacementPointPatchVectorField::write
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPointPatchTypeField
+makePointPatchTypeField
 (
     pointPatchVectorField,
     angularOscillatingDisplacementPointPatchVectorField
diff --git a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C
index aa9bce36ee92a4a6d22cf5a62f44b1d76403ece7..a4d4550ec8d83abf5c3c19d59ffcee88392d549b 100644
--- a/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C
+++ b/src/fvMotionSolver/pointPatchFields/derived/angularOscillatingVelocity/angularOscillatingVelocityPointPatchVectorField.C
@@ -201,7 +201,7 @@ void angularOscillatingVelocityPointPatchVectorField::write
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPointPatchTypeField
+makePointPatchTypeField
 (
     pointPatchVectorField,
     angularOscillatingVelocityPointPatchVectorField
diff --git a/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.C
index fbadba14ac2870a56c648f9dc83237503e9155a7..aa0674683ddf727371961e30fbd8f7d69855a0b3 100644
--- a/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.C
+++ b/src/fvMotionSolver/pointPatchFields/derived/oscillatingDisplacement/oscillatingDisplacementPointPatchVectorField.C
@@ -127,7 +127,7 @@ void oscillatingDisplacementPointPatchVectorField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPointPatchTypeField
+makePointPatchTypeField
 (
     pointPatchVectorField,
     oscillatingDisplacementPointPatchVectorField
diff --git a/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C
index 30fdf7382a7ed4c8cd8293911056ed9b922870d7..b9cbac6460ad8afce5de96f525870bca32645fa1 100644
--- a/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C
+++ b/src/fvMotionSolver/pointPatchFields/derived/oscillatingVelocity/oscillatingVelocityPointPatchVectorField.C
@@ -171,7 +171,7 @@ void oscillatingVelocityPointPatchVectorField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPointPatchTypeField
+makePointPatchTypeField
 (
     pointPatchVectorField,
     oscillatingVelocityPointPatchVectorField
diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C
index f2c4ce669ca373ebae21c375bcade8a61d186a4f..2e0bc79ba59daa38112a80a7deb417da3dc4ee7a 100644
--- a/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C
+++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceDisplacement/surfaceDisplacementPointPatchVectorField.C
@@ -499,7 +499,7 @@ void surfaceDisplacementPointPatchVectorField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPointPatchTypeField
+makePointPatchTypeField
 (
     fixedValuePointPatchVectorField,
     surfaceDisplacementPointPatchVectorField
diff --git a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C
index 3eedadcc843cbb68d5d5f4c0d08e9508f3db77c2..2c5edb340abb3dde53e46d3c733eaab7a52b288f 100644
--- a/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C
+++ b/src/fvMotionSolver/pointPatchFields/derived/surfaceSlipDisplacement/surfaceSlipDisplacementPointPatchVectorField.C
@@ -448,7 +448,7 @@ void surfaceSlipDisplacementPointPatchVectorField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPointPatchTypeField
+makePointPatchTypeField
 (
     pointPatchVectorField,
     surfaceSlipDisplacementPointPatchVectorField
diff --git a/src/lagrangian/basic/InteractionLists/InteractionLists.C b/src/lagrangian/basic/InteractionLists/InteractionLists.C
index 15dd9027b93f50bbf1af764da1c611145562e1f6..f344fecc2fbdc5fd710db82e3f56b6b646e41402 100644
--- a/src/lagrangian/basic/InteractionLists/InteractionLists.C
+++ b/src/lagrangian/basic/InteractionLists/InteractionLists.C
@@ -1195,7 +1195,7 @@ void Foam::InteractionLists<ParticleType>::sendReferredData
     // buffer but not block, i.e. it is calling
     //     pBufs.finishedSends(false);
     wallFaceMap().send(pBufs, referredWallData_);
-};
+}
 
 
 template<class ParticleType>
diff --git a/src/lagrangian/basic/Particle/ParticleI.H b/src/lagrangian/basic/Particle/ParticleI.H
index cf135b3229ac09589e3cedd219acc436047952fb..e39931adaaabc6a1c992b3d7ffceb4e382b5df1c 100644
--- a/src/lagrangian/basic/Particle/ParticleI.H
+++ b/src/lagrangian/basic/Particle/ParticleI.H
@@ -104,7 +104,7 @@ inline Foam::scalar Foam::Particle<ParticleType>::tetLambda
         if (mag(lambdaNumerator) < SMALL)
         {
             // Track starts on the face, and is potentially
-            // parallel to it.  +-SMALL)/+-SMALL is not a good
+            // parallel to it.  +-SMALL/+-SMALL is not a good
             // comparison, return 0.0, in anticipation of tet
             // centre correction.
 
diff --git a/src/lagrangian/basic/passiveParticle/passiveParticleCloud.C b/src/lagrangian/basic/passiveParticle/passiveParticleCloud.C
index 5c297cb44d3889e7d9e2884b2f9a84af33c4a2b0..ad9a2d29ff966075c14276ce43cb44244ec8f11b 100644
--- a/src/lagrangian/basic/passiveParticle/passiveParticleCloud.C
+++ b/src/lagrangian/basic/passiveParticle/passiveParticleCloud.C
@@ -25,17 +25,13 @@ License
 
 #include "passiveParticleCloud.H"
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
 namespace Foam
 {
-
-// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
-
-defineParticleTypeNameAndDebug(passiveParticle, 0);
-defineTemplateTypeNameAndDebug(Cloud<passiveParticle>, 0);
-
-};
+    defineParticleTypeNameAndDebug(passiveParticle, 0);
+    defineTemplateTypeNameAndDebug(Cloud<passiveParticle>, 0);
+}
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
diff --git a/src/lagrangian/coalCombustion/coalParcel/defineCoalParcel.C b/src/lagrangian/coalCombustion/coalParcel/defineCoalParcel.C
index e6aa0453e905da6d284bec2d3429dfea6543bc18..331ac1732766db1e9dd2400d9057644201aa1239 100644
--- a/src/lagrangian/coalCombustion/coalParcel/defineCoalParcel.C
+++ b/src/lagrangian/coalCombustion/coalParcel/defineCoalParcel.C
@@ -31,7 +31,7 @@ License
 namespace Foam
 {
     createReactingMultiphaseParcelTypes(coalParcel);
-};
+}
 
 
 // ************************************************************************* //
diff --git a/src/lagrangian/coalCombustion/coalParcel/makeCoalParcelSubmodels.C b/src/lagrangian/coalCombustion/coalParcel/makeCoalParcelSubmodels.C
index 9a92dc377eea2d0fba58be1e99150572a3e8901f..2bbd6777a2fe2f46b24926cfe618af98a1df3b01 100644
--- a/src/lagrangian/coalCombustion/coalParcel/makeCoalParcelSubmodels.C
+++ b/src/lagrangian/coalCombustion/coalParcel/makeCoalParcelSubmodels.C
@@ -70,7 +70,7 @@ namespace Foam
     makeReactingMultiphaseParcelDevolatilisationModels(coalParcel);
     makeReactingParcelSurfaceFilmModels(coalParcel);
     makeCoalParcelSurfaceReactionModels(coalParcel);
-};
+}
 
 
 // ************************************************************************* //
diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/defineDsmcParcel.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/defineDsmcParcel.C
index 1e6a6e917b94b5d68fec02016f1a7162bf15c71c..2c3040e9ace7501368b5f319bd63034d494d9644 100644
--- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/defineDsmcParcel.C
+++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/defineDsmcParcel.C
@@ -31,7 +31,7 @@ namespace Foam
     defineTemplateTypeNameAndDebug(Cloud<dsmcParcel>, 0);
 
     defineParcelTypeNameAndDebug(DsmcCloud<dsmcParcel>, 0);
-};
+}
 
 
 // ************************************************************************* //
diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.C
index 91fa156c639fa6b9c2e7f141f2c419456983b9fe..ec18136d3804e20d6c134ea22a6c59593acaade6 100644
--- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.C
+++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/dsmcParcel.C
@@ -32,7 +32,7 @@ namespace Foam
     defineTypeNameAndDebug(dsmcParcel, 0);
     defineParticleTypeNameAndDebug(dsmcParcel, 0);
     defineParcelTypeNameAndDebug(dsmcParcel, 0);
-};
+}
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelBinaryCollisionModels.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelBinaryCollisionModels.C
index 1e8356ef5fea5c12e5abbfea88a995bf95147687..f8f8d7f17a4719ad77eccb86d681c6c48e19d119 100644
--- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelBinaryCollisionModels.C
+++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelBinaryCollisionModels.C
@@ -52,7 +52,7 @@ namespace Foam
         DsmcCloud,
         dsmcParcel
     );
-};
+}
 
 
 // ************************************************************************* //
diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelInflowBoundaryModels.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelInflowBoundaryModels.C
index 364f2a721fde9518570653c520b07416025548ff..d12204e47317c06b8fb042b0fdc957dcf893dc9c 100644
--- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelInflowBoundaryModels.C
+++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelInflowBoundaryModels.C
@@ -45,7 +45,7 @@ namespace Foam
         DsmcCloud,
         dsmcParcel
     );
-};
+}
 
 
 // ************************************************************************* //
diff --git a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelWallInteractionModels.C b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelWallInteractionModels.C
index 08e78b2713c7f7d5957425abb589d635ec4829be..6a6d3891616f6c35c345c128f0bef221deaf9b28 100644
--- a/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelWallInteractionModels.C
+++ b/src/lagrangian/dsmc/parcels/derived/dsmcParcel/makeDsmcParcelWallInteractionModels.C
@@ -52,7 +52,7 @@ namespace Foam
         DsmcCloud,
         dsmcParcel
     );
-};
+}
 
 
 // ************************************************************************* //
diff --git a/src/lagrangian/intermediate/IntegrationScheme/makeIntegrationSchemes.C b/src/lagrangian/intermediate/IntegrationScheme/makeIntegrationSchemes.C
index 4f934c892f86f0e070a0582f514ae4fcd2f9cbf1..5ce6e87d636e59f1777267019ab537ba58bd35be 100644
--- a/src/lagrangian/intermediate/IntegrationScheme/makeIntegrationSchemes.C
+++ b/src/lagrangian/intermediate/IntegrationScheme/makeIntegrationSchemes.C
@@ -39,7 +39,7 @@ namespace Foam
     makeIntegrationScheme(vector);
     makeIntegrationSchemeType(Euler, vector);
     makeIntegrationSchemeType(Analytical, vector);
-};
+}
 
 
 // ************************************************************************* //
diff --git a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/defineBasicKinematicParcel.C b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/defineBasicKinematicParcel.C
index 973a70dbb0b20b08d97ec759441d75c92508e04d..e8dfec45aca2df01392c28c095a9afe5413d2745 100644
--- a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/defineBasicKinematicParcel.C
+++ b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/defineBasicKinematicParcel.C
@@ -31,7 +31,7 @@ License
 namespace Foam
 {
     createKinematicParcelTypes(basicKinematicParcel);
-};
+}
 
 
 // ************************************************************************* //
diff --git a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C
index d6c2d4532e69a09ecd332ef6a6178b0e9cffaf0a..27c54abfd29b80a0d69128a61387a8033d223c28 100644
--- a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C
+++ b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C
@@ -46,7 +46,7 @@ namespace Foam
     makeParcelPatchInteractionModels(basicKinematicParcel);
     makeParcelPostProcessingModels(basicKinematicParcel);
     makeParcelSurfaceFilmModels(basicKinematicParcel);
-};
+}
 
 
 // ************************************************************************* //
diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C
index 3c3e9fe8fa0677388f24393cf50a469e4858141c..78de4affcc6b78397e53d6bd65f4df2f31fb6142 100644
--- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C
+++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C
@@ -31,7 +31,7 @@ License
 namespace Foam
 {
     createReactingMultiphaseParcelTypes(basicReactingMultiphaseParcel);
-};
+}
 
 
 // ************************************************************************* //
diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C
index 490d99b11608afd1aeeecfa779f98891b620c7ba..fa38f8a5e2f6e5a47089dd36e1fe5e7ba0caeac3 100644
--- a/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C
+++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C
@@ -80,7 +80,7 @@ namespace Foam
     (
         basicReactingMultiphaseParcel
     );
-};
+}
 
 
 // ************************************************************************* //
diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C
index 0eb06eedd57704f244502c2135103321ee620c59..0b8136e8083b16d7d180cbeed0fc0212a062a647 100644
--- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C
+++ b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C
@@ -31,7 +31,7 @@ License
 namespace Foam
 {
     createReactingParcelTypes(basicReactingParcel);
-};
+}
 
 
 // ************************************************************************* //
diff --git a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C
index cd4f0e1775668da6c655247a0e43a3ecf26d8f71..b1e3978011513b76fb13b016a2dca49df7e8f55a 100644
--- a/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C
+++ b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C
@@ -60,7 +60,7 @@ namespace Foam
     makeReactingParcelCompositionModels(basicReactingParcel);
     makeReactingParcelPhaseChangeModels(basicReactingParcel);
     makeReactingParcelSurfaceFilmModels(basicReactingParcel);
-};
+}
 
 
 // ************************************************************************* //
diff --git a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/defineBasicThermoParcel.C b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/defineBasicThermoParcel.C
index a98be4baada8db9187adbd5b06c0126878f0ef78..660081b993895c1a3ed5efe205585092a791948f 100644
--- a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/defineBasicThermoParcel.C
+++ b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/defineBasicThermoParcel.C
@@ -31,7 +31,7 @@ License
 namespace Foam
 {
     createThermoParcelTypes(basicThermoParcel);
-};
+}
 
 
 // ************************************************************************* //
diff --git a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/makeBasicThermoParcelSubmodels.C b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/makeBasicThermoParcelSubmodels.C
index ef873cf15cd3cf47d85a73b9666ccf91613fa203..289e6d38cd0bbb391c85eae4accb1ef5529082f4 100644
--- a/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/makeBasicThermoParcelSubmodels.C
+++ b/src/lagrangian/intermediate/parcels/derived/basicThermoParcel/makeBasicThermoParcelSubmodels.C
@@ -52,7 +52,7 @@ namespace Foam
     // Thermo sub-models
     makeParcelHeatTransferModels(basicThermoParcel);
     makeParcelSurfaceFilmModels(basicThermoParcel);
-};
+}
 
 
 // ************************************************************************* //
diff --git a/src/lagrangian/intermediate/submodels/IO/DataEntry/makeDataEntries.C b/src/lagrangian/intermediate/submodels/IO/DataEntry/makeDataEntries.C
index 71d7c1d05bdcf3da584a530f842d7ff3ab049d1d..942229f5f3d3eaeb7c010ddcfefd21d3e6cbe6b7 100644
--- a/src/lagrangian/intermediate/submodels/IO/DataEntry/makeDataEntries.C
+++ b/src/lagrangian/intermediate/submodels/IO/DataEntry/makeDataEntries.C
@@ -44,7 +44,7 @@ namespace Foam
     makeDataEntry(vector);
     makeDataEntryType(Constant, vector);
     makeDataEntryType(Table, vector);
-};
+}
 
 
 // ************************************************************************* //
diff --git a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C
index 413f0e1f225f4b702f4ae5583ea027caaaec69e1..6ed75ee923900f423bc25bf939fe7be7c98b9e42 100644
--- a/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C
+++ b/src/lagrangian/molecularDynamics/molecule/moleculeCloud/moleculeCloud.C
@@ -35,7 +35,7 @@ namespace Foam
 {
     defineParticleTypeNameAndDebug(molecule, 0);
     defineTemplateTypeNameAndDebug(Cloud<molecule>, 0);
-};
+}
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
diff --git a/src/lagrangian/solidParticle/solidParticleCloud.C b/src/lagrangian/solidParticle/solidParticleCloud.C
index cc4543cb6a0a8b77d34f758ee450b98d9c0cb4f3..8badea136df3425a34508cd38094a51c8866ca0f 100644
--- a/src/lagrangian/solidParticle/solidParticleCloud.C
+++ b/src/lagrangian/solidParticle/solidParticleCloud.C
@@ -34,7 +34,7 @@ namespace Foam
 {
     defineParticleTypeNameAndDebug(solidParticle, 0);
     defineTemplateTypeNameAndDebug(Cloud<solidParticle>, 0);
-};
+}
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
diff --git a/src/mesh/blockMesh/blockMesh/blockMeshMerge.C b/src/mesh/blockMesh/blockMesh/blockMeshMerge.C
index a6f2c72876feea98432fa3236f82b25ca0221c58..8c9b0eb19b7eac643cdd09a0b4dfe42021d88dda 100644
--- a/src/mesh/blockMesh/blockMesh/blockMeshMerge.C
+++ b/src/mesh/blockMesh/blockMesh/blockMeshMerge.C
@@ -102,7 +102,7 @@ void Foam::blockMesh::calcMergeInfo()
             FatalErrorIn("blockMesh::calcMergeInfo()")
                 << "Cannot find merge face for block " << blockPlabel
                 << exit(FatalError);
-        };
+        }
 
         const labelListList& blockPfaceFaces =
             blocks[blockPlabel].boundaryPatches()[blockPfaceLabel];
@@ -211,7 +211,7 @@ void Foam::blockMesh::calcMergeInfo()
             FatalErrorIn("blockMesh::calcMergeInfo()")
                 << "Cannot find merge face for block " << blockNlabel
                 << exit(FatalError);
-        };
+        }
 
         const labelListList& blockNfaceFaces =
             blocks[blockNlabel].boundaryPatches()[blockNfaceLabel];
@@ -471,7 +471,7 @@ void Foam::blockMesh::calcMergeInfo()
             FatalErrorIn("blockMesh::calcMergeInfo()")
                 << "Cannot find merge face for block " << blockPlabel
                 << exit(FatalError);
-        };
+        }
 
         foundFace = false;
         label blockNfaceLabel;
@@ -498,7 +498,7 @@ void Foam::blockMesh::calcMergeInfo()
             FatalErrorIn("blockMesh::calcMergeInfo()")
                 << "Cannot find merge face for block " << blockNlabel
                 << exit(FatalError);
-        };
+        }
 
         const labelListList& blockPfaceFaces =
             blocks[blockPlabel].boundaryPatches()[blockPfaceLabel];
diff --git a/src/parallel/decompose/Allwmake b/src/parallel/decompose/Allwmake
index 22515e65d2f57824c54f2b7941816b0a60a740ac..cb053bcc3e811423065066a35578544f55d49fda 100755
--- a/src/parallel/decompose/Allwmake
+++ b/src/parallel/decompose/Allwmake
@@ -1,7 +1,7 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # run from this directory
 
-# get SCOTCH_VERSION, SCOTCH_ARCH_PATH
+# get SCOTCH_VERSION, SCOTCH_ARCH_PATH, SCOTCH_MPI_INCLUDE
 settings=`$WM_PROJECT_DIR/bin/foamEtcFile apps/scotch/bashrc`
 if [ -f "$settings" ]
 then
diff --git a/src/parallel/decompose/metisDecomp/Make/files b/src/parallel/decompose/metisDecomp/Make/files
index 39ee731e4d02e5c17cd2a3fb56fbe12606424ad7..030326722ab549d205e6020e1a2c235ae31304f5 100644
--- a/src/parallel/decompose/metisDecomp/Make/files
+++ b/src/parallel/decompose/metisDecomp/Make/files
@@ -1,3 +1,3 @@
 metisDecomp.C
 
-LIB = $(FOAM_LIBBIN)/libmetisDecomp
+LIB = $(FOAM_EXT_LIBBIN)/libmetisDecomp
diff --git a/src/parallel/decompose/metisDecomp/Make/options b/src/parallel/decompose/metisDecomp/Make/options
index 00bdb28b596e234b783fb4f6dc16008139ab998a..a6a0f1433e8a364c61bc2081133cc67eff90483a 100644
--- a/src/parallel/decompose/metisDecomp/Make/options
+++ b/src/parallel/decompose/metisDecomp/Make/options
@@ -4,5 +4,4 @@ EXE_INC = \
     -I../decompositionMethods/lnInclude
 
 LIB_LIBS = \
-    -lmetis \
-    -lGKlib
+    -L$(FOAM_EXT_LIBBIN) -lmetis -lGKlib
diff --git a/src/parallel/decompose/ptscotchDecomp/Make/options b/src/parallel/decompose/ptscotchDecomp/Make/options
index 17e6ea5ced3c94e62916539cec9bf1906b7c9be5..d4f56eb39a42e7e3a48d3eeda17d20f2384bc525 100644
--- a/src/parallel/decompose/ptscotchDecomp/Make/options
+++ b/src/parallel/decompose/ptscotchDecomp/Make/options
@@ -3,7 +3,7 @@ sinclude $(RULES)/mplib$(WM_MPLIB)
 
 EXE_INC = \
     $(PFLAGS) $(PINC) \
-    -I$(SCOTCH_ARCH_PATH)/include \
+    -I$(SCOTCH_MPI_INCLUDE) \
     -I/usr/include/scotch \
     -I../decompositionMethods/lnInclude
 
diff --git a/src/parallel/decompose/scotchDecomp/Make/files b/src/parallel/decompose/scotchDecomp/Make/files
index 59717fa15c8d33b2b3e3389075356565d2da2726..dbb178726c9cf9ffc7e81497d8062562e8c5fce9 100644
--- a/src/parallel/decompose/scotchDecomp/Make/files
+++ b/src/parallel/decompose/scotchDecomp/Make/files
@@ -1,3 +1,3 @@
 scotchDecomp.C
 
-LIB = $(FOAM_LIBBIN)/libscotchDecomp
+LIB = $(FOAM_EXT_LIBBIN)/libscotchDecomp
diff --git a/src/parallel/decompose/scotchDecomp/Make/options b/src/parallel/decompose/scotchDecomp/Make/options
index c832cc0b7cdd119853edb938ff9bbf49d52d69d5..8397463ae5f489e6a581976ec98c7997e2a0f633 100644
--- a/src/parallel/decompose/scotchDecomp/Make/options
+++ b/src/parallel/decompose/scotchDecomp/Make/options
@@ -4,4 +4,4 @@ EXE_INC = \
     -I../decompositionMethods/lnInclude
 
 LIB_LIBS = \
-    -lscotch -lscotcherrexit -lrt
+    -L$(FOAM_EXT_LIBBIN) -lscotch -lscotcherrexit -lrt
diff --git a/src/parallel/decompose/scotchDecomp/scotchDecomp.C b/src/parallel/decompose/scotchDecomp/scotchDecomp.C
index e7262bcbd7d91f5228cf4b4b8fc85da558fbeb18..b569b0bae5c83cfd83b699539a577fa1b32e837e 100644
--- a/src/parallel/decompose/scotchDecomp/scotchDecomp.C
+++ b/src/parallel/decompose/scotchDecomp/scotchDecomp.C
@@ -108,8 +108,8 @@ License
 #include "addToRunTimeSelectionTable.H"
 #include "floatScalar.H"
 #include "Time.H"
-#include "cyclicPolyPatch.H"
 #include "OFstream.H"
+#include "globalIndex.H"
 
 extern "C"
 {
@@ -162,7 +162,6 @@ void Foam::scotchDecomp::check(const int retVal, const char* str)
 }
 
 
-// Call scotch with options from dictionary.
 Foam::label Foam::scotchDecomp::decompose
 (
     const fileName& meshPath,
@@ -172,6 +171,128 @@ Foam::label Foam::scotchDecomp::decompose
 
     List<int>& finalDecomp
 )
+{
+    if (!Pstream::parRun())
+    {
+        decomposeOneProc
+        (
+            meshPath,
+            adjncy,
+            xadj,
+            cWeights,
+            finalDecomp
+        );
+    }
+    else
+    {
+        if (debug)
+        {
+            Info<< "scotchDecomp : running in parallel."
+                << " Decomposing all of graph on master processor." << endl;
+        }
+        globalIndex globalCells(xadj.size()-1);
+        label nTotalConnections = returnReduce(adjncy.size(), sumOp<label>());
+
+        // Send all to master. Use scheduled to save some storage.
+        if (Pstream::master())
+        {
+            Field<int> allAdjncy(nTotalConnections);
+            Field<int> allXadj(globalCells.size()+1);
+            scalarField allWeights(globalCells.size());
+
+            // Insert my own
+            label nTotalCells = 0;
+            forAll(cWeights, cellI)
+            {
+                allXadj[nTotalCells] = xadj[cellI];
+                allWeights[nTotalCells++] = cWeights[cellI];
+            }
+            nTotalConnections = 0;
+            forAll(adjncy, i)
+            {
+                allAdjncy[nTotalConnections++] = adjncy[i];
+            }
+
+            for (int slave=1; slave<Pstream::nProcs(); slave++)
+            {
+                IPstream fromSlave(Pstream::scheduled, slave);
+                Field<int> nbrAdjncy(fromSlave);
+                Field<int> nbrXadj(fromSlave);
+                scalarField nbrWeights(fromSlave);
+
+                // Append.
+                //label procStart = nTotalCells;
+                forAll(nbrXadj, cellI)
+                {
+                    allXadj[nTotalCells] = nTotalConnections+nbrXadj[cellI];
+                    allWeights[nTotalCells++] = nbrWeights[cellI];
+                }
+                // No need to renumber xadj since already global.
+                forAll(nbrAdjncy, i)
+                {
+                    allAdjncy[nTotalConnections++] = nbrAdjncy[i];
+                }
+            }
+            allXadj[nTotalCells] = nTotalConnections;
+
+
+            Field<int> allFinalDecomp;
+            decomposeOneProc
+            (
+                meshPath,
+                allAdjncy,
+                allXadj,
+                allWeights,
+                allFinalDecomp
+            );
+
+
+            // Send allFinalDecomp back
+            for (int slave=1; slave<Pstream::nProcs(); slave++)
+            {
+                OPstream toSlave(Pstream::scheduled, slave);
+                toSlave << SubField<int>
+                (
+                    allFinalDecomp,
+                    globalCells.localSize(slave),
+                    globalCells.offset(slave)
+                );
+            }
+            // Get my own part (always first)
+            finalDecomp = SubField<int>
+            (
+                allFinalDecomp,
+                globalCells.localSize()
+            );
+        }
+        else
+        {
+            // Send my part of the graph (already in global numbering)
+            {
+                OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
+                toMaster<< adjncy << SubField<int>(xadj, xadj.size()-1)
+                    << cWeights;
+            }
+
+            // Receive back decomposition
+            IPstream fromMaster(Pstream::scheduled, Pstream::masterNo());
+            fromMaster >> finalDecomp;
+        }
+    }
+    return 0;
+}
+
+
+// Call scotch with options from dictionary.
+Foam::label Foam::scotchDecomp::decomposeOneProc
+(
+    const fileName& meshPath,
+    const List<int>& adjncy,
+    const List<int>& xadj,
+    const scalarField& cWeights,
+
+    List<int>& finalDecomp
+)
 {
     // Dump graph
     if (decompositionDict_.found("scotchCoeffs"))
@@ -247,7 +368,8 @@ Foam::label Foam::scotchDecomp::decompose
 
 
     // Check for externally provided cellweights and if so initialise weights
-    scalar minWeights = gMin(cWeights);
+    // Note: min, not gMin since routine runs on master only.
+    scalar minWeights = min(cWeights);
     if (cWeights.size() > 0)
     {
         if (minWeights <= 0)
@@ -432,7 +554,7 @@ Foam::labelList Foam::scotchDecomp::decompose
             << exit(FatalError);
     }
 
-
+    // Calculate local or global (if Pstream::parRun()) connectivity
     CompactListList<label> cellCells;
     calcCellCells(mesh, identity(mesh.nCells()), mesh.nCells(), cellCells);
 
@@ -475,6 +597,7 @@ Foam::labelList Foam::scotchDecomp::decompose
             << exit(FatalError);
     }
 
+    // Calculate local or global (if Pstream::parRun()) connectivity
     CompactListList<label> cellCells;
     calcCellCells(mesh, agglom, agglomPoints.size(), cellCells);
 
@@ -528,7 +651,14 @@ Foam::labelList Foam::scotchDecomp::decompose
 
     // Decompose using weights
     List<int> finalDecomp;
-    decompose(".", cellCells.m(), cellCells.offsets(), cWeights, finalDecomp);
+    decompose
+    (
+        "scotch",
+        cellCells.m(),
+        cellCells.offsets(),
+        cWeights,
+        finalDecomp
+    );
 
     // Copy back to labelList
     labelList decomp(finalDecomp.size());
diff --git a/src/parallel/decompose/scotchDecomp/scotchDecomp.H b/src/parallel/decompose/scotchDecomp/scotchDecomp.H
index a07c5704a5510b4f13bcba5b1720a5e22a8cbff1..a4348a7641337fcc7aa945fbff7f6e7518e4829d 100644
--- a/src/parallel/decompose/scotchDecomp/scotchDecomp.H
+++ b/src/parallel/decompose/scotchDecomp/scotchDecomp.H
@@ -25,7 +25,10 @@ Class
     Foam::scotchDecomp
 
 Description
-    Scotch domain decomposition
+    Scotch domain decomposition.
+    When run in parallel will collect the whole graph on to the master,
+    decompose and send back. Run ptscotchDecomp for proper distributed
+    decomposition.
 
 SourceFiles
     scotchDecomp.C
@@ -62,6 +65,16 @@ class scotchDecomp
             List<int>& finalDecomp
         );
 
+        //- Decompose non-parallel
+        label decomposeOneProc
+        (
+            const fileName& meshPath,
+            const List<int>& adjncy,
+            const List<int>& xadj,
+            const scalarField& cWeights,
+            List<int>& finalDecomp
+        );
+
         //- Disallow default bitwise copy construct and assignment
         void operator=(const scotchDecomp&);
         scotchDecomp(const scotchDecomp&);
@@ -88,8 +101,8 @@ public:
 
         virtual bool parallelAware() const
         {
-            // Metis does not know about proc boundaries
-            return false;
+            // Knows about coupled boundaries
+            return true;
         }
 
         //- Return for every coordinate the wanted processor number. Use the
diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C
index e14b11200bbdb7bbaf318b63e6916a888c34f11f..5388f8a2a0e3a4e8f3daf7874c39a6075b545018 100644
--- a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C
+++ b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C
@@ -51,7 +51,7 @@ Foam::scalar Foam::streamLineParticle::calcSubCycleDeltaT
     scalar fraction = testParticle.trackToFace(position()+dt*U, td);
     td.keepParticle = oldKeepParticle;
     td.switchProcessor = oldSwitchProcessor;
-    // Adapt the dt to subdivide the trajectory into 4 substeps.
+    // Adapt the dt to subdivide the trajectory into substeps.
     return dt*fraction/td.nSubCycle_;
 }
 
diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C
index 6109090ef4c5be74242185daf20b831baa7ee607..1049650cb248ca94406a4ac3892fb458e7272a50 100644
--- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C
+++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/sixDoFRigidBodyDisplacement/sixDoFRigidBodyDisplacementPointPatchVectorField.C
@@ -268,7 +268,7 @@ void sixDoFRigidBodyDisplacementPointPatchVectorField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPointPatchTypeField
+makePointPatchTypeField
 (
     pointPatchVectorField,
     sixDoFRigidBodyDisplacementPointPatchVectorField
diff --git a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.C b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.C
index f9207a81103b2c55a0517f2aa60385c355ce02a8..4ae7651f631baac421c69464281585c5188d4592 100644
--- a/src/postProcessing/functionObjects/forces/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.C
+++ b/src/postProcessing/functionObjects/forces/pointPatchFields/derived/uncoupledSixDoFRigidBodyDisplacement/uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField.C
@@ -185,7 +185,7 @@ void uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField::write
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPointPatchTypeField
+makePointPatchTypeField
 (
     pointPatchVectorField,
     uncoupledSixDoFRigidBodyDisplacementPointPatchVectorField
diff --git a/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C b/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C
index 78484ccaeb0b0c92901e9f4fb5d3570a6e658341..7dea8cdb9148c854a4469cdeb9f6d9447bf06df9 100644
--- a/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C
+++ b/src/surfaceFilmModels/derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C
@@ -156,7 +156,7 @@ void Foam::filmHeightInletVelocityFvPatchVectorField::operator=
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchVectorField,
         filmHeightInletVelocityFvPatchVectorField
diff --git a/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C b/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C
index b5137c087b6c11dfa7f684cd31817312ad6458ab..261ecaea8f7272533710836e826d756225820647 100644
--- a/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C
+++ b/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C
@@ -150,7 +150,7 @@ void htcConvFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     htcConvFvPatchScalarField
diff --git a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C
index 23e883cd32e856141a709f8de85c962c0a50917d..6245c6398b361316d773293de79f7050cf6d48a1 100644
--- a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C
+++ b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C
@@ -234,7 +234,7 @@ void alphatFilmWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     alphatFilmWallFunctionFvPatchScalarField
diff --git a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C
index 07afc327399292022cc71ecdfb34b23a36b2e207..2f0c39439061017b01bf4fbd60d3096bef20fc71 100644
--- a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C
+++ b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C
@@ -237,7 +237,7 @@ void mutFilmWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     mutFilmWallFunctionFvPatchScalarField
diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnthalpy/fixedEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnthalpy/fixedEnthalpyFvPatchScalarField.C
index 8dc9d9bd153237a8cda67edba2a0b0f6c8bdba56..39a4013c02ab336e9d878434887e1480950de7fd 100644
--- a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnthalpy/fixedEnthalpyFvPatchScalarField.C
+++ b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnthalpy/fixedEnthalpyFvPatchScalarField.C
@@ -120,7 +120,7 @@ void Foam::fixedEnthalpyFvPatchScalarField::updateCoeffs()
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         fixedEnthalpyFvPatchScalarField
diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedInternalEnergy/fixedInternalEnergyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedInternalEnergy/fixedInternalEnergyFvPatchScalarField.C
index e7dc50385c5d48751165c6a2fe4df4bfba68f3d4..c24e7f6bae3a8a04d5088f569ebf9b89c0442185 100644
--- a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedInternalEnergy/fixedInternalEnergyFvPatchScalarField.C
+++ b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedInternalEnergy/fixedInternalEnergyFvPatchScalarField.C
@@ -117,7 +117,7 @@ void Foam::fixedInternalEnergyFvPatchScalarField::updateCoeffs()
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         fixedInternalEnergyFvPatchScalarField
diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnthalpy/gradientEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnthalpy/gradientEnthalpyFvPatchScalarField.C
index af060d6a8709829b3c9502385ce8e0f5378fa6c5..c2bba9d1ca5140780c761208713c0eb2c63d8002 100644
--- a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnthalpy/gradientEnthalpyFvPatchScalarField.C
+++ b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnthalpy/gradientEnthalpyFvPatchScalarField.C
@@ -131,7 +131,7 @@ void Foam::gradientEnthalpyFvPatchScalarField::updateCoeffs()
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         gradientEnthalpyFvPatchScalarField
diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientInternalEnergy/gradientInternalEnergyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientInternalEnergy/gradientInternalEnergyFvPatchScalarField.C
index 56d90f7bd7dd87c313b745098f95dd692f70427d..31aa35fd49b61ce17267011808c13a6effba2cd3 100644
--- a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientInternalEnergy/gradientInternalEnergyFvPatchScalarField.C
+++ b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientInternalEnergy/gradientInternalEnergyFvPatchScalarField.C
@@ -124,7 +124,7 @@ void Foam::gradientInternalEnergyFvPatchScalarField::updateCoeffs()
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         gradientInternalEnergyFvPatchScalarField
diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnthalpy/mixedEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnthalpy/mixedEnthalpyFvPatchScalarField.C
index 1d24cda9e4829974329aea662edd13ea847dc20f..8fcca1ac28d10ec27fc8fc821d20f8a6993c251f 100644
--- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnthalpy/mixedEnthalpyFvPatchScalarField.C
+++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnthalpy/mixedEnthalpyFvPatchScalarField.C
@@ -141,7 +141,7 @@ void Foam::mixedEnthalpyFvPatchScalarField::updateCoeffs()
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         mixedEnthalpyFvPatchScalarField
diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedInternalEnergy/mixedInternalEnergyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedInternalEnergy/mixedInternalEnergyFvPatchScalarField.C
index 84856e621403b57af082df30650a4bdc762c662c..08ef62768433589d80bb9244b33a61ef392d9404 100644
--- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedInternalEnergy/mixedInternalEnergyFvPatchScalarField.C
+++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedInternalEnergy/mixedInternalEnergyFvPatchScalarField.C
@@ -134,7 +134,7 @@ void Foam::mixedInternalEnergyFvPatchScalarField::updateCoeffs()
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         mixedInternalEnergyFvPatchScalarField
diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C
index 967a8e30746097ec00ad3c7c2839b719a3be4999..5d231d8dbff73420d644ba3589fadca79638039c 100644
--- a/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C
+++ b/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C
@@ -184,7 +184,7 @@ void Foam::wallHeatTransferFvPatchScalarField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         wallHeatTransferFvPatchScalarField
diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C
index 42c6b480002eaf5c86261c5fdda90db90a0b60c8..9bc80d5c9fe636f1e77165722bc18b671fd79742 100644
--- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C
+++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiation/MarshakRadiationMixedFvPatchScalarField.C
@@ -176,7 +176,7 @@ void Foam::MarshakRadiationFvPatchScalarField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         MarshakRadiationFvPatchScalarField
diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C
index 2cf82ba23c4df3ccbfa8ab8e5c9f68089fca4e7e..cb8cc7db9733aca96c264a8f3ae1768228c0ea67 100644
--- a/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C
+++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/MarshakRadiationFixedT/MarshakRadiationFixedTMixedFvPatchScalarField.C
@@ -180,7 +180,7 @@ void Foam::MarshakRadiationFixedTMixedFvPatchScalarField::write
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         MarshakRadiationFixedTMixedFvPatchScalarField
diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C
index 59871e8dba30677c3a80255727e9117e9bcd994a..766f01cce394428c73c40a2d5d07d252bf128b5e 100644
--- a/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C
+++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/greyDiffusiveRadiation/greyDiffusiveRadiationMixedFvPatchScalarField.C
@@ -236,7 +236,7 @@ namespace Foam
 {
 namespace radiation
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         greyDiffusiveRadiationMixedFvPatchScalarField
diff --git a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C
index 8de1c8a2b21faf79fd2b2ff74a0d3e65a7394a9c..77d88498320dfb957e2e45459a559b49daf65b7d 100644
--- a/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C
+++ b/src/thermophysicalModels/radiation/derivedFvPatchFields/wideBandDiffusiveRadiation/wideBandDiffusiveRadiationMixedFvPatchScalarField.C
@@ -234,7 +234,7 @@ namespace Foam
 {
 namespace radiation
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         wideBandDiffusiveRadiationMixedFvPatchScalarField
diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H
index cd0fa041109654a0f52ea231cbdac6be1a8715c8..9553006644f1c27c02c48d0dfc78406c333dcb46 100644
--- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H
+++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/chemistryReader.H
@@ -121,34 +121,38 @@ public:
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-#define makeChemistryReader(Thermo)                                           \
-    defineTemplateTypeNameAndDebug(chemistryReader<Thermo>, 0);               \
-    defineTemplateRunTimeSelectionTable(chemistryReader<Thermo>, dictionary);
+#ifdef NoRepository
+#   include "chemistryReader.C"
+#endif
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
 
-#define makeChemistryReaderType(SS, Thermo)                                   \
-    defineNamedTemplateTypeNameAndDebug(SS<Thermo>, 0);                       \
-    chemistryReader<Thermo>::adddictionaryConstructorToTable<SS<Thermo> >     \
-        add##SS##Thermo##ConstructorToTable_;
+#define makeChemistryReader(Thermo)                                           \
+    defineTemplateTypeNameAndDebug(chemistryReader<Thermo>, 0);               \
+    defineTemplateRunTimeSelectionTable(chemistryReader<Thermo>, dictionary)
 
 
-#define addChemistryReaderType(SS, Thermo)                                    \
-    defineNamedTemplateTypeNameAndDebug(SS, 0);                               \
-    chemistryReader<Thermo>::adddictionaryConstructorToTable<SS>              \
-        add##SS##Thermo##ConstructorToTable_;
+#define makeChemistryReaderType(Reader, Thermo)                               \
+    defineNamedTemplateTypeNameAndDebug(Reader<Thermo>, 0);                   \
+    chemistryReader<Thermo>::adddictionaryConstructorToTable<Reader<Thermo> > \
+        add##Reader##Thermo##ConstructorToTable_
 
 
-#define addNonTemplatedChemistryReaderType(SS, Thermo)                        \
-    defineTypeNameAndDebug(SS, 0);                                            \
-    chemistryReader<Thermo>::adddictionaryConstructorToTable<SS>              \
-        add##SS##Thermo##ConstructorToTable_;
+// for non-templated chemistry readers
+#define addChemistryReaderType(Reader, Thermo)                                \
+    defineTypeNameAndDebug(Reader, 0);                                        \
+    chemistryReader<Thermo>::adddictionaryConstructorToTable<Reader>          \
+        add##Reader##Thermo##ConstructorToTable_
 
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// for templated chemistry readers
+#define addTemplateChemistryReaderType(Reader, Thermo)                        \
+    defineNamedTemplateTypeNameAndDebug(Reader, 0);                           \
+    chemistryReader<Thermo>::adddictionaryConstructorToTable<Reader>          \
+        add##Reader##Thermo##ConstructorToTable_
 
-#ifdef NoRepository
-#   include "chemistryReader.C"
-#endif
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C
index 83aa3a2a3ae5e3b33d9de02851337b69d69246bc..548d15c8fee44db5c546174ae5127fb9becf7c6e 100644
--- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C
+++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemkinReader/chemkinReader.C
@@ -45,7 +45,7 @@ License
 
 namespace Foam
 {
-    addNonTemplatedChemistryReaderType(chemkinReader, gasThermoPhysics);
+    addChemistryReaderType(chemkinReader, gasThermoPhysics);
 }
 
 
diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C
index 7068178d89be3fc6bd87f6aa9a5e10fe1abb8b1f..7e239d23ae07df578853f16d26d07102a494f5d2 100644
--- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C
+++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/fixedUnburntEnthalpy/fixedUnburntEnthalpyFvPatchScalarField.C
@@ -118,7 +118,7 @@ void Foam::fixedUnburntEnthalpyFvPatchScalarField::updateCoeffs()
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         fixedUnburntEnthalpyFvPatchScalarField
diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C
index 39707826790b3eaedccd88287c66271410ddf221..4b9d91f8adc5c5cf626f6561a3cc5869e9bb12fa 100644
--- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C
+++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/gradientUnburntEnthalpy/gradientUnburntEnthalpyFvPatchScalarField.C
@@ -124,7 +124,7 @@ void Foam::gradientUnburntEnthalpyFvPatchScalarField::updateCoeffs()
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         gradientUnburntEnthalpyFvPatchScalarField
diff --git a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C
index ad79174e0f5b47a3a4800614ac98300dd874e170..e9bf757f34293459560d692f69ce64f8788a6ea8 100644
--- a/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C
+++ b/src/thermophysicalModels/reactionThermo/derivedFvPatchFields/mixedUnburntEnthalpy/mixedUnburntEnthalpyFvPatchScalarField.C
@@ -132,7 +132,7 @@ void Foam::mixedUnburntEnthalpyFvPatchScalarField::updateCoeffs()
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         mixedUnburntEnthalpyFvPatchScalarField
diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C
index 4306ee7651ca97c3003a3c38485370f662e4ec0b..d9abc8e173332d0571764a6592a7c73d1e9f3cdc 100644
--- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C
+++ b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/constantAlphaContactAngle/constantAlphaContactAngleFvPatchScalarField.C
@@ -122,7 +122,7 @@ void Foam::constantAlphaContactAngleFvPatchScalarField::write
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         constantAlphaContactAngleFvPatchScalarField
diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C
index 04bb1217491ebbe90b75c01f32ab8d996256cf90..809abc42508a67a2c00f233af26cd51fdc09bc13 100644
--- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C
+++ b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/dynamicAlphaContactAngle/dynamicAlphaContactAngleFvPatchScalarField.C
@@ -158,7 +158,7 @@ void Foam::dynamicAlphaContactAngleFvPatchScalarField::write(Ostream& os) const
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         dynamicAlphaContactAngleFvPatchScalarField
diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C
index 0266c27b28d2b61a1fd32fe07b8c7b268598e4a0..a4b55a7345432ad062217720a0e16c1e9c253bf1 100644
--- a/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C
+++ b/src/transportModels/twoPhaseInterfaceProperties/alphaContactAngle/timeVaryingAlphaContactAngle/timeVaryingAlphaContactAngleFvPatchScalarField.C
@@ -143,7 +143,7 @@ void Foam::timeVaryingAlphaContactAngleFvPatchScalarField::write
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         timeVaryingAlphaContactAngleFvPatchScalarField
diff --git a/src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C b/src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C
index ced344217c972eefc9e30dc1d3a50ca35a431d41..f6265b63039a70c689041fad9cfc5e9e7c36b751 100644
--- a/src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C
+++ b/src/transportModels/twoPhaseInterfaceProperties/alphaFixedPressure/alphaFixedPressureFvPatchScalarField.C
@@ -167,7 +167,7 @@ void Foam::alphaFixedPressureFvPatchScalarField::write
 
 namespace Foam
 {
-    makeNonTemplatedPatchTypeField
+    makePatchTypeField
     (
         fvPatchScalarField,
         alphaFixedPressureFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C
index 482b33ba37a6cbd6593d097dc41d5bde6cd6ab30..6e118204f759138553bb7e05a92491344027b7d8 100644
--- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsJayatillekeWallFunction/alphaSgsJayatillekeWallFunctionFvPatchScalarField.C
@@ -326,7 +326,7 @@ void alphaSgsJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     alphaSgsJayatillekeWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C
index 6bd84e09a3b36c154be84220f7ca6776c700de81..5d9adbc79daca96da14adfb93cc6677951c9916a 100644
--- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/alphaSgsWallFunctions/alphaSgsWallFunction/alphaSgsWallFunctionFvPatchScalarField.C
@@ -149,7 +149,7 @@ void alphaSgsWallFunctionFvPatchScalarField::evaluate
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     alphaSgsWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C
index 13c4a76608b37f966cbe871f03ad4506f269c2ed..7c877558e60e256fb1920b25126b76fc87ba5306 100644
--- a/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/LES/derivedFvPatchFields/wallFunctions/muSgsWallFunctions/muSgsUSpaldingWallFunction/muSgsUSpaldingWallFunctionFvPatchScalarField.C
@@ -208,7 +208,7 @@ void muSgsUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     muSgsUSpaldingWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
index 6b09d2e56840e59bf09db5bf082fcf00ddeb0c31..6296caa2eac78cba650d562606d86e7f7d7c794d 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
@@ -137,7 +137,7 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::write
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     turbulentMixingLengthDissipationRateInletFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
index 6f27e3f1c5924ec52c7943224f773cc7b30f137d..86d2448632b8a3c4b4b10d75e339309293ba35a0 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
@@ -142,7 +142,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::write
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     turbulentMixingLengthFrequencyInletFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C
index 68f6d94fc5535eda35a0e0bde1d91c086e437887..a9b09b0990106c728c3456141a4db5f6a7341c39 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatJayatillekeWallFunction/alphatJayatillekeWallFunctionFvPatchScalarField.C
@@ -300,7 +300,7 @@ void alphatJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     alphatJayatillekeWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C
index db8d139ea7becb41f6a55e8807c449a6c7f5f203..192110aba96d16df2a946b9b0445102be6538809 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/alphatWallFunctions/alphatWallFunction/alphatWallFunctionFvPatchScalarField.C
@@ -135,7 +135,7 @@ void alphatWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     alphatWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
index 8942568755583cafe6a66a870c0eb8f70e519bef..2a7734874dad1097e642dc89a24a99c309821176 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
@@ -253,7 +253,7 @@ void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     epsilonWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C
index 0067555627d19fd4fb1239dbf9fca45e419375f2..3b4261da5d4222a34378d68d7464ceb95ac60499 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutLowReWallFunction/mutLowReWallFunctionFvPatchScalarField.C
@@ -102,7 +102,7 @@ mutLowReWallFunctionFvPatchScalarField::mutLowReWallFunctionFvPatchScalarField
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     mutLowReWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C
index cf84331fc1459a703f7e6cf24a50d6d7af6ffbe3..6b9f0ce89aec1ff8aec5717b9b51e34eaeecbbef 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutURoughWallFunction/mutURoughWallFunctionFvPatchScalarField.C
@@ -298,7 +298,7 @@ void mutURoughWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     mutURoughWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C
index 16760f81edd28fb535bb82bde3ed90e080090675..0beeffbb2ca987e5f738b96e911ddccfb93bbefa 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUSpaldingWallFunction/mutUSpaldingWallFunctionFvPatchScalarField.C
@@ -205,7 +205,7 @@ void mutUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     mutUSpaldingWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C
index e1d7a96ac17a5fb67259ab3ab15017c313095f01..2d6185b25b22840ccd94dc096648752eaf878fb3 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutUWallFunction/mutUWallFunctionFvPatchScalarField.C
@@ -184,7 +184,7 @@ void mutUWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     mutUWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C
index 10e9e7548283cdf2625fd9df3cc25e852719ef46..d5e91dac836b94825da735a25e9ab3fdea00c2e8 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C
@@ -222,7 +222,7 @@ void mutkRoughWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     mutkRoughWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C
index 079dfb10dd30907ff2929bc0b82da8a9d71deabd..084ad06579c8d032bef64514e4eda6673da7374e 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkWallFunction/mutkWallFunctionFvPatchScalarField.C
@@ -228,7 +228,7 @@ void mutkWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     mutkWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
index 70cb5e9ffef1484a58be1b761fc6a78bc7d0399d..9afecb98725ec222f5ac6663ebd51d59b34b73a8 100644
--- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
@@ -250,7 +250,7 @@ void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     omegaWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C
index 3cd734d002f99306a7bbfe8d58ea8393887d9c37..77f6581b591c0c59586dd386de18cc6caae5aefc 100644
--- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C
@@ -230,7 +230,7 @@ void turbulentHeatFluxTemperatureFvPatchScalarField::write
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     turbulentHeatFluxTemperatureFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C
index 89ca4c2cc7cf51e33c44558a39bb1fafc2e81d51..6c937379e9bf78bd99f4c59b95da5d86faa1bf39 100644
--- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffle/turbulentTemperatureCoupledBaffleFvPatchScalarField.C
@@ -289,7 +289,7 @@ void Foam::turbulentTemperatureCoupledBaffleFvPatchScalarField::write
 namespace Foam
 {
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     turbulentTemperatureCoupledBaffleFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C
index 99991e69382578c04be7611c903ada4b978eace1..4bd5fff0ff76119f05b4d3d9253f0bc7c3ad1957 100644
--- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C
+++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C
@@ -247,7 +247,7 @@ void turbulentTemperatureCoupledBaffleMixedFvPatchScalarField::write
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     turbulentTemperatureCoupledBaffleMixedFvPatchScalarField
diff --git a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H
index 19d4e0c0a440454f0e684f634c78a12b5d1ea83a..fdf2517acd1c497361237a452bba89643dd1ed98 100644
--- a/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H
+++ b/src/turbulenceModels/compressible/turbulenceModel/derivedFvPatchFields/turbulentTemperatureCoupledBaffleMixed/turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.H
@@ -28,10 +28,13 @@ Description
     Mixed boundary condition for temperature, to be used for heat-transfer
     on back-to-back baffles.
 
-    If my temperature is T1, neighbour is T2:
-
-    T1 > T2: my side becomes fixedValue T2 bc, other side becomes fixedGradient.
+    Specifies gradient and temperature such that the equations are the same
+    on both sides:
+    - refGradient = zero gradient
+    - refValue = neighbour value
+    - mixFraction = nbrKDelta / (nbrKDelta + myKDelta())
 
+    where KDelta is heat-transfer coefficient K * deltaCoeffs
 
     Example usage:
         myInterfacePatchName
@@ -54,12 +57,6 @@ Description
     Note: runs in parallel with arbitrary decomposition. Uses directMapped
     functionality to calculate exchange.
 
-    Note: lags interface data so both sides use same data.
-    - problem: schedule to calculate average would interfere
-    with standard processor swaps.
-    - so: updateCoeffs sets both to same Twall. Only need to do
-    this for last outer iteration but don't have access to this.
-
 SourceFiles
     turbulentTemperatureCoupledBaffleMixedFvPatchScalarField.C
 
diff --git a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.C
index 4ed165edc87ae1100c1bac998ccc475a7cc6ab90..5a7af4c7864ce33a93e04a1822d851d3fe1e365c 100644
--- a/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/LES/derivedFvPatchFields/wallFunctions/nuSgsWallFunctions/nuSgsUSpaldingWallFunction/nuSgsUSpaldingWallFunctionFvPatchScalarField.C
@@ -195,7 +195,7 @@ void nuSgsUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     nuSgsUSpaldingWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C
index 2a1e75d2e7893480e5adf8964af47a73d0d05be5..da7e69950e98007fac0ad6d305e056f003970798 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletEpsilon/atmBoundaryLayerInletEpsilonFvPatchScalarField.C
@@ -154,7 +154,7 @@ void atmBoundaryLayerInletEpsilonFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     atmBoundaryLayerInletEpsilonFvPatchScalarField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C
index c31daa7cb3a15f462787b5e59ef0ba4628d1223c..252f1ef2d3baa677839168c9dae6f5dfdc5657c6 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/atmBoundaryLayerInletVelocity/atmBoundaryLayerInletVelocityFvPatchVectorField.C
@@ -189,7 +189,7 @@ void atmBoundaryLayerInletVelocityFvPatchVectorField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchVectorField,
     atmBoundaryLayerInletVelocityFvPatchVectorField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C
index 993673a4fec84374221278c154733edbbd730d90..d0144913d2bbd585bfd47dfe593514e1aaacd7b3 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/fixedShearStress/fixedShearStressFvPatchVectorField.C
@@ -146,7 +146,7 @@ void fixedShearStressFvPatchVectorField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchVectorField,
     fixedShearStressFvPatchVectorField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C
index 1f75a6a145d4018394561f85f9d97e9734f4bf5f..81a80079c37f90ea84a610fd5b3e55f473a53885 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentHeatFluxTemperature/turbulentHeatFluxTemperatureFvPatchScalarField.C
@@ -237,7 +237,7 @@ void turbulentHeatFluxTemperatureFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     turbulentHeatFluxTemperatureFvPatchScalarField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
index 6e5b714811d7ad9fb2451b40537c152fa7210e96..f0d66d95f772c5ab9c94c95611db397b15be1bc0 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthDissipationRateInlet/turbulentMixingLengthDissipationRateInletFvPatchScalarField.C
@@ -137,7 +137,7 @@ void turbulentMixingLengthDissipationRateInletFvPatchScalarField::write
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     turbulentMixingLengthDissipationRateInletFvPatchScalarField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
index 7762231747aee552a829d9e188b5159aaadc15de..d12b1ebd0d3f1142fe6f3e9e0cbe0fde8a191f44 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/turbulentMixingLengthFrequencyInlet/turbulentMixingLengthFrequencyInletFvPatchScalarField.C
@@ -143,7 +143,7 @@ void turbulentMixingLengthFrequencyInletFvPatchScalarField::write
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     turbulentMixingLengthFrequencyInletFvPatchScalarField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
index a7e31ff80b1e9015bcd441586e7743249385c691..48e38384de381ebe663e7cf631ee379966771915 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/epsilonWallFunctions/epsilonWallFunction/epsilonWallFunctionFvPatchScalarField.C
@@ -249,7 +249,7 @@ void epsilonWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     epsilonWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C
index a33441d83f0182bd0fdee80c759b7b3f49916cfa..2b643af8297f9dd97d84a3fb70b8d5acb2f3e388 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/kappatWallFunctions/kappatJayatillekeWallFunction/kappatJayatillekeWallFunctionFvPatchScalarField.C
@@ -261,7 +261,7 @@ void kappatJayatillekeWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     kappatJayatillekeWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C
index daa6af1ea57c1e8eded3a70fcd8b7593ea5368f6..62e32963f9f752d8dac9f4f534383e2a7cbc0857 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutLowReWallFunction/nutLowReWallFunctionFvPatchScalarField.C
@@ -102,7 +102,7 @@ nutLowReWallFunctionFvPatchScalarField::nutLowReWallFunctionFvPatchScalarField
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     nutLowReWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C
index 29f0fc0bbe6c508ed46b34079d3edf2c019d39b1..cce8ca6d66b383c294acde5b9bf453d177e1eeae 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutURoughWallFunction/nutURoughWallFunctionFvPatchScalarField.C
@@ -294,7 +294,7 @@ void nutURoughWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     nutURoughWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C
index f236357c6a13122ec0be59c5c0a9e26ec7ab85f0..114a7fc0c17bcd9e52608165d0f7f21e9bda6cc4 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUSpaldingWallFunction/nutUSpaldingWallFunctionFvPatchScalarField.C
@@ -197,7 +197,7 @@ void nutUSpaldingWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     nutUSpaldingWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C
index 7d4a9ede5d01f71487e0b7ab7f623655b0dd0337..a362336f7cc1f73dcf2bce8df9c684ccf9c4b94c 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUTabulatedWallFunction/nutUTabulatedWallFunctionFvPatchScalarField.C
@@ -200,7 +200,7 @@ void nutUTabulatedWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     nutUTabulatedWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C
index 572fba9c68314509755d601d1bf6d80e93d88bfa..abf6e5d66b33e24aba2265f1642c1e687c256128 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutUWallFunction/nutUWallFunctionFvPatchScalarField.C
@@ -183,7 +183,7 @@ void nutUWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     nutUWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C
index 27c10083002cb81f7198d72e361a4a31e4dd0aaa..9aaa25d9fe0983eb7c27b2832f14a6d8ab920961 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkRoughWallFunction/nutkRoughWallFunctionFvPatchScalarField.C
@@ -230,7 +230,7 @@ void nutkRoughWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     nutkRoughWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C
index 8b4949ba68dbd5b028d9da2992691f0030e0de86..7a095ce55eebd7c432e6598e95b6974147ee73d9 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/nutWallFunctions/nutkWallFunction/nutkWallFunctionFvPatchScalarField.C
@@ -236,7 +236,7 @@ void nutkWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     nutkWallFunctionFvPatchScalarField
diff --git a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
index c715658615eb161644a25458d5c58f5e3ee74de6..a735aa3c94b43e609e6a7b7e56e2ced17a56a3d8 100644
--- a/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
+++ b/src/turbulenceModels/incompressible/RAS/derivedFvPatchFields/wallFunctions/omegaWallFunctions/omegaWallFunction/omegaWallFunctionFvPatchScalarField.C
@@ -249,7 +249,7 @@ void omegaWallFunctionFvPatchScalarField::write(Ostream& os) const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-makeNonTemplatedPatchTypeField
+makePatchTypeField
 (
     fvPatchScalarField,
     omegaWallFunctionFvPatchScalarField
diff --git a/tutorials/basic/laplacianFoam/flange/Allrun b/tutorials/basic/laplacianFoam/flange/Allrun
index db939bed7645b3812ce61fd4ebb7fee6583da63a..be6367359fa3d23372d731a4ac414e0e23d0d7b9 100755
--- a/tutorials/basic/laplacianFoam/flange/Allrun
+++ b/tutorials/basic/laplacianFoam/flange/Allrun
@@ -11,7 +11,7 @@ runAnsysToFoam()
 {
     if [ -f log.ansysToFoam ]
     then
-        echo "ansysToFoam already run on $PWD: remove log file to run"
+        echo "ansysToFoam already run on $PWD: remove log file to re-run"
     else
         echo "ansysToFoam: converting mesh $1"
         ansysToFoam $1 -scale $2 > log.ansysToFoam 2>&1
diff --git a/tutorials/combustion/engineFoam/kivaTest/Allrun b/tutorials/combustion/engineFoam/kivaTest/Allrun
index 6c86823f996c3269898909f9293e0fe0e04246b8..21d4983a9393d8df2e99d3d20096d0a2578905a6 100755
--- a/tutorials/combustion/engineFoam/kivaTest/Allrun
+++ b/tutorials/combustion/engineFoam/kivaTest/Allrun
@@ -11,7 +11,7 @@ runKivaToFoam()
 {
     if [ -f log.kivaToFoam ]
     then
-        echo "kivaToFoam already run: remove log file to run"
+        echo "kivaToFoam already run: remove log file to re-run"
     else
         echo "kivaToFoam: converting kiva file"
         kivaToFoam -file $1 > log.kivaToFoam 2>&1
@@ -23,7 +23,7 @@ restartApplication()
 {
     if [ -f log-2.$1 ]
     then
-        echo "$1 already run: remove log file to run"
+        echo "$1 already run: remove log file to re-run"
     else
         echo "Running $1"
         $1 > log-2.$1 2>&1
diff --git a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/Allrun b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/Allrun
index 03afe0bd219d83c3efc636280b831332ac8ad9b6..6142b9557c81a05d64dd43de4b095a5d0b21493f 100755
--- a/tutorials/compressible/sonicFoam/ras/nacaAirfoil/Allrun
+++ b/tutorials/compressible/sonicFoam/ras/nacaAirfoil/Allrun
@@ -11,7 +11,7 @@ runStarToFoam()
 {
     if [ -f log.star3ToFoam -o -f log.starToFoam ]
     then
-        echo "star3ToFoam already run on $PWD: remove log file to run"
+        echo "star3ToFoam already run on $PWD: remove log file to re-run"
     else
         echo "star3ToFoam: converting mesh $1"
         star3ToFoam $1 > log.star3ToFoam 2>&1
diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/Allrun b/tutorials/incompressible/simpleFoam/windTurbineTerrain/Allrun
index c69808608c7d4af7432036135d885e3d6e553a99..48a73959b0288e498d0e1ef54dc9d7ceece0d04c 100755
--- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/Allrun
+++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/Allrun
@@ -18,13 +18,22 @@ runApplication decomposePar
 cp system/decomposeParDict-par system/decomposeParDict
 runParallel snappyHexMesh 2 -overwrite
 
-# Add wildcard entries for meshes patches since not preserved
+# Add wildcard entries for meshed patches since not preserved
 # by decomposePar. Notice -literalRE option to add wildcard itself
 # without evaluation.
 runParallel changeDictionary 2 -literalRE
 
-runParallel setSet 2 -batch makeZones
-runParallel windSimpleFoam 2
+cp system/decomposeParDict-4proc system/decomposeParDict
+runParallel redistributeMeshPar 4 -overwrite
+runParallel renumberMesh 4 -overwrite
+
+# Add wildcard entries for meshes patches since not preserved
+# by decomposePar. Notice -literalRE option to add wildcard itself
+# without evaluation.
+#runParallel changeDictionary 4 -literalRE
+
+runParallel setSet 4 -batch makeZones
+runParallel windSimpleFoam 4
 
 runApplication reconstructParMesh -constant
 runApplication reconstructPar
diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/decomposeParDict-4proc b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/decomposeParDict-4proc
new file mode 100644
index 0000000000000000000000000000000000000000..d81e9121240067cf798e5ee552fe70e2e46f6348
--- /dev/null
+++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/decomposeParDict-4proc
@@ -0,0 +1,22 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+FoamFile
+{
+    version     2.0;
+    format      ascii;
+    class       dictionary;
+    object      decomposeParDict;
+}
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+numberOfSubdomains 4;
+
+method          ptscotch;
+
+// ************************************************************************* //
diff --git a/wmake/wcleanAll b/wmake/wcleanAll
index 997ceb7a29681376105b3f418bfb860edcd4297d..a037adab3d6887f13f4e5eb6ca2f30537000e73b 100755
--- a/wmake/wcleanAll
+++ b/wmake/wcleanAll
@@ -43,10 +43,13 @@ fi
     exit 1
 }
 
-for dir in lib applications/bin
+for dir in lib bin applications/bin
 do
-    echo "Removing $dir/"
-    [ -d $dir ] && rm -rf $dir/*
+    echo "Removing non-tools directories from $dir/"
+    if [ -d $dir ]
+    then
+        find $dir -mindepth 1 -type d \! -name tools | xargs rm -rf
+    fi
 done
 
 echo "Removing *.dep files"
diff --git a/wmake/wcleanMachine b/wmake/wcleanMachine
index 533273def164020b862e1af491369f8404b582b1..485e455411cc9fe4558e5ef971f905e2e00e2e64 100755
--- a/wmake/wcleanMachine
+++ b/wmake/wcleanMachine
@@ -62,7 +62,7 @@ do
 
     # find . -depth -type d \( -name ii_files -o -name Templates.DB \) -exec rm -rf {} \;
 
-    for dir in lib/$machType applications/bin/$machType
+    for dir in lib/$machType bin/$machType applications/bin/$machType
     do
         [ -d $dir ] && rm -rf $dir
     done