diff --git a/Allwmake b/Allwmake
index ebe159e37665403de686b09eea524c3e1ad62653..035b24811b065daab40609ec071eee1eb534efdd 100755
--- a/Allwmake
+++ b/Allwmake
@@ -15,6 +15,8 @@ wmakeCheckPwd "$WM_PROJECT_DIR" || {
 if [ -d "$WM_THIRD_PARTY_DIR" ]
 then
     $WM_THIRD_PARTY_DIR/Allwmake
+else
+    echo "no ThirdParty sources found - skipping"
 fi
 
 # build OpenFOAM libraries and applications
diff --git a/applications/solvers/combustion/PDRFoam/Make/options b/applications/solvers/combustion/PDRFoam/Make/options
index a1469d0ef0d73671d5528eacd231844c5e7ceae9..3432f09ef79f6fa27edf4006530978c764eca252 100644
--- a/applications/solvers/combustion/PDRFoam/Make/options
+++ b/applications/solvers/combustion/PDRFoam/Make/options
@@ -20,6 +20,7 @@ EXE_INC = \
 EXE_LIBS = \
     -lengine \
     -lmeshTools \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lbasicThermophysicalModels \
     -lreactionThermophysicalModels \
diff --git a/applications/solvers/combustion/XiFoam/Make/options b/applications/solvers/combustion/XiFoam/Make/options
index c328b2c1b3417b0f8df438317fbf4e0376cdbe0b..66dae7fcb34ded2b6df3a287657d2132917b3865 100644
--- a/applications/solvers/combustion/XiFoam/Make/options
+++ b/applications/solvers/combustion/XiFoam/Make/options
@@ -10,6 +10,7 @@ EXE_INC = \
 
 EXE_LIBS = \
     -lengine \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
     -lbasicThermophysicalModels \
diff --git a/applications/solvers/combustion/coldEngineFoam/Make/options b/applications/solvers/combustion/coldEngineFoam/Make/options
index 53aa22b25a476812ba4e06f10cf17291d7b031f2..dfd9248ded0419b53563798ce68372c9b42fb928 100644
--- a/applications/solvers/combustion/coldEngineFoam/Make/options
+++ b/applications/solvers/combustion/coldEngineFoam/Make/options
@@ -10,6 +10,7 @@ EXE_INC = \
 
 EXE_LIBS = \
     -lengine \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
     -lbasicThermophysicalModels \
diff --git a/applications/solvers/combustion/dieselEngineFoam/Make/options b/applications/solvers/combustion/dieselEngineFoam/Make/options
index 60558513fe28ea936712ecf14e78588ea4a4e1fe..d0a572b86fe75a654e87f7729063cd71d4d88e1b 100644
--- a/applications/solvers/combustion/dieselEngineFoam/Make/options
+++ b/applications/solvers/combustion/dieselEngineFoam/Make/options
@@ -18,6 +18,7 @@ EXE_INC = \
 
 EXE_LIBS = \
     -lengine \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
     -lreactionThermophysicalModels \
diff --git a/applications/solvers/combustion/dieselFoam/Make/options b/applications/solvers/combustion/dieselFoam/Make/options
index 28605eb830357a8aedb735b6d9b13a7a0c721897..9096934c2dd4fafb86625f17eb348a8c26f5fde8 100644
--- a/applications/solvers/combustion/dieselFoam/Make/options
+++ b/applications/solvers/combustion/dieselFoam/Make/options
@@ -16,6 +16,7 @@ EXE_INC = \
     -I$(LIB_SRC)/ODE/lnInclude
 
 EXE_LIBS = \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
     -lreactionThermophysicalModels \
diff --git a/applications/solvers/combustion/engineFoam/Make/options b/applications/solvers/combustion/engineFoam/Make/options
index 31775e03d63670129e67b82980e8aae38737f19a..cf5fa5febe38f3057fef233376bf24e30796286a 100644
--- a/applications/solvers/combustion/engineFoam/Make/options
+++ b/applications/solvers/combustion/engineFoam/Make/options
@@ -10,6 +10,7 @@ EXE_INC = \
 
 EXE_LIBS = \
     -lengine \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
     -lbasicThermophysicalModels \
diff --git a/applications/solvers/combustion/fireFoam/Make/options b/applications/solvers/combustion/fireFoam/Make/options
index 3b19a78173ce42e021d36d76f9546e95de7d6f48..cba08b26296a50f4a77829b18606bdee63089796 100644
--- a/applications/solvers/combustion/fireFoam/Make/options
+++ b/applications/solvers/combustion/fireFoam/Make/options
@@ -14,6 +14,7 @@ EXE_LIBS = \
     -lreactionThermophysicalModels \
     -lbasicThermophysicalModels \
     -lfiniteVolume \
+    -lcompressibleTurbulenceModel \
     -lcompressibleLESModels \
     -lcompressibleRASModels \
     -lradiation
diff --git a/applications/solvers/combustion/reactingFoam/Make/options b/applications/solvers/combustion/reactingFoam/Make/options
index d85350297af19cb8ab7f15cd023735aa2c579571..6386af8c557fcea5ace76bfe7c203c36ab85cd6e 100644
--- a/applications/solvers/combustion/reactingFoam/Make/options
+++ b/applications/solvers/combustion/reactingFoam/Make/options
@@ -8,6 +8,7 @@ EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
 EXE_LIBS = \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
     -lreactionThermophysicalModels \
diff --git a/applications/solvers/combustion/rhoReactingFoam/Make/options b/applications/solvers/combustion/rhoReactingFoam/Make/options
index d85350297af19cb8ab7f15cd023735aa2c579571..6386af8c557fcea5ace76bfe7c203c36ab85cd6e 100644
--- a/applications/solvers/combustion/rhoReactingFoam/Make/options
+++ b/applications/solvers/combustion/rhoReactingFoam/Make/options
@@ -8,6 +8,7 @@ EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
 EXE_LIBS = \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
     -lreactionThermophysicalModels \
diff --git a/applications/solvers/compressible/rhoPimpleFoam/Make/options b/applications/solvers/compressible/rhoPimpleFoam/Make/options
index 4858e53f307676323e027c9cff64650149209079..47a62ae92a03b39d2fa5a6b0e9e835913c806fc0 100644
--- a/applications/solvers/compressible/rhoPimpleFoam/Make/options
+++ b/applications/solvers/compressible/rhoPimpleFoam/Make/options
@@ -7,6 +7,7 @@ EXE_INC = \
 EXE_LIBS = \
     -lbasicThermophysicalModels \
     -lspecie \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
     -lfiniteVolume \
diff --git a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/Make/options b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/Make/options
index 61c1b6fe4694070e5a5a86789da6166158151879..809b4a63a1679782436d9ffd26c7e05d45c7d9fa 100644
--- a/applications/solvers/compressible/rhoPorousMRFPimpleFoam/Make/options
+++ b/applications/solvers/compressible/rhoPorousMRFPimpleFoam/Make/options
@@ -9,6 +9,7 @@ EXE_INC = \
 EXE_LIBS = \
     -lbasicThermophysicalModels \
     -lspecie \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
     -lfiniteVolume \
diff --git a/applications/solvers/compressible/rhoPorousSimpleFoam/Make/options b/applications/solvers/compressible/rhoPorousSimpleFoam/Make/options
index 4f198992b905351e4a49dcb054dd964e24008622..a4cdecf368a7e68d64f9e46a3eda99672647142f 100644
--- a/applications/solvers/compressible/rhoPorousSimpleFoam/Make/options
+++ b/applications/solvers/compressible/rhoPorousSimpleFoam/Make/options
@@ -11,6 +11,7 @@ EXE_LIBS = \
     -lbasicThermophysicalModels \
     -lthermalPorousZone \
     -lspecie \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lfiniteVolume \
     -lmeshTools
diff --git a/applications/solvers/compressible/rhoSimpleFoam/Make/options b/applications/solvers/compressible/rhoSimpleFoam/Make/options
index d51be54abfcc8ce1857d6389e65e5578f808b9d9..700a6a67535022ddcaa5f28f4d9eb721b3d30ba3 100644
--- a/applications/solvers/compressible/rhoSimpleFoam/Make/options
+++ b/applications/solvers/compressible/rhoSimpleFoam/Make/options
@@ -8,6 +8,7 @@ EXE_INC = \
 EXE_LIBS = \
     -lbasicThermophysicalModels \
     -lspecie \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lfiniteVolume \
     -lmeshTools
diff --git a/applications/solvers/compressible/sonicDyMFoam/Make/options b/applications/solvers/compressible/sonicDyMFoam/Make/options
index f05f52d42778473c33504a669850f1ee956ba53f..81495fb1f65aa9f1d4bfb84be4ce4be23017b8ee 100644
--- a/applications/solvers/compressible/sonicDyMFoam/Make/options
+++ b/applications/solvers/compressible/sonicDyMFoam/Make/options
@@ -9,6 +9,7 @@ EXE_INC = \
 EXE_LIBS = \
     -lbasicThermophysicalModels \
     -lspecie \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
     -lfiniteVolume \
diff --git a/applications/solvers/compressible/sonicFoam/Make/options b/applications/solvers/compressible/sonicFoam/Make/options
index ecfde60eee8bed46c7f2e6bd52b1a4da0c5419ea..a5b9436ac6e288f4f31f7ae6fdf29c7272af5357 100644
--- a/applications/solvers/compressible/sonicFoam/Make/options
+++ b/applications/solvers/compressible/sonicFoam/Make/options
@@ -6,6 +6,7 @@ EXE_INC = \
 EXE_LIBS = \
     -lbasicThermophysicalModels \
     -lspecie \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
     -lfiniteVolume \
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options
index 041d2e0605468bb86b7eee749a4be8de8076f910..cadaf0850daaa9242d22a22b7b5276a6f9751f6e 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqPimpleFoam/Make/options
@@ -9,5 +9,6 @@ EXE_INC = \
 EXE_LIBS = \
     -lfiniteVolume \
     -lmeshTools \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleTransportModels
diff --git a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options
index a53061a93cc503d9368d9d3a900ac6ef801015ba..6905967f04ab0b07f7601937dec50540637ba628 100644
--- a/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options
+++ b/applications/solvers/heatTransfer/buoyantBoussinesqSimpleFoam/Make/options
@@ -8,5 +8,6 @@ EXE_INC = \
 EXE_LIBS = \
     -lfiniteVolume \
     -lmeshTools \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleTransportModels
diff --git a/applications/solvers/heatTransfer/buoyantPimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantPimpleFoam/Make/options
index f26563fc0fbdcff74dec668f5489bf159778d9ab..8d01214e6cf4ab096cb34b4ee3d4cc4694420798 100644
--- a/applications/solvers/heatTransfer/buoyantPimpleFoam/Make/options
+++ b/applications/solvers/heatTransfer/buoyantPimpleFoam/Make/options
@@ -7,6 +7,7 @@ EXE_LIBS = \
     -lmeshTools \
     -lbasicThermophysicalModels \
     -lspecie \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
     -lfiniteVolume
diff --git a/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options b/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options
index ec604cf28cd4c9d764e745b5947a08c0b47449bf..c8a3b02a0fab2ece7d783785b0805e92e1d1f15d 100644
--- a/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options
+++ b/applications/solvers/heatTransfer/buoyantSimpleFoam/Make/options
@@ -9,5 +9,6 @@ EXE_LIBS = \
     -lmeshTools \
     -lbasicThermophysicalModels \
     -lspecie \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lfiniteVolume
diff --git a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options
index 89d7787af65e02bc13f8411df8b37fb8d41e7fda..7058e8a503e189caeb52b4c1547a92252f196da6 100644
--- a/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options
+++ b/applications/solvers/heatTransfer/buoyantSimpleRadiationFoam/Make/options
@@ -12,6 +12,7 @@ EXE_LIBS = \
     -lbasicThermophysicalModels \
     -lspecie \
     -lradiation \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lfiniteVolume \
     -lmeshTools
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options
index e7a1103a4fdb8033301e52cc03836ada6e96a84a..7edc67dc751532c27671320cf72af0d22fad1dec 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/Make/options
@@ -13,6 +13,8 @@ EXE_LIBS = \
     -lbasicThermophysicalModels \
     -lbasicSolidThermo \
     -lspecie \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
+    -lmeshTools \
     -lfiniteVolume
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options
index 166480807990dc3f456f9a720b8d1add2a93dfdf..a255d65f6c7fa11c6946a97f7382ff29ee550a0d 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/chtMultiRegionSimpleFoam/Make/options
@@ -17,4 +17,6 @@ EXE_LIBS = \
     -lbasicThermophysicalModels \
     -lbasicSolidThermo \
     -lspecie \
-    -lcompressibleRASModels
+    -lcompressibleTurbulenceModel \
+    -lcompressibleRASModels \
+    -lcompressibleLESModels
diff --git a/applications/solvers/heatTransfer/chtMultiRegionFoam/include/setInitialMultiRegionDeltaT.H b/applications/solvers/heatTransfer/chtMultiRegionFoam/include/setInitialMultiRegionDeltaT.H
index cfb9592a2baf207fc37a80d4916364b3baa7b575..16ebfdfb8236a6af9c5aabd4e81e0f777c89671f 100644
--- a/applications/solvers/heatTransfer/chtMultiRegionFoam/include/setInitialMultiRegionDeltaT.H
+++ b/applications/solvers/heatTransfer/chtMultiRegionFoam/include/setInitialMultiRegionDeltaT.H
@@ -33,13 +33,12 @@ if (adjustTimeStep)
 {
     if ((runTime.timeIndex() == 0) && ((CoNum > SMALL) || (DiNum > SMALL)))
     {
-
-        if (CoNum == -GREAT)
+        if (CoNum < SMALL)
         {
             CoNum = SMALL;
         }
 
-        if (DiNum == -GREAT)
+        if (DiNum < SMALL)
         {
             DiNum = SMALL;
         }
diff --git a/applications/solvers/incompressible/boundaryFoam/Make/options b/applications/solvers/incompressible/boundaryFoam/Make/options
index b5a6f5b4068ef0a25eec87313e7f67c38a0f02de..d993beac0a2734e0ca4c8f3a5d39370cb93f867b 100644
--- a/applications/solvers/incompressible/boundaryFoam/Make/options
+++ b/applications/solvers/incompressible/boundaryFoam/Make/options
@@ -7,6 +7,7 @@ EXE_INC = \
     -I$(LIB_SRC)/sampling/lnInclude
 
 EXE_LIBS = \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleTransportModels \
     -lfiniteVolume \
diff --git a/applications/solvers/incompressible/pimpleFoam/Make/options b/applications/solvers/incompressible/pimpleFoam/Make/options
index d0e8dd740d8754dec86e6d877cfb141e0be13c1d..47d95d97ce91d5c824f02607061a438ec6061073 100644
--- a/applications/solvers/incompressible/pimpleFoam/Make/options
+++ b/applications/solvers/incompressible/pimpleFoam/Make/options
@@ -6,6 +6,7 @@ EXE_INC = \
 
 EXE_LIBS = \
     -lincompressibleTransportModels \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleLESModels \
     -lfiniteVolume \
diff --git a/applications/solvers/incompressible/pisoFoam/Make/options b/applications/solvers/incompressible/pisoFoam/Make/options
index 419f1ffcbab4ac08ac3eb10937a66ce49e355dd3..259f95f7b93158e2925f06bb839bba3ffb502079 100644
--- a/applications/solvers/incompressible/pisoFoam/Make/options
+++ b/applications/solvers/incompressible/pisoFoam/Make/options
@@ -5,6 +5,7 @@ EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
 EXE_LIBS = \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleLESModels \
     -lincompressibleTransportModels \
diff --git a/applications/solvers/incompressible/porousSimpleFoam/Make/options b/applications/solvers/incompressible/porousSimpleFoam/Make/options
index f490133ba67a4764a473d9a150b2b06f839a3790..c658bfe518c8a578980996897f40f648f4c6faa1 100644
--- a/applications/solvers/incompressible/porousSimpleFoam/Make/options
+++ b/applications/solvers/incompressible/porousSimpleFoam/Make/options
@@ -8,6 +8,7 @@ EXE_INC = \
     -I$(LIB_SRC)/meshTools/lnInclude
 
 EXE_LIBS = \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleTransportModels \
     -lfiniteVolume \
diff --git a/applications/solvers/incompressible/simpleFoam/Make/options b/applications/solvers/incompressible/simpleFoam/Make/options
index 1223bdd06f48178f0b2eee8032d29c936634f328..dbc45d38441620ef301c2b2830ae57fd7fb80773 100644
--- a/applications/solvers/incompressible/simpleFoam/Make/options
+++ b/applications/solvers/incompressible/simpleFoam/Make/options
@@ -6,6 +6,7 @@ EXE_INC = \
     -I$(LIB_SRC)/finiteVolume/lnInclude
 
 EXE_LIBS = \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleTransportModels \
     -lfiniteVolume
diff --git a/applications/solvers/lagrangian/coalChemistryFoam/Make/options b/applications/solvers/lagrangian/coalChemistryFoam/Make/options
index 22f2dd7fe2ede8a3f1518836e2530b3bfe13e249..b4758dace7856373104298d1a3ab5568d853af1f 100644
--- a/applications/solvers/lagrangian/coalChemistryFoam/Make/options
+++ b/applications/solvers/lagrangian/coalChemistryFoam/Make/options
@@ -22,6 +22,7 @@ EXE_INC = \
 EXE_LIBS = \
     -lfiniteVolume \
     -lmeshTools \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
     -llagrangian \
diff --git a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options
index c2ffc71a789f2c8a9397baafb7fe44ed498416a5..3639d884a246b0b20ba31b057e5651237de5c2d3 100644
--- a/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options
+++ b/applications/solvers/lagrangian/porousExplicitSourceReactingParcelFoam/Make/options
@@ -22,6 +22,7 @@ EXE_INC = \
 EXE_LIBS = \
     -lfiniteVolume \
     -lmeshTools \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
     -llagrangian \
diff --git a/applications/solvers/lagrangian/reactingParcelFoam/Make/options b/applications/solvers/lagrangian/reactingParcelFoam/Make/options
index b007da1d1b5395503448153c61ef33ed07610f1f..33d575609bafa574a739767cdfdafe11c5573b86 100644
--- a/applications/solvers/lagrangian/reactingParcelFoam/Make/options
+++ b/applications/solvers/lagrangian/reactingParcelFoam/Make/options
@@ -21,6 +21,7 @@ EXE_INC = \
 EXE_LIBS = \
     -lfiniteVolume \
     -lmeshTools \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
     -llagrangian \
diff --git a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options
index 34d4d29c1fbf99a4b0dac82e28c30db4e21d73cd..35a21df21a69c9bc500c75cf686a11e29da03815 100644
--- a/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options
+++ b/applications/solvers/lagrangian/uncoupledKinematicParcelFoam/Make/options
@@ -17,6 +17,7 @@ EXE_LIBS = \
     -lbasicThermophysicalModels \
     -lspecie \
     -lradiation \
+    -lcompressibleTurbulenceModel \
     -lcompressibleRASModels \
     -lcompressibleLESModels \
     -lfiniteVolume \
diff --git a/applications/solvers/multiphase/cavitatingFoam/Make/options b/applications/solvers/multiphase/cavitatingFoam/Make/options
index 9cb749d63c1f5fe2cbfb1a83cff5a62049e4373a..836301986d7683136b51b40ee42504c18b6ed2f9 100644
--- a/applications/solvers/multiphase/cavitatingFoam/Make/options
+++ b/applications/solvers/multiphase/cavitatingFoam/Make/options
@@ -7,6 +7,7 @@ EXE_INC = \
     -I$(LIB_SRC)/thermophysicalModels/barotropicCompressibilityModel/lnInclude
 
 EXE_LIBS = \
+    -lincompressibleTurbulenceModel \
     -lincompressibleTransportModels \
     -lincompressibleRASModels \
     -lincompressibleLESModels \
diff --git a/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options b/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options
index 75094c8b16b2f795b9c4b9f940f7dcb1dded7ed6..2a732d1a72f968f46274391ba7bde66aa8d503be 100644
--- a/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options
+++ b/applications/solvers/multiphase/compressibleInterDyMFoam/Make/options
@@ -11,6 +11,7 @@ EXE_INC = \
 EXE_LIBS = \
     -linterfaceProperties \
     -lincompressibleTransportModels \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleLESModels \
     -lfiniteVolume \
diff --git a/applications/solvers/multiphase/compressibleInterFoam/Make/options b/applications/solvers/multiphase/compressibleInterFoam/Make/options
index d7a537fc109e8b2fea28f027d340ec7584ceaef2..93098736927e4d08efde0cb169499b1dedca1cec 100644
--- a/applications/solvers/multiphase/compressibleInterFoam/Make/options
+++ b/applications/solvers/multiphase/compressibleInterFoam/Make/options
@@ -1,4 +1,4 @@
-EXE_INC = -ggdb3 \
+EXE_INC = \
     -I$(LIB_SRC)/transportModels \
     -I$(LIB_SRC)/transportModels/incompressible/lnInclude \
     -I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
@@ -8,6 +8,7 @@ EXE_INC = -ggdb3 \
 EXE_LIBS = \
     -linterfaceProperties \
     -lincompressibleTransportModels \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleLESModels \
     -lfiniteVolume
diff --git a/applications/solvers/multiphase/interDyMFoam/Make/options b/applications/solvers/multiphase/interDyMFoam/Make/options
index 6bbea18fd60c3931bb69bde7cbf3fb887c244032..dd6e8ee57c24f96342f91a325cf53f6bc1a658cf 100644
--- a/applications/solvers/multiphase/interDyMFoam/Make/options
+++ b/applications/solvers/multiphase/interDyMFoam/Make/options
@@ -12,6 +12,7 @@ EXE_INC = \
 EXE_LIBS = \
     -linterfaceProperties \
     -lincompressibleTransportModels \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleLESModels \
     -lfiniteVolume \
diff --git a/applications/solvers/multiphase/interFoam/Make/options b/applications/solvers/multiphase/interFoam/Make/options
index 0e21fc2d6423b4febd7dc39a0973924b33bf6446..93098736927e4d08efde0cb169499b1dedca1cec 100644
--- a/applications/solvers/multiphase/interFoam/Make/options
+++ b/applications/solvers/multiphase/interFoam/Make/options
@@ -8,6 +8,7 @@ EXE_INC = \
 EXE_LIBS = \
     -linterfaceProperties \
     -lincompressibleTransportModels \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleLESModels \
     -lfiniteVolume
diff --git a/applications/solvers/multiphase/interMixingFoam/Make/options b/applications/solvers/multiphase/interMixingFoam/Make/options
index d8e4da2313e4343d0c6200c7fe9c7e8d2c090d48..62271c2bb7e22cca0a814450bbe541cb5de6d4e4 100644
--- a/applications/solvers/multiphase/interMixingFoam/Make/options
+++ b/applications/solvers/multiphase/interMixingFoam/Make/options
@@ -12,6 +12,7 @@ EXE_INC = \
 EXE_LIBS = \
     -linterfaceProperties \
     -lincompressibleTransportModels \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleLESModels \
     -lfiniteVolume
diff --git a/applications/solvers/multiphase/interPhaseChangeFoam/Make/options b/applications/solvers/multiphase/interPhaseChangeFoam/Make/options
index 24e523f2496bbf2c588af4dce0eecdf770418d6d..fb77739916159a1973054dae1b8cafc7e353e853 100644
--- a/applications/solvers/multiphase/interPhaseChangeFoam/Make/options
+++ b/applications/solvers/multiphase/interPhaseChangeFoam/Make/options
@@ -9,6 +9,7 @@ EXE_INC = \
 EXE_LIBS = \
     -linterfaceProperties \
     -lincompressibleTransportModels \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleLESModels \
     -lfiniteVolume
diff --git a/applications/solvers/multiphase/multiphaseInterFoam/Make/options b/applications/solvers/multiphase/multiphaseInterFoam/Make/options
index 6e9363f13f8c2a2553afadfb7a61600a1d8ebf39..92c738c687ab920d649f0e16d222aeaa93928bff 100644
--- a/applications/solvers/multiphase/multiphaseInterFoam/Make/options
+++ b/applications/solvers/multiphase/multiphaseInterFoam/Make/options
@@ -11,6 +11,7 @@ EXE_INC = \
 EXE_LIBS = \
     -linterfaceProperties \
     -lincompressibleTransportModels \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleLESModels \
     -lfiniteVolume
\ No newline at end of file
diff --git a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options
index 0e21fc2d6423b4febd7dc39a0973924b33bf6446..93098736927e4d08efde0cb169499b1dedca1cec 100644
--- a/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options
+++ b/applications/solvers/multiphase/twoLiquidMixingFoam/Make/options
@@ -8,6 +8,7 @@ EXE_INC = \
 EXE_LIBS = \
     -linterfaceProperties \
     -lincompressibleTransportModels \
+    -lincompressibleTurbulenceModel \
     -lincompressibleRASModels \
     -lincompressibleLESModels \
     -lfiniteVolume
diff --git a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C
index 3394b928b22f3079e0f3470d1ffabdf68b89af16..00913b8817359b4fb751b683d6870f011d61d7f8 100644
--- a/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C
+++ b/applications/utilities/mesh/manipulation/renumberMesh/renumberMesh.C
@@ -430,6 +430,59 @@ int main(int argc, char *argv[])
         << "Band before renumbering: "
         << returnReduce(band, maxOp<label>()) << nl << endl;
 
+
+    // Read parallel reconstruct maps
+    labelIOList cellProcAddressing
+    (
+        IOobject
+        (
+            "cellProcAddressing",
+            mesh.facesInstance(),
+            polyMesh::meshSubDir,
+            mesh,
+            IOobject::READ_IF_PRESENT
+        ),
+        labelList(0)
+    );
+
+    labelIOList faceProcAddressing
+    (
+        IOobject
+        (
+            "faceProcAddressing",
+            mesh.facesInstance(),
+            polyMesh::meshSubDir,
+            mesh,
+            IOobject::READ_IF_PRESENT
+        ),
+        labelList(0)
+    );
+    labelIOList pointProcAddressing
+    (
+        IOobject
+        (
+            "pointProcAddressing",
+            mesh.pointsInstance(),
+            polyMesh::meshSubDir,
+            mesh,
+            IOobject::READ_IF_PRESENT
+        ),
+        labelList(0)
+    );
+    labelIOList boundaryProcAddressing
+    (
+        IOobject
+        (
+            "boundaryProcAddressing",
+            mesh.pointsInstance(),
+            polyMesh::meshSubDir,
+            mesh,
+            IOobject::READ_IF_PRESENT
+        ),
+        labelList(0)
+    );
+
+
     // Read objects in time directory
     IOobjectList objects(mesh, runTime.timeName());
 
@@ -579,6 +632,39 @@ int main(int argc, char *argv[])
     // Update fields
     mesh.updateMesh(map);
 
+    // Update proc maps
+    if (cellProcAddressing.headerOk())
+    {
+        Info<< "Renumbering processor cell decomposition map "
+            << cellProcAddressing.name() << endl;
+
+        cellProcAddressing = labelList
+        (
+            UIndirectList<label>(cellProcAddressing, map().cellMap())
+        );
+    }
+    if (faceProcAddressing.headerOk())
+    {
+        Info<< "Renumbering processor face decomposition map "
+            << faceProcAddressing.name() << endl;
+
+        faceProcAddressing = labelList
+        (
+            UIndirectList<label>(faceProcAddressing, map().faceMap())
+        );
+    }
+    if (pointProcAddressing.headerOk())
+    {
+        Info<< "Renumbering processor point decomposition map "
+            << pointProcAddressing.name() << endl;
+
+        pointProcAddressing = labelList
+        (
+            UIndirectList<label>(pointProcAddressing, map().pointMap())
+        );
+    }
+
+
     // Move mesh (since morphing might not do this)
     if (map().hasMotionPoints())
     {
@@ -652,9 +738,31 @@ int main(int argc, char *argv[])
     {
         mesh.setInstance(oldInstance);
     }
-    Info<< "Writing mesh to " << runTime.timeName() << endl;
+
+    Info<< "Writing mesh to " << mesh.facesInstance() << endl;
 
     mesh.write();
+    if (cellProcAddressing.headerOk())
+    {
+        cellProcAddressing.instance() = mesh.facesInstance();
+        cellProcAddressing.write();
+    }
+    if (faceProcAddressing.headerOk())
+    {
+        faceProcAddressing.instance() = mesh.facesInstance();
+        faceProcAddressing.write();
+    }
+    if (pointProcAddressing.headerOk())
+    {
+        pointProcAddressing.instance() = mesh.facesInstance();
+        pointProcAddressing.write();
+    }
+    if (boundaryProcAddressing.headerOk())
+    {
+        boundaryProcAddressing.instance() = mesh.facesInstance();
+        boundaryProcAddressing.write();
+    }
+
 
     if (writeMaps)
     {
diff --git a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
index 2009375040dadefa4263cc642b063a73c30530e6..91a51e2ae57a1a48e0682be250d32dc0ef251a3e 100644
--- a/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
+++ b/applications/utilities/parallelProcessing/decomposePar/decomposePar.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -42,6 +42,9 @@ Usage
     @param -copyUniform \n
     Copy any @a uniform directories too.
 
+    @param -constant \n
+    Override controlDict settings and use constant directory.
+
     @param -fields \n
     Use existing geometry decomposition and convert fields only.
 
@@ -119,6 +122,11 @@ int main(int argc, char *argv[])
         "ifRequired",
         "only decompose geometry if the number of domains has changed"
     );
+    argList::addBoolOption
+    (
+        "constant",
+        "include the 'constant/' dir in the times list"
+    );
 
     #include "setRootCase.H"
 
@@ -139,6 +147,20 @@ int main(int argc, char *argv[])
 
     #include "createTime.H"
 
+    // Allow -constant to override controlDict settings.
+    if (args.optionFound("constant"))
+    {
+        instantList timeDirs = timeSelector::select0(runTime, args);
+        if (runTime.timeName() != runTime.constant())
+        {
+            FatalErrorIn(args.executable())
+                << "No '" << runTime.constant() << "' time present." << endl
+                << "Valid times are " << runTime.times()
+                << exit(FatalError);
+        }
+    }
+
+
     Info<< "Time = " << runTime.timeName() << endl;
 
     // determine the existing processor count directly
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C
index a9e39afbb7e179816c81cf6755a408d3d8c90675..0f0ea82066957c9a9ee44232811944d8dfef2f8f 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamMeshVolume.C
@@ -31,6 +31,7 @@ License
 #include "cellModeller.H"
 #include "vtkOpenFOAMPoints.H"
 #include "Swap.H"
+#include "longLong.H"
 
 // VTK includes
 #include "vtkCellArray.h"
diff --git a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H
index c8e9dd2925d1da4d54f0c4b636657c5a2d8f8a7d..027b8fd142357afcc0ec8e07fb2e706c9f3a424b 100644
--- a/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H
+++ b/applications/utilities/postProcessing/graphics/PV3Readers/PV3FoamReader/vtkPV3Foam/vtkPV3FoamPointFields.H
@@ -195,7 +195,15 @@ void Foam::vtkPV3Foam::convertPointField
 
     // Note: using the name of the original volField
     // not the name generated by the interpolation "volPointInterpolate(<name>)"
-    pointData->SetName(tf.name().c_str());
+
+    if (&tf != &GeometricField<Type, fvPatchField, volMesh>::null())
+    {
+        pointData->SetName(tf.name().c_str());
+    }
+    else
+    {
+        pointData->SetName(ptf.name().c_str());
+    }
 
     if (debug)
     {
diff --git a/applications/utilities/surface/surfaceInertia/surfaceInertia.C b/applications/utilities/surface/surfaceInertia/surfaceInertia.C
index c68608feda20f82c1ace1309a39a108c40fae517..380f7fb9316f7d7b2130ed60f5daabc7dedff992 100644
--- a/applications/utilities/surface/surfaceInertia/surfaceInertia.C
+++ b/applications/utilities/surface/surfaceInertia/surfaceInertia.C
@@ -360,7 +360,7 @@ int main(int argc, char *argv[])
     if (m < 0)
     {
         WarningIn(args.executable() + "::main")
-            << "Negative mass detected" << endl;
+            << "Negative mass detected, the surface may be inside-out." << endl;
     }
 
     vector eVal = eigenValues(J);
diff --git a/bin/foamEtcFile b/bin/foamEtcFile
index 084c3f3769c0b9b287bd80483aaa9b7f28ee3737..5bae566b55a1509d8f2f65048882fe0b7af41f7b 100755
--- a/bin/foamEtcFile
+++ b/bin/foamEtcFile
@@ -39,8 +39,6 @@
 #     @endverbatim
 #
 #-------------------------------------------------------------------------------
-unset listOpt quietOpt
-
 usage() {
     [ "$quietOpt" = true ] && exit 1
 
@@ -53,7 +51,10 @@ Usage: ${0##*/} [OPTION] fileName
 options:
   -list             list the directories to be searched
   -mode <mode>      any combination of u(user), g(group), o(other)
+  -prefix <dir>     specify an alternative installation prefix
   -quiet            suppress all normal output
+  -version <ver>    specify an alternative OpenFOAM version
+                    in the form Maj.Min.Rev (eg, 1.7.0)
   -help             print the usage
 
   Locate user/group/shipped file with semantics similar to the
@@ -71,9 +72,63 @@ USAGE
     exit 1
 }
 
+#
+# This script must exist in <foamInstall>/OpenFOAM-<VERSION>/bin/
+# or <foamInstall>/openfoam<VERSION>/bin/ (for the debian version)
+#
+#-------------------------------------------------------------------------------
+
+# the bindir:
+binDir="${0%/*}"
+
+# the project dir:
+projectDir="${binDir%/bin}"
+
+# the prefix dir (same as foamInstall):
+prefixDir="${projectDir%/*}"
+
+# the name used for the project directory
+projectDirName="${projectDir##*/}"
+
+# version number used for debian packaging
+unset versionNum
+
+#
+# handle standard and debian naming convention
+#
+case "$projectDirName" in
+OpenFOAM-*)         # standard naming convention OpenFOAM-<VERSION>
+    version="${projectDirName##OpenFOAM-}"
+    ;;
+
+openfoam[0-9]*)     # debian naming convention 'openfoam<VERSION>'
+    versionNum="${projectDirName##openfoam}"
+    case "$versionNum" in
+    ??)         # convert 2 digit version number to decimal delineated
+        version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)@\1.\2@')
+        ;;
+    ???)        # convert 3 digit version number to decimal delineated
+        version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)\(.\)@\1.\2.\3@')
+        ;;
+    ????)       # convert 4 digit version number to decimal delineated
+        version=$(echo "$versionNum" | sed -e 's@\(.\)\(.\)\(.\)\(.\)@\1.\2.\3.\4@')
+        ;;
+    *)          # failback - use current environment setting
+        version="$WM_PROJECT_VERSION"
+        ;;
+    esac
+    ;;
+
+*)
+    echo "Error : unknown/unsupported naming convention"
+    exit 1
+    ;;
+esac
+
 
 # default mode is 'ugo'
 mode=ugo
+unset listOpt quietOpt
 
 # parse options
 while [ "$#" -gt 0 ]
@@ -84,7 +139,6 @@ do
         ;;
     -l | -list)
         listOpt=true
-        shift
         ;;
     -m | -mode)
         [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
@@ -98,11 +152,29 @@ do
            usage "'$1' option with invalid mode '$mode'"
            ;;
         esac
-        shift 2
+        shift
+        ;;
+    -p | -prefix)
+        [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
+        prefixDir="$2"
+        shift
         ;;
     -q | -quiet)
         quietOpt=true
+        ;;
+    -v | -version)
+        [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
+        version="$2"
+        # convert x.y.z -> xyz version (if installation looked like debian)
+        if [ -n "$versionNum" ]
+        then
+            versionNum=$(echo "$version" | sed -e 's@\.@@g')
+        fi
+        shift
+        ;;
+    --)
         shift
+        break
         ;;
     -*)
         usage "unknown option: '$*'"
@@ -111,31 +183,49 @@ do
         break
         ;;
     esac
+    shift
 done
 
-# Save the essential bits of information:
+
+# debugging:
+# echo "Installed locations:"
+# for i in projectDir prefixDir projectDirName version versionNum
+# do
+#     eval echo "$i=\$$i"
+# done
+
+
+# Save the essential bits of information
+# silently remove leading ~OpenFOAM/ (used in Foam::findEtcFile)
 nArgs=$#
-fileName="$1"
+fileName="${1#~OpenFOAM/}"
 
 # Define the various places to be searched:
 unset dirList
 case "$mode" in
 *u*)  # user
-    dirList="$dirList $HOME/.${WM_PROJECT:-OpenFOAM}/$WM_PROJECT_VERSION"
+    dirList="$dirList $HOME/.${WM_PROJECT:-OpenFOAM}/$version"
     dirList="$dirList $HOME/.${WM_PROJECT:-OpenFOAM}"
     ;;
 esac
 
 case "$mode" in
 *g*)  # group
-    dirList="$dirList $WM_PROJECT_INST_DIR/site/$WM_PROJECT_VERSION"
-    dirList="$dirList $WM_PROJECT_INST_DIR/site"
+    dirList="$dirList $prefixDir/site/$version"
+    dirList="$dirList $prefixDir/site"
     ;;
 esac
 
 case "$mode" in
-*o*)  # other
-    dirList="$dirList $WM_PROJECT_DIR/etc"
+*o*)  # other (shipped)
+    if [ -n "$versionNum" ]
+    then
+        # debian packaging
+        dirList="$dirList $prefixDir/openfoam$versionNum/etc"
+    else
+        # standard packaging
+        dirList="$dirList $prefixDir/${WM_PROJECT:-OpenFOAM}-$version/etc"
+    fi
     ;;
 esac
 set -- $dirList
diff --git a/bin/foamExec b/bin/foamExec
index 84bf043511144e525b0b1aa24a07826139756193..1e1d438dfaec5877630622a650c6fa28acbe088d 100755
--- a/bin/foamExec
+++ b/bin/foamExec
@@ -35,6 +35,8 @@
 #     mpirun -np <nProcs> \
 #         foamExec -v <foamVersion> <foamCommand> ... -parallel
 #
+# SeeAlso
+#    foamEtcFile
 #------------------------------------------------------------------------------
 usage() {
     while [ "$#" -ge 1 ]; do echo "$1"; shift; done
@@ -43,8 +45,9 @@ usage() {
 Usage: ${0##*/} [OPTION] <application> ...
 
 options:
-  -v ver        specify OpenFOAM version
-  -help         this usage
+  -version <ver>    specify an alternative OpenFOAM version
+                    pass through to foamEtcFile
+  -help             this usage
 
 * run a particular OpenFOAM version of <application>
 
@@ -52,18 +55,14 @@ USAGE
     exit 1
 }
 
+#
+# This script must exist in <foamInstall>/OpenFOAM-<VERSION>/bin/
+# or <foamInstall>/openfoam<VERSION>/bin/ (for the debian version)
+#
+# foamEtcFile is found in the same directory
+#-------------------------------------------------------------------------------
 
-# This script should exist in <foamInstall>/OpenFOAM-<VERSION>/bin/
-# extract the <foamInstall> and <version> elements
-# using a function preserves the command args
-getDefaults() {
-    set -- $(echo $0 | sed -e 's@/OpenFOAM-\([^/]*\)/bin/[^/]*$@ \1@')
-    foamInstall=$1
-    version=$2
-}
-
-getDefaults
-
+unset etcOpts
 # parse options
 while [ "$#" -gt 0 ]
 do
@@ -71,9 +70,9 @@ do
     -h | -help)
         usage
         ;;
-    -v)
-        shift
-        version=$1
+    -v | -version)
+        [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
+        etcOpts="-version $2"
         shift
         ;;
     --)
@@ -87,43 +86,22 @@ do
         break
         ;;
     esac
+    shift
 done
 
-if [ "$#" -lt 1 ]
-then
-    usage "no application specified"
-fi
-
-unset foamDotFile
-
-# Check user-specific OpenFOAM bashrc file
-foamDotFile="$HOME/.OpenFOAM/$version/bashrc"
-if [ -f $foamDotFile ]
-then
-    . $foamDotFile
-    foamDotFile=okay
-else
-    # Use the FOAM_INST_DIR variable for locating the installed version
-    for FOAM_INST_DIR in $foamInstall $WM_PROJECT_INST_DIR
-    do
-        foamDotFile="$FOAM_INST_DIR/OpenFOAM-$version/etc/bashrc"
-        if [ -f $foamDotFile ]
-        then
-            . $foamDotFile
-            foamDotFile=okay
-            break
-        fi
-    done
-fi
+[ "$#" -ge 1 ] || usage "no application specified"
 
-
-if [ "$foamDotFile" != okay ]
-then
+# find OpenFOAM settings (bashrc)
+foamDotFile="$(${0%/*}/foamEtcFile $etcOpts bashrc)" || {
     echo "Error : bashrc file could not be found for OpenFOAM-$version" 1>&2
     exit 1
-fi
+}
+
+# preserve arguments (can otherwise get lost when sourcing the foamDotFile)
+args="$*"
+. $foamDotFile
 
-# Pass on the rest of the arguments
-exec $*
+# execute
+exec $args
 
 #------------------------------------------------------------------------------
diff --git a/bin/tools/foamConfigurePaths b/bin/tools/foamConfigurePaths
index 5bd2494b81acc748f2b8f5a799145a50bbb87fa3..823c816d51c4bbc1eb427112239e56383ada87a0 100755
--- a/bin/tools/foamConfigurePaths
+++ b/bin/tools/foamConfigurePaths
@@ -34,10 +34,10 @@ usage() {
     cat<<USAGE
 
 usage: ${0##*/}
-  --foamInstall dir   		specify installation directory (e.g. /opt)
-  --projectName name 		specify project name (e.g. openfoam170)
-  --archOption  arch		specify architecture option (only 32 or 64 applicable)
-  --paraviewInstall dir 	specify ParaView_DIR (e.g. /opt/paraviewopenfoam380)
+  --foamInstall dir       specify installation directory (e.g. /opt)
+  --projectName name      specify project name (e.g. openfoam170)
+  --archOption  arch      specify architecture option (only 32 or 64 applicable)
+  --paraviewInstall dir   specify ParaView_DIR (e.g. /opt/paraviewopenfoam380)
 
 * hardcode paths to installation
 
@@ -59,30 +59,30 @@ do
         ;;
     --foamInstall)
         [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
-	foamInstall="$2"
-	echo "Replacing foamInstall setting by $foamInstall"
-	sed -i -e '/^[^#]/s@foamInstall=.*@foamInstall='"$foamInstall@" etc/bashrc
+        foamInstall="$2"
+        echo "Replacing foamInstall setting by $foamInstall"
+        sed -i -e '/^[^#]/s@foamInstall=.*@foamInstall='"$foamInstall@" etc/bashrc
         shift 2
         ;;
    --projectName)
-       	[ "$#" -ge 2 ] || usage "'$1' option requires an argument"
-	projectName="$2"
-	echo "Replacing WM_PROJECT_DIR setting by $projectName"
-	sed -i -e '/^[^#]/s@WM_PROJECT_DIR=.*@WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/'"$projectName@" etc/bashrc
-       	shift 2
-       	;;
+        [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
+        projectName="$2"
+        echo "Replacing WM_PROJECT_DIR setting by $projectName"
+        sed -i -e '/^[^#]/s@WM_PROJECT_DIR=.*@WM_PROJECT_DIR=$WM_PROJECT_INST_DIR/'"$projectName@" etc/bashrc
+        shift 2
+        ;;
     --archOption)
         [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
-	archOption="$2"
-	echo "Replacing WM_ARCH_OPTION setting by $archOption"
-	sed -i -e '/^[^#]/s@: ${WM_ARCH_OPTION:=64}@WM_ARCH_OPTION='"$archOption@" etc/bashrc
+        archOption="$2"
+        echo "Replacing WM_ARCH_OPTION setting by $archOption"
+        sed -i -e '/^[^#]/s@: ${WM_ARCH_OPTION:=64}@WM_ARCH_OPTION='"$archOption@" etc/bashrc
         shift 2
         ;;
     --paraviewInstall)
         [ "$#" -ge 2 ] || usage "'$1' option requires an argument"
-	paraviewInstall="$2"
-	echo "Replacing ParaView_DIR setting by $paraviewInstall"
-	sed -i -e '/^[^#]/s@ParaView_DIR=.*@ParaView_DIR='"$paraviewInstall@" etc/apps/paraview3/bashrc
+        paraviewInstall="$2"
+        echo "Replacing ParaView_DIR setting by $paraviewInstall"
+        sed -i -e '/^[^#]/s@ParaView_DIR=.*@ParaView_DIR='"$paraviewInstall@" etc/apps/paraview3/bashrc
         shift 2
         ;;
     *)
@@ -99,10 +99,9 @@ done
 # Replace the WM_MPLIB always
 echo "Replacing WM_MPLIB setting by SYSTEMOPENMPI"
 sed -i -e '/^[^#]/s@: ${WM_MPLIB:=.*}@WM_MPLIB=SYSTEMOPENMPI@' etc/bashrc
+
 # Replace the compilerInstall always
 echo "Replacing compilerInstall setting by system"
 sed -i -e '/^[^#]/s@: ${compilerInstall:=.*}@compilerInstall=system@' etc/settings.sh
 
-
-
 #------------------------------------------------------------------------------
diff --git a/bin/tools/pre-commit-hook b/bin/tools/pre-commit-hook
new file mode 100755
index 0000000000000000000000000000000000000000..be4bb69b24294824b7f8a2314ec4462b5bc8766a
--- /dev/null
+++ b/bin/tools/pre-commit-hook
@@ -0,0 +1,222 @@
+#!/bin/bash
+#---------------------------------*- sh -*-------------------------------------
+# =========                 |
+# \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
+#  \\    /   O peration     |
+#   \\  /    A nd           | Copyright (C) 2010-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
+#     pre-commit-hook
+#
+# Description
+#     pre-commit hook for git.
+#     Copy or link this file as ".git/hooks/pre-commit"
+#
+#     Eg,
+#     (
+#         cd $WM_PROJECT_DIR/.git/hooks &&
+#         ln -sf ../../bin/tools/pre-commit-hook pre-commit
+#     )
+#
+#     Hook receives: empty
+#
+#     Checks for
+#     - illegal code, e.g. <TAB>
+#     - copyright is current, e.g. if present, contains XXX-<current-year>
+#     - columns greater than 80 for *.[CH] files
+#
+# Note
+#     Using "git commit --no-verify" it is possible to override the hook.
+#
+#------------------------------------------------------------------------------
+die()
+{
+    echo 'pre-commit hook failure' 1>&2
+    echo '-----------------------' 1>&2
+    echo '' 1>&2
+    echo "$@" 1>&2
+    exit 1
+}
+
+#-----------------------------------------------------------------------------
+# Check content that will be added by this commit.
+
+if git rev-parse --verify -q HEAD > /dev/null
+then
+    against=HEAD
+else
+    # Initial commit: diff against an empty tree object
+    against=4b825dc642cb6eb9a060e54bf8d69288fbee4904
+fi
+
+# list of all files
+fileList=$(git diff-index --name-only $against --)
+unset badFiles
+
+# join list of files with this amount of space
+Indent="    "
+
+#
+# report bad files and die if there are any
+#
+dieOnBadFiles()
+{
+    if [ -n "$badFiles" ]
+    then
+        echo 'pre-commit hook failure' 1>&2
+        echo '-----------------------' 1>&2
+        echo "$@" 1>&2
+        echo '' 1>&2
+        echo "File(s):" 1>&2
+        echo "$badFiles" 1>&2
+        echo ''  1>&2
+        exit 1
+    fi
+}
+
+
+#
+# check for bad strings, characters, etc
+#
+checkIllegalCode()
+{
+    reBad="(N""abla|"$'\t'")"
+    msgBad="N""abla or <TAB>"
+
+    badFiles=$(
+    for f in $fileList
+    do
+        # parse line numbers from this:
+        #        path/fileName:<lineNr>:   contents
+        lines=$(git grep --cached -n -E -e "$reBad" -- "$f" |
+            sed -e 's@^[^:]*:\([0-9]*\):.*@\1@' |
+            tr '\n' ' '
+        )
+        [ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
+    done
+    )
+
+    dieOnBadFiles "Remove/correct bad '$msgBad' references"
+}
+
+
+#
+# check that OpenCFD copyright is current
+#
+checkCopyright()
+{
+    year=$(date +%Y)
+
+    badFiles=$(
+    for f in $fileList
+    do
+        # parse line numbers from this:
+        #        path/fileName:<lineNr>:   contents
+        # for Copyright lines without the current year
+        lines=$(git grep --cached -n -e Copyright -- "$f" |
+            sed -n \
+                -e '/OpenCFD/{ ' \
+                -e "/$year/b"   \
+                -e 's@^[^:]*:\([0-9]*\):.*@\1@p }' |
+            tr '\n' ' '
+        )
+        [ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
+    done
+    )
+
+    dieOnBadFiles "Update copyright year, e.g. XXXX-$year"
+}
+
+
+#
+# limit line length to 80-columns
+#
+checkLineLength()
+{
+    badFiles=$(
+    for f in $fileList
+    do
+        # limit to *.[CH] files
+        case "$f" in
+        (*.[CH])
+            # parse line numbers from this:
+            #        path/fileName:<lineNr>:   contents
+            lines=$(git grep --cached -n -e ".\{81,\}" -- "$f" |
+                sed -e 's@^[^:]*:\([0-9]*\):.*@\1@' |
+                tr '\n' ' '
+            )
+            [ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
+        ;;
+        esac
+    done
+    )
+
+    dieOnBadFiles "Limit code to 80 columns before pushing"
+}
+
+
+#
+# limit line length to 80-columns, except C++ comment lines
+#
+checkLineLengthNonComments()
+{
+    badFiles=$(
+    for f in $fileList
+    do
+        # limit to *.[CH] files
+        case "$f" in
+        (*.[CH])
+            # parse line numbers from this (strip comment lines):
+            #        path/fileName:<lineNr>:   contents
+            lines=$(git grep --cached -n -e ".\{81,\}" -- "$f" |
+                sed -n \
+                    -e '\@^[^:]*:[^:]*: *//.*@b' \
+                    -e 's@^[^:]*:\([0-9]*\):.*@\1@p' |
+                tr '\n' ' '
+            )
+            [ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
+        ;;
+        esac
+    done
+    )
+
+    dieOnBadFiles "Limit code to 80 columns before pushing"
+}
+
+
+
+# do all checks
+# ~~~~~~~~~~~~~
+
+# builtin whitespace check to avoid trailing space, including CR-LF endings
+bad=$(git diff-index --cached --check $against --) || die "$bad"
+
+# check for illegal code, e.g. <TAB>, etc
+checkIllegalCode
+
+# ensure OpenCFD copyright contains correct year
+checkCopyright
+
+# ensure code conforms to 80 columns max
+checkLineLength
+
+
+exit 0
+#------------------------------------------------------------------------------
diff --git a/debian/copyright b/debian/copyright
index 2106c078bd761f03f3f0f6c18e4196751e6133bd..32d2cc7ff8ab6cff381b561166a195051ed214f3 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -27,4 +27,4 @@ The Debian packaging is:
 
     Copyright (C) 2010 OpenCFD Ltd. <patches@opencfd.co.uk>
 
-    and is licensed under the GPL version 3 
+    and is licensed under the GPL version 3
diff --git a/debian/rules b/debian/rules
index ce5f53f5c081cd892d1470bd05348146dfcefced..696fcc9216e4b98b4db16e47f238d4f5edc37e46 100755
--- a/debian/rules
+++ b/debian/rules
@@ -96,13 +96,13 @@ binary-arch: build install
 	dh_fixperms
 	dh_makeshlibs
 	dh_installdeb
-#	dh_perl 
+#	dh_perl
 	dh_shlibdeps -- --ignore-missing-info	#We depend on vtk libs without info
 	dh_gencontrol
 	dh_md5sums
 	dh_builddeb
 
-source diff:                                                                  
+source diff:
 	@echo >&2 'source and diff are obsolete - use dpkg-source -b'; false
 
 binary: binary-indep binary-arch
diff --git a/etc/apps/paraview3/bashrc b/etc/apps/paraview3/bashrc
index 0ff28f0cafc405087cec8f3fa382bcd9374c5c94..51965e47d61340249d1936d48da21787bb7554e9 100644
--- a/etc/apps/paraview3/bashrc
+++ b/etc/apps/paraview3/bashrc
@@ -51,7 +51,7 @@ done
 
 
 # set VERSION and MAJOR (version) variables if not already set
-[ -n "$ParaView_VERSION" ] || ParaView_VERSION=3.6.1
+[ -n "$ParaView_VERSION" ] || ParaView_VERSION=3.8.0
 [ -n "$ParaView_MAJOR" ]   || ParaView_MAJOR=unknown
 
 # if needed, set MAJOR version to correspond to VERSION
@@ -75,6 +75,7 @@ export ParaView_DIR=$WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-
 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
 
     # add in python libraries if required
diff --git a/etc/apps/paraview3/cshrc b/etc/apps/paraview3/cshrc
index ddb4502c275748d6d29752bd0220190ff3629eec..a69608c9d32a55a88fc4565a2479ec725438d696 100644
--- a/etc/apps/paraview3/cshrc
+++ b/etc/apps/paraview3/cshrc
@@ -49,7 +49,7 @@ foreach cmake ( cmake-2.8.1 cmake-2.8.0 cmake-2.6.4 )
 end
 
 # set VERSION and MAJOR (version) variables if not already set
-if ( ! $?ParaView_VERSION ) setenv ParaView_VERSION 3.6.1
+if ( ! $?ParaView_VERSION ) setenv ParaView_VERSION 3.8.0
 if ( ! $?ParaView_MAJOR ) setenv ParaView_MAJOR unknown
 
 # if needed, set MAJOR version to correspond to VERSION
@@ -73,6 +73,7 @@ setenv ParaView_DIR $WM_THIRD_PARTY_DIR/platforms/$WM_ARCH$WM_COMPILER/paraview-
 # set paths if binaries or source are present
 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}
 
     # add in python libraries if required
diff --git a/etc/bashrc b/etc/bashrc
index d7dae2ae46398df14b5bc7a5c101d7ae604e0661..ad866d049b7d1f4731b2b14ba013244646eb342a 100644
--- a/etc/bashrc
+++ b/etc/bashrc
@@ -32,7 +32,7 @@
 #------------------------------------------------------------------------------
 
 export WM_PROJECT=OpenFOAM
-[ -z "$WM_PROJECT_VERSION" ] && export WM_PROJECT_VERSION=1.6
+[ -z "$WM_PROJECT_VERSION" ] && export WM_PROJECT_VERSION=dev
 
 ################################################################################
 # USER EDITABLE PART. Note changes made here may be lost with the next upgrade
@@ -131,7 +131,7 @@ unset WM_COMPILER_ARCH WM_COMPILER_LIB_ARCH
 # WM_COMPILE_OPTION = Opt | Debug | Prof
 : ${WM_COMPILE_OPTION:=Opt}; export WM_COMPILE_OPTION
 
-# WM_MPLIB = | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
+# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
 : ${WM_MPLIB:=OPENMPI}; export WM_MPLIB
 
 
diff --git a/etc/cshrc b/etc/cshrc
index 1ef3458f8ebc35c995d6f4524f8a06cb9ebb587d..9f55d62ab625334f9d5a93dda715b9b6631d0b99 100644
--- a/etc/cshrc
+++ b/etc/cshrc
@@ -31,7 +31,7 @@
 #------------------------------------------------------------------------------
 
 setenv WM_PROJECT OpenFOAM
-if ( ! $?WM_PROJECT_VERSION ) setenv WM_PROJECT_VERSION 1.6
+if ( ! $?WM_PROJECT_VERSION ) setenv WM_PROJECT_VERSION dev
 
 ################################################################################
 # USER EDITABLE PART. Note changes made here may be lost with the next upgrade
@@ -119,7 +119,7 @@ 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 = | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
+# WM_MPLIB = SYSTEMOPENMPI | OPENMPI | MPICH | MPICH-GM | HPMPI | GAMMA | MPI | QSMPI
 if ( ! $?WM_MPLIB ) setenv WM_MPLIB OPENMPI
 
 
diff --git a/etc/settings.csh b/etc/settings.csh
index 5df50a809aeb9dce1998b6251aaf1a283f8bcfaa..8b51bb7b412ca5878ad26d933fb822419150b078 100644
--- a/etc/settings.csh
+++ b/etc/settings.csh
@@ -82,7 +82,7 @@ unsetenv MPFR_ARCH_PATH
 # Select compiler installation
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # compilerInstall = OpenFOAM | system
-if ( ! $?compilerInstall ) set compilerInstall=OpenFOAM
+if ( ! $?compilerInstall ) set compilerInstall=system
 
 switch ("$compilerInstall")
 case OpenFOAM:
@@ -209,14 +209,20 @@ case OPENMPI:
     breaksw
 
 case SYSTEMOPENMPI:
-    # use the system installed openmpi, get library directory via mpicc
+
+    # This uses the installed openmpi. It needs mpicc installed!
+
     set mpi_version=openmpi-system
-    set libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
+
+    # Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
+    setenv PINC "`mpicc --showme:compile`"
+    setenv PLIBS "`mpicc --showme:link`"
+    set libDir=`echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'`
 
     if ($?FOAM_VERBOSE && $?prompt) then
-        echo "Using system installed OpenMPI:"
-        echo "    compile flags : `mpicc --showme:compile`"
-        echo "    link flags    : `mpicc --showme:link`"
+        echo "Using system installed MPI:"
+        echo "    compile flags : $PINC"
+        echo "    link flags    : $PLIBS"
         echo "    libmpi dir    : $libDir"
     endif
 
diff --git a/etc/settings.sh b/etc/settings.sh
index 17f029539a8b020e292981c3f117a319c9c2058b..aae19a764b20e359fef52f32e66d2e6a670a1e9f 100644
--- a/etc/settings.sh
+++ b/etc/settings.sh
@@ -105,7 +105,7 @@ unset MPFR_ARCH_PATH
 # Select compiler installation
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # compilerInstall = OpenFOAM | system
-: ${compilerInstall:=OpenFOAM}
+: ${compilerInstall:=system}
 
 case "${compilerInstall:-OpenFOAM}" in
 OpenFOAM)
@@ -237,13 +237,17 @@ OPENMPI)
 SYSTEMOPENMPI)
     # use the system installed openmpi, get library directory via mpicc
     mpi_version=openmpi-system
-    libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
+
+    # Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
+    export PINC="`mpicc --showme:compile`"
+    export PLIBS="`mpicc --showme:link`"
+    libDir=`echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'`
 
     if [ "$FOAM_VERBOSE" -a "$PS1" ]
     then
-        echo "Using system installed OpenMPI:"
-        echo "    compile flags : `mpicc --showme:compile`"
-        echo "    link flags    : `mpicc --showme:link`"
+        echo "Using system installed MPI:"
+        echo "    compile flags : $PINC"
+        echo "    link flags    : $PLIBS"
         echo "    libmpi dir    : $libDir"
     fi
 
diff --git a/src/OSspecific/POSIX/fileMonitor.C b/src/OSspecific/POSIX/fileMonitor.C
index a812dec9429b112fde68be45fe65b709dd76e8db..adeebbdcb68447edb8408b485a3950aa6ba21f30 100644
--- a/src/OSspecific/POSIX/fileMonitor.C
+++ b/src/OSspecific/POSIX/fileMonitor.C
@@ -257,24 +257,21 @@ void Foam::fileMonitor::checkFiles() const
             //     << "watchFd:" << inotifyEvent.wd << nl
             //     << "watchName:" << watchFile_[inotifyEvent.wd] << endl;
 
-            switch (inotifyEvent.mask)
+            if (inotifyEvent.mask % IN_DELETE_SELF)
             {
-                case IN_DELETE_SELF:
-                {
-                    Map<fileState>::iterator iter =
-                        state_.find(label(inotifyEvent.wd));
-                    iter() = DELETED;
-                }
-                break;
-
-                case IN_MODIFY:
-                case IN_CLOSE_WRITE:
-                {
-                    Map<fileState>::iterator iter =
-                        state_.find(label(inotifyEvent.wd));
-                    iter() = MODIFIED;
-                }
-                break;
+                Map<fileState>::iterator iter =
+                    state_.find(label(inotifyEvent.wd));
+                iter() = DELETED;
+            }
+            else if
+            (
+                (inotifyEvent.mask % IN_MODIFY)
+             || (inotifyEvent.mask % IN_CLOSE_WRITE)
+            )
+            {
+                Map<fileState>::iterator iter =
+                    state_.find(label(inotifyEvent.wd));
+                iter() = MODIFIED;
             }
         }
         else
diff --git a/src/OpenFOAM/containers/Lists/ListOps/ListOps.C b/src/OpenFOAM/containers/Lists/ListOps/ListOps.C
index 47fc409a2a032633f882f137018a873f7e48fcda..96b1b301828acdaaa170148db703344c034a2c45 100644
--- a/src/OpenFOAM/containers/Lists/ListOps/ListOps.C
+++ b/src/OpenFOAM/containers/Lists/ListOps/ListOps.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -25,6 +25,12 @@ License
 
 #include "ListOps.H"
 
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+const Foam::labelList Foam::emptyLabelList = Foam::labelList(0);
+
+
 // * * * * * * * * * * * * * * * Global Functions  * * * * * * * * * * * * * //
 
 Foam::labelList Foam::invert
diff --git a/src/OpenFOAM/containers/Lists/ListOps/ListOps.H b/src/OpenFOAM/containers/Lists/ListOps/ListOps.H
index 98cb8cf89ec7b884188179c1279911fccc142df6..ce16f5431a63823ca51c8bf8886f80f202068550 100644
--- a/src/OpenFOAM/containers/Lists/ListOps/ListOps.H
+++ b/src/OpenFOAM/containers/Lists/ListOps/ListOps.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -43,6 +43,16 @@ SourceFiles
 namespace Foam
 {
 
+extern const labelList emptyLabelList;
+
+//- Return reference to zero-sized list. Compare to List::null() which returns
+//  null pointer cast as list reference.
+template<class Type>
+static const List<Type>& emptyList()
+{
+    return *reinterpret_cast<const List<Type>* >(&emptyLabelList);
+}
+
 //- Renumber the values (not the indices) of a list.
 //  Negative ListType elements are left as is.
 template<class ListType>
diff --git a/src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.C b/src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.C
index a08224dd4308db4793c5fd7d952d5f4ff7415042..79ffd76e09038764c4bf152bfe5013a99569bef2 100644
--- a/src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.C
+++ b/src/OpenFOAM/dimensionedTypes/dimensionedScalar/dimensionedScalar.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -155,7 +155,7 @@ dimensionedScalar cbrt(const dimensionedScalar& ds)
     return dimensionedScalar
     (
         "cbrt(" + ds.name() + ')',
-        pow(ds.dimensions(), dimensionedScalar("(1/3)", dimless, 1.0/3.0)),
+        pow(ds.dimensions(), dimensionedScalar("(1|3)", dimless, 1.0/3.0)),
         ::cbrt(ds.value())
     );
 }
diff --git a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C
index 7cbf7a5534f15e8d1b9b15af59a65f93cc09efbd..0e2c4e962028683040ea3ddcebde2fecb654c2d9 100644
--- a/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C
+++ b/src/OpenFOAM/meshes/polyMesh/polyPatches/constraint/wedge/wedgePolyPatch.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -42,59 +42,62 @@ namespace Foam
 
 void Foam::wedgePolyPatch::initTransforms()
 {
-    const pointField& points = this->points();
-
-    patchNormal_ = operator[](0).normal(points);
-    patchNormal_ /= mag(patchNormal_);
-
-    centreNormal_ =
-        vector
-        (
-            sign(patchNormal_.x())*(max(mag(patchNormal_.x()), 0.5) - 0.5),
-            sign(patchNormal_.y())*(max(mag(patchNormal_.y()), 0.5) - 0.5),
-            sign(patchNormal_.z())*(max(mag(patchNormal_.z()), 0.5) - 0.5)
-        );
-    centreNormal_ /= mag(centreNormal_);
-
-    if
-    (
-        mag(centreNormal_.x() + centreNormal_.y() + centreNormal_.z())
-        < (1 - SMALL)
-    )
+    if (size() > 0)
     {
-        FatalErrorIn
-        (
-            "wedgePolyPatch::wedgePolyPatch(const polyPatch&, "
-            "const fvBoundaryMesh&)"
-        )   << "wedge " << name()
-            << " centre plane does not align with a coordinate plane by "
-            << 1
-             - mag(centreNormal_.x() + centreNormal_.y() + centreNormal_.z())
-            << exit(FatalError);
-    }
+        const pointField& points = this->points();
 
-    axis_ = centreNormal_ ^ patchNormal_;
-    scalar magAxis = mag(axis_);
-    axis_ /= magAxis;
+        patchNormal_ = operator[](0).normal(points);
+        patchNormal_ /= mag(patchNormal_);
 
-    if (magAxis < SMALL)
-    {
-        FatalErrorIn
+        centreNormal_ =
+            vector
+            (
+                sign(patchNormal_.x())*(max(mag(patchNormal_.x()), 0.5) - 0.5),
+                sign(patchNormal_.y())*(max(mag(patchNormal_.y()), 0.5) - 0.5),
+                sign(patchNormal_.z())*(max(mag(patchNormal_.z()), 0.5) - 0.5)
+            );
+        centreNormal_ /= mag(centreNormal_);
+
+        if
         (
-            "wedgePolyPatch::initTransforms()"
-        )   << "wedge " << name()
-            << " plane aligns with a coordinate plane." << nl
-            << "    The wedge plane should make a small angle (~2.5deg)"
-               " with the coordinate plane" << nl
-            << "    and the the pair of wedge planes should be symmetric"
-            << " about the coordinate plane." << nl
-            << "    Normal of face " << 0 << " is " << patchNormal_
-            << " , implied coordinate plane direction is " << centreNormal_
-            << exit(FatalError);
+            mag(centreNormal_.x() + centreNormal_.y() + centreNormal_.z())
+            < (1 - SMALL)
+        )
+        {
+            FatalErrorIn
+            (
+                "wedgePolyPatch::wedgePolyPatch(const polyPatch&, "
+                "const fvBoundaryMesh&)"
+            )   << "wedge " << name()
+                << " centre plane does not align with a coordinate plane by "
+                << 1
+                 - mag(centreNormal_.x()+centreNormal_.y()+centreNormal_.z())
+                << exit(FatalError);
+        }
+
+        axis_ = centreNormal_ ^ patchNormal_;
+        scalar magAxis = mag(axis_);
+        axis_ /= magAxis;
+
+        if (magAxis < SMALL)
+        {
+            FatalErrorIn
+            (
+                "wedgePolyPatch::initTransforms()"
+            )   << "wedge " << name()
+                << " plane aligns with a coordinate plane." << nl
+                << "    The wedge plane should make a small angle (~2.5deg)"
+                   " with the coordinate plane" << nl
+                << "    and the the pair of wedge planes should be symmetric"
+                << " about the coordinate plane." << nl
+                << "    Normal of face " << 0 << " is " << patchNormal_
+                << " , implied coordinate plane direction is " << centreNormal_
+                << exit(FatalError);
+        }
+
+        faceT_ = rotationTensor(centreNormal_, patchNormal_);
+        cellT_ = faceT_ & faceT_;
     }
-
-    faceT_ = rotationTensor(centreNormal_, patchNormal_);
-    cellT_ = faceT_ & faceT_;
 }
 
 
diff --git a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C
index 5cdc5e9d897a410ec1daba05d2815ab613860481..d4407a7d6881ebcb0195bcc7574343e5c0aad733 100644
--- a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C
+++ b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -440,6 +440,19 @@ Foam::point Foam::plane::planePlaneIntersect
 }
 
 
+void Foam::plane::writeDict(Ostream& os) const
+{
+    os.writeKeyword("planeType") << "pointAndNormal"
+        << token::END_STATEMENT << nl;
+    os  << indent << "pointAndNormalDict" << nl
+        << indent << token::BEGIN_BLOCK << incrIndent << nl;
+    os.writeKeyword("basePoint") << basePoint_ << token::END_STATEMENT << nl;
+    os.writeKeyword("normalVector") << unitVector_ << token::END_STATEMENT
+        << nl;
+    os << decrIndent << indent << token::END_BLOCK << endl;
+}
+
+
 // * * * * * * * * * * * * * * * Friend Operators  * * * * * * * * * * * * * //
 
 bool Foam::operator==(const plane& a, const plane& b)
diff --git a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.H b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.H
index 36dac89224c6535c4d9708cb52a2ff2902f260ab..44eb20cbc07a2d3178dbbd9b4a2d9b947688375f 100644
--- a/src/OpenFOAM/meshes/primitiveShapes/plane/plane.H
+++ b/src/OpenFOAM/meshes/primitiveShapes/plane/plane.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -182,6 +182,9 @@ public:
         //- Return the cutting point between this plane and two other planes
         point planePlaneIntersect(const plane&, const plane&) const;
 
+        //- Write to dictionary
+        void writeDict(Ostream&) const;
+
 
     // friend Operators
 
diff --git a/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C b/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C
index 745c66c58d1b80f2d3364aa170f57232f4b4881d..b7aef808507a2b3ca8794b4955551f6e5b06ab2a 100644
--- a/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C
+++ b/src/finiteVolume/cfdTools/general/porousMedia/porousZone.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -27,6 +27,7 @@ License
 #include "fvMesh.H"
 #include "fvMatrices.H"
 #include "geometricOneField.H"
+#include "stringListOps.H"
 
 // * * * * * * * * * * * * Static Member Functions * * * * * * * * * * * * * //
 
@@ -62,15 +63,15 @@ void Foam::porousZone::adjustNegativeResistance(dimensionedVector& resist)
 
 Foam::porousZone::porousZone
 (
-    const word& name,
+    const keyType& key,
     const fvMesh& mesh,
     const dictionary& dict
 )
 :
-    name_(name),
+    key_(key),
     mesh_(mesh),
     dict_(dict),
-    cellZoneID_(mesh_.cellZones().findZoneID(name)),
+    cellZoneIds_(0),
     coordSys_(dict, mesh),
     porosity_(1),
     intensity_(0),
@@ -80,9 +81,27 @@ Foam::porousZone::porousZone
     D_("D", dimensionSet(0, -2, 0, 0, 0), tensor::zero),
     F_("F", dimensionSet(0, -1, 0, 0, 0), tensor::zero)
 {
-    Info<< "Creating porous zone: " << name_ << endl;
+    Info<< "Creating porous zone: " << key_ << endl;
 
-    bool foundZone = (cellZoneID_ != -1);
+    if (key_.isPattern())
+    {
+        cellZoneIds_ = findStrings
+        (
+            key_,
+            mesh_.cellZones().names()
+        );
+    }
+    else
+    {
+        const label zoneId = mesh_.cellZones().findZoneID(key_);
+        if (zoneId != -1)
+        {
+            cellZoneIds_.setSize(1);
+            cellZoneIds_[0] = zoneId;
+        }
+    }
+
+    bool foundZone = !cellZoneIds_.empty();
     reduce(foundZone, orOp<bool>());
 
     if (!foundZone && Pstream::master())
@@ -90,8 +109,8 @@ Foam::porousZone::porousZone
         FatalErrorIn
         (
             "Foam::porousZone::porousZone"
-            "(const fvMesh&, const word&, const dictionary&)"
-        )   << "cannot find porous cellZone " << name_
+            "(const keyType&, const fvMesh&, const dictionary&)"
+        )   << "cannot find porous cellZone " << key_
             << exit(FatalError);
     }
 
@@ -106,7 +125,7 @@ Foam::porousZone::porousZone
         FatalIOErrorIn
         (
             "Foam::porousZone::porousZone"
-            "(const fvMesh&, const word&, const dictionary&)",
+            "(const keyType&, const fvMesh&, const dictionary&)",
             dict_
         )
             << "out-of-range porosity value " << porosity_
@@ -123,7 +142,7 @@ Foam::porousZone::porousZone
         FatalIOErrorIn
         (
             "Foam::porousZone::porousZone"
-            "(const fvMesh&, const word&, const dictionary&)",
+            "(const keyType&, const fvMesh&, const dictionary&)",
             dict_
         )
             << "out-of-range turbulent intensity value " << intensity_
@@ -140,7 +159,7 @@ Foam::porousZone::porousZone
         FatalIOErrorIn
         (
             "Foam::porousZone::porousZone"
-            "(const fvMesh&, const word&, const dictionary&)",
+            "(const keyType&, const fvMesh&, const dictionary&)",
             dict_
         )
             << "out-of-range turbulent length scale " << mixingLength_
@@ -169,7 +188,7 @@ Foam::porousZone::porousZone
                 FatalIOErrorIn
                 (
                     "Foam::porousZone::porousZone"
-                    "(const fvMesh&, const word&, const dictionary&)",
+                    "(const keyType&, const fvMesh&, const dictionary&)",
                     dict_
                 )   << "incorrect dimensions for d: " << d.dimensions()
                     << " should be " << D_.dimensions()
@@ -192,7 +211,7 @@ Foam::porousZone::porousZone
                 FatalIOErrorIn
                 (
                     "Foam::porousZone::porousZone"
-                    "(const fvMesh&, const word&, const dictionary&)",
+                    "(const keyType&, const fvMesh&, const dictionary&)",
                     dict_
                 )   << "incorrect dimensions for f: " << f.dimensions()
                     << " should be " << F_.dimensions()
@@ -220,7 +239,7 @@ Foam::porousZone::porousZone
         FatalIOErrorIn
         (
             "Foam::porousZone::porousZone"
-            "(const fvMesh&, const word&, const dictionary&)",
+            "(const keyType&, const fvMesh&, const dictionary&)",
             dict_
         )   << "neither powerLaw (C0/C1) "
                "nor Darcy-Forchheimer law (d/f) specified"
@@ -239,7 +258,7 @@ Foam::porousZone::porousZone
 
 void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
 {
-    if (cellZoneID_ == -1)
+    if (cellZoneIds_.empty())
     {
         return;
     }
@@ -250,7 +269,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
         compressible = true;
     }
 
-    const labelList& cells = mesh_.cellZones()[cellZoneID_];
     const scalarField& V = mesh_.V();
     scalarField& Udiag = UEqn.diag();
     vectorField& Usource = UEqn.source();
@@ -263,7 +281,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
             addPowerLawResistance
             (
                 Udiag,
-                cells,
                 V,
                 mesh_.lookupObject<volScalarField>("rho"),
                 U
@@ -274,7 +291,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
             addPowerLawResistance
             (
                 Udiag,
-                cells,
                 V,
                 geometricOneField(),
                 U
@@ -293,7 +309,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
             (
                 Udiag,
                 Usource,
-                cells,
                 V,
                 mesh_.lookupObject<volScalarField>("rho"),
                 mesh_.lookupObject<volScalarField>("mu"),
@@ -306,7 +321,6 @@ void Foam::porousZone::addResistance(fvVectorMatrix& UEqn) const
             (
                 Udiag,
                 Usource,
-                cells,
                 V,
                 geometricOneField(),
                 mesh_.lookupObject<volScalarField>("nu"),
@@ -324,7 +338,7 @@ void Foam::porousZone::addResistance
     bool correctAUprocBC
 ) const
 {
-    if (cellZoneID_ == -1)
+    if (cellZoneIds_.empty())
     {
         return;
     }
@@ -335,7 +349,6 @@ void Foam::porousZone::addResistance
         compressible = true;
     }
 
-    const labelList& cells = mesh_.cellZones()[cellZoneID_];
     const vectorField& U = UEqn.psi();
 
     if (C0_ > VSMALL)
@@ -345,7 +358,6 @@ void Foam::porousZone::addResistance
             addPowerLawResistance
             (
                 AU,
-                cells,
                 mesh_.lookupObject<volScalarField>("rho"),
                 U
             );
@@ -355,7 +367,6 @@ void Foam::porousZone::addResistance
             addPowerLawResistance
             (
                 AU,
-                cells,
                 geometricOneField(),
                 U
             );
@@ -372,7 +383,6 @@ void Foam::porousZone::addResistance
             addViscousInertialResistance
             (
                 AU,
-                cells,
                 mesh_.lookupObject<volScalarField>("rho"),
                 mesh_.lookupObject<volScalarField>("mu"),
                 U
@@ -383,7 +393,6 @@ void Foam::porousZone::addResistance
             addViscousInertialResistance
             (
                 AU,
-                cells,
                 geometricOneField(),
                 mesh_.lookupObject<volScalarField>("nu"),
                 U
diff --git a/src/finiteVolume/cfdTools/general/porousMedia/porousZone.H b/src/finiteVolume/cfdTools/general/porousMedia/porousZone.H
index 59a83a24a57c88af4e3fa3213f5c726aaab67f05..6bd909143c2962a4c69dc16dccfd00b08b6d2e23 100644
--- a/src/finiteVolume/cfdTools/general/porousMedia/porousZone.H
+++ b/src/finiteVolume/cfdTools/general/porousMedia/porousZone.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -110,8 +110,8 @@ class porousZone
 {
     // Private data
 
-        //- Name of this zone
-        word name_;
+        //- Name of this zone, or a regular expression
+        keyType key_;
 
         //- Reference to the finite volume mesh this zone is part of
         const fvMesh& mesh_;
@@ -119,8 +119,8 @@ class porousZone
         //- Dictionary containing the parameters
         dictionary dict_;
 
-        //- Cell zone ID
-        label cellZoneID_;
+        //- Cell zone Ids
+        labelList cellZoneIds_;
 
         //- Coordinate system used for the zone (Cartesian)
         coordinateSystem coordSys_;
@@ -159,7 +159,6 @@ class porousZone
         void addPowerLawResistance
         (
             scalarField& Udiag,
-            const labelList& cells,
             const scalarField& V,
             const RhoFieldType& rho,
             const vectorField& U
@@ -171,7 +170,6 @@ class porousZone
         (
             scalarField& Udiag,
             vectorField& Usource,
-            const labelList& cells,
             const scalarField& V,
             const RhoFieldType& rho,
             const scalarField& mu,
@@ -184,7 +182,6 @@ class porousZone
         void addPowerLawResistance
         (
             tensorField& AU,
-            const labelList& cells,
             const RhoFieldType& rho,
             const vectorField& U
         ) const;
@@ -194,7 +191,6 @@ class porousZone
         void addViscousInertialResistance
         (
             tensorField& AU,
-            const labelList& cells,
             const RhoFieldType& rho,
             const scalarField& mu,
             const vectorField& U
@@ -213,7 +209,7 @@ public:
     // Constructors
 
         //- Construct from components
-        porousZone(const word& name, const fvMesh&, const dictionary&);
+        porousZone(const keyType& key, const fvMesh&, const dictionary&);
 
         //- Return clone
         autoPtr<porousZone> clone() const
@@ -237,10 +233,10 @@ public:
 
             autoPtr<porousZone> operator()(Istream& is) const
             {
-                word name(is);
+                keyType key(is);
                 dictionary dict(is);
 
-                return autoPtr<porousZone>(new porousZone(name, mesh_, dict));
+                return autoPtr<porousZone>(new porousZone(key, mesh_, dict));
             }
         };
 
@@ -255,9 +251,9 @@ public:
         // Access
 
             //- cellZone name
-            const word& zoneName() const
+            const keyType& zoneName() const
             {
-                return name_;
+                return key_;
             }
 
             //- Return mesh
@@ -266,10 +262,10 @@ public:
                 return mesh_;
             }
 
-            //- cellZone number
-            label zoneId() const
+            //- cellZone numbers
+            const labelList& zoneIds() const
             {
-                return cellZoneID_;
+                return cellZoneIds_;
             }
 
             //- dictionary values used for the porousZone
diff --git a/src/finiteVolume/cfdTools/general/porousMedia/porousZoneTemplates.C b/src/finiteVolume/cfdTools/general/porousMedia/porousZoneTemplates.C
index 46a60ca7824b3e3c63d7466a3aa5cd460efb7d4b..4e72859f8005338cd0bd7b148a9284e0a89267d2 100644
--- a/src/finiteVolume/cfdTools/general/porousMedia/porousZoneTemplates.C
+++ b/src/finiteVolume/cfdTools/general/porousMedia/porousZoneTemplates.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -33,12 +33,15 @@ void Foam::porousZone::modifyDdt(fvMatrix<Type>& m) const
 {
     if (porosity_ < 1)
     {
-        const labelList& cells = mesh_.cellZones()[cellZoneID_];
-
-        forAll(cells, i)
+        forAll(cellZoneIds_, zoneI)
         {
-            m.diag()[cells[i]]   *= porosity_;
-            m.source()[cells[i]] *= porosity_;
+            const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
+
+            forAll(cells, i)
+            {
+                m.diag()[cells[i]]   *= porosity_;
+                m.source()[cells[i]] *= porosity_;
+            }
         }
     }
 }
@@ -48,7 +51,6 @@ template<class RhoFieldType>
 void Foam::porousZone::addPowerLawResistance
 (
     scalarField& Udiag,
-    const labelList& cells,
     const scalarField& V,
     const RhoFieldType& rho,
     const vectorField& U
@@ -57,10 +59,15 @@ void Foam::porousZone::addPowerLawResistance
     const scalar C0 = C0_;
     const scalar C1m1b2 = (C1_ - 1.0)/2.0;
 
-    forAll(cells, i)
+    forAll(cellZoneIds_, zoneI)
     {
-        Udiag[cells[i]] +=
+        const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
+
+        forAll(cells, i)
+        {
+            Udiag[cells[i]] +=
             V[cells[i]]*rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2);
+        }
     }
 }
 
@@ -70,7 +77,6 @@ void Foam::porousZone::addViscousInertialResistance
 (
     scalarField& Udiag,
     vectorField& Usource,
-    const labelList& cells,
     const scalarField& V,
     const RhoFieldType& rho,
     const scalarField& mu,
@@ -80,14 +86,21 @@ void Foam::porousZone::addViscousInertialResistance
     const tensor& D = D_.value();
     const tensor& F = F_.value();
 
-    forAll(cells, i)
+    forAll(cellZoneIds_, zoneI)
     {
-        tensor dragCoeff = mu[cells[i]]*D + (rho[cells[i]]*mag(U[cells[i]]))*F;
-        scalar isoDragCoeff = tr(dragCoeff);
+        const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
+
+        forAll(cells, i)
+        {
+            const tensor dragCoeff = mu[cells[i]]*D
+                + (rho[cells[i]]*mag(U[cells[i]]))*F;
 
-        Udiag[cells[i]] += V[cells[i]]*isoDragCoeff;
-        Usource[cells[i]] -=
-            V[cells[i]]*((dragCoeff - I*isoDragCoeff) & U[cells[i]]);
+            const scalar isoDragCoeff = tr(dragCoeff);
+
+            Udiag[cells[i]] += V[cells[i]]*isoDragCoeff;
+            Usource[cells[i]] -=
+                V[cells[i]]*((dragCoeff - I*isoDragCoeff) & U[cells[i]]);
+        }
     }
 }
 
@@ -96,7 +109,6 @@ template<class RhoFieldType>
 void Foam::porousZone::addPowerLawResistance
 (
     tensorField& AU,
-    const labelList& cells,
     const RhoFieldType& rho,
     const vectorField& U
 ) const
@@ -104,10 +116,15 @@ void Foam::porousZone::addPowerLawResistance
     const scalar C0 = C0_;
     const scalar C1m1b2 = (C1_ - 1.0)/2.0;
 
-    forAll(cells, i)
+    forAll(cellZoneIds_, zoneI)
     {
-        AU[cells[i]] = AU[cells[i]]
-          + I*(rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2));
+        const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
+
+        forAll(cells, i)
+        {
+            AU[cells[i]] = AU[cells[i]]
+                + I*(rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2));
+        }
     }
 }
 
@@ -116,7 +133,6 @@ template<class RhoFieldType>
 void Foam::porousZone::addViscousInertialResistance
 (
     tensorField& AU,
-    const labelList& cells,
     const RhoFieldType& rho,
     const scalarField& mu,
     const vectorField& U
@@ -125,9 +141,14 @@ void Foam::porousZone::addViscousInertialResistance
     const tensor& D = D_.value();
     const tensor& F = F_.value();
 
-    forAll(cells, i)
+    forAll(cellZoneIds_, zoneI)
     {
-        AU[cells[i]] += mu[cells[i]]*D + (rho[cells[i]]*mag(U[cells[i]]))*F;
+        const labelList& cells = mesh_.cellZones()[cellZoneIds_[zoneI]];
+
+        forAll(cells, i)
+        {
+            AU[cells[i]] += mu[cells[i]]*D + (rho[cells[i]]*mag(U[cells[i]]))*F;
+        }
     }
 }
 
diff --git a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/newAtomizationModel.C b/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/newAtomizationModel.C
deleted file mode 100644
index 5304ea008dee4f3b45ee00f1d894858a72981435..0000000000000000000000000000000000000000
--- a/src/lagrangian/dieselSpray/spraySubModels/atomizationModel/atomizationModel/newAtomizationModel.C
+++ /dev/null
@@ -1,74 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  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/>.
-
-\*---------------------------------------------------------------------------*/
-
-#include "error.H"
-#include "atomizationModel.H"
-#include "LISA.H"
-#include "noAtomization.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
-// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
-
-autoPtr<atomizationModel> atomizationModel::New
-(
-    const dictionary& dict,
-    spray& sm
-)
-{
-    word atomizationModelType
-    (
-        dict.lookup("atomizationModel")
-    );
-
-    Info<< "Selecting atomizationModel "
-         << atomizationModelType << endl;
-
-    dictionaryConstructorTable::iterator cstrIter =
-        dictionaryConstructorTablePtr_->find(atomizationModelType);
-
-    if (cstrIter == dictionaryConstructorTablePtr_->end())
-    {
-        FatalError
-            << "atomizationModel::New(const dictionary&, const spray&) : " << endl
-            << "    unknown atomizationModelType type "
-            << atomizationModelType
-            << ", constructor not in hash table" << endl << endl
-            << "    Valid atomizationModel types are :" << endl;
-        Info<< dictionaryConstructorTablePtr_->sortedToc() << abort(FatalError);
-    }
-
-    return autoPtr<atomizationModel>(cstrIter()(dict, sm));
-}
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
-// ************************************************************************* //
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.C
index 47db7f93da23e80bbba0e1135b042d49faae400d..5f22f047508c1e411408b97d005a76fed8c0b705 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.C
@@ -59,6 +59,6 @@ Foam::CollisionModel<CloudType>::~CollisionModel()
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-#include "NewCollisionModel.C"
+#include "CollisionModelNew.C"
 
 // ************************************************************************* //
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.H
index cbce0ee43acc85e130ea867c751128a69a7be97f..fc6f9a488694e2b5e59bdc861cf3dbfb68d5a00a 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.H
@@ -29,7 +29,7 @@ Description
 
 SourceFiles
     CollisionModel.C
-    NewCollisionModel.C
+    CollisionModelNew.C
 
 \*---------------------------------------------------------------------------*/
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/NewCollisionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModelNew.C
similarity index 100%
rename from src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/NewCollisionModel.C
rename to src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModelNew.C
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.C
index 79adb906c17fffba5ba372f8d1c00c2f2958c438..cbd869d8223fc7bb112c3a3721c5499367993af2 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.C
@@ -75,6 +75,6 @@ Foam::PairModel<CloudType>::coeffDict() const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-#include "NewPairModel.C"
+#include "PairModelNew.C"
 
 // ************************************************************************* //
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.H b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.H
index b5b36fdb68b8e5542ea1d93d6c15e48fbf48f09e..bbfb8f4aecbe179259b6a27cc37d07fec2988f43 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModel.H
@@ -29,7 +29,7 @@ Description
 
 SourceFiles
     PairModel.C
-    NewPairModel.C
+    PairModelNew.C
 
 \*---------------------------------------------------------------------------*/
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/NewPairModel.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModelNew.C
similarity index 100%
rename from src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/NewPairModel.C
rename to src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/PairModel/PairModel/PairModelNew.C
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.C
index d25cc29c6ab630d0b331a25d5e4aa6eccd62073f..a26f9b1e113f9919222b7f3b7b4f0d4fa548624f 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.C
@@ -83,6 +83,6 @@ Foam::WallModel<CloudType>::coeffDict() const
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-#include "NewWallModel.C"
+#include "WallModelNew.C"
 
 // ************************************************************************* //
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.H b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.H
index 392825f8297802f68e2ceefdb756e2a52e9e4df2..3d6a6cfcf12bcaacc2c68780a3fee9fb7d866e05 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModel.H
@@ -29,7 +29,7 @@ Description
 
 SourceFiles
     WallModel.C
-    NewWallModel.C
+    WallModelNew.C
 
 \*---------------------------------------------------------------------------*/
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/NewWallModel.C b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModelNew.C
similarity index 100%
rename from src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/NewWallModel.C
rename to src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/PairCollision/WallModel/WallModel/WallModelNew.C
diff --git a/src/mesh/blockMesh/blockMesh/blockMeshTopology.C b/src/mesh/blockMesh/blockMesh/blockMeshTopology.C
index 9a962483681826ed40c7855855e397b8895527b3..d1fe81c2f17deda8dfce6aec97b5541246cbb8f8 100644
--- a/src/mesh/blockMesh/blockMesh/blockMeshTopology.C
+++ b/src/mesh/blockMesh/blockMesh/blockMeshTopology.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -208,6 +208,13 @@ bool Foam::blockMesh::readBoundary
     {
         const entry& patchInfo = patchesInfo[patchI];
 
+        if (!patchInfo.isDict())
+        {
+            FatalIOErrorIn("blockMesh::readBoundary(..)", meshDescription)
+                << "Entry " << patchInfo << " in boundary section is not a"
+                << " valid dictionary." << exit(FatalIOError);
+        }
+
         // Construct dictionary and add name
         patchDicts.set(patchI, new dictionary(patchInfo.dict()));
         patchDicts[patchI].set("name", patchInfo.keyword());
diff --git a/src/meshTools/cellClassification/cellClassification.C b/src/meshTools/cellClassification/cellClassification.C
index dbc8bf29fb8a891c937624fb8af1f6286e5f16be..a7236654777262149c8ddff3918ee314f188ddd2 100644
--- a/src/meshTools/cellClassification/cellClassification.C
+++ b/src/meshTools/cellClassification/cellClassification.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -33,6 +33,8 @@ License
 #include "MeshWave.H"
 #include "ListOps.H"
 #include "meshTools.H"
+#include "cpuTime.H"
+#include "globalMeshData.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
diff --git a/src/meshTools/coordinateSystems/coordinateSystem.C b/src/meshTools/coordinateSystems/coordinateSystem.C
index 8e5fc7bceb1f84344b25e36aa6ff1ec71d9aa22e..0a5fe400f7e7270d4d2a8cfb00174a142f06b4c2 100644
--- a/src/meshTools/coordinateSystems/coordinateSystem.C
+++ b/src/meshTools/coordinateSystems/coordinateSystem.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -136,37 +136,36 @@ Foam::coordinateSystem::coordinateSystem
 {
     const entry* entryPtr = dict.lookupEntryPtr(typeName_(), false, false);
 
-    // a simple entry is a lookup into global coordinateSystems
+    // non-dictionary entry is a lookup into global coordinateSystems
     if (entryPtr && !entryPtr->isDict())
     {
-        word csName;
-        entryPtr->stream() >> csName;
+        keyType key(entryPtr->stream());
 
-        const coordinateSystems& csLst = coordinateSystems::New(obr);
+        const coordinateSystems& lst = coordinateSystems::New(obr);
+        const label id = lst.find(key);
 
-        label csId = csLst.find(csName);
         if (debug)
         {
             Info<< "coordinateSystem::coordinateSystem"
                 "(const dictionary&, const objectRegistry&):"
                 << nl << "using global coordinate system: "
-                << csName << "=" << csId << endl;
+                << key << "=" << id << endl;
         }
 
-        if (csId < 0)
+        if (id < 0)
         {
             FatalErrorIn
             (
                 "coordinateSystem::coordinateSystem"
                 "(const dictionary&, const objectRegistry&)"
-            )   << "could not find coordinate system: " << csName << nl
-                << "available coordinate systems: " << csLst.toc() << nl << nl
+            )   << "could not find coordinate system: " << key << nl
+                << "available coordinate systems: " << lst.toc() << nl << nl
                 << exit(FatalError);
         }
 
         // copy coordinateSystem, but assign the name as the typeName
         // to avoid strange things in writeDict()
-        operator=(csLst[csId]);
+        operator=(lst[id]);
         name_ = typeName_();
     }
     else
diff --git a/src/meshTools/coordinateSystems/coordinateSystem.H b/src/meshTools/coordinateSystems/coordinateSystem.H
index e2a8f47affb10754916a6ad4504c1d754e039b9f..11a48d6eb772b7806c57281174ede70bf1a93f4b 100644
--- a/src/meshTools/coordinateSystems/coordinateSystem.H
+++ b/src/meshTools/coordinateSystems/coordinateSystem.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/meshTools/coordinateSystems/coordinateSystems.C b/src/meshTools/coordinateSystems/coordinateSystems.C
index 28632d0ae0aa1293eb128bc8688f9dd0bbac2052..4d829004081944a70489299514b6517118260a20 100644
--- a/src/meshTools/coordinateSystems/coordinateSystems.C
+++ b/src/meshTools/coordinateSystems/coordinateSystems.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -26,6 +26,7 @@ License
 #include "coordinateSystems.H"
 #include "IOPtrList.H"
 #include "Time.H"
+#include "stringListOps.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
@@ -97,13 +98,25 @@ const Foam::coordinateSystems& Foam::coordinateSystems::New
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-Foam::label Foam::coordinateSystems::find(const word& keyword) const
+Foam::label Foam::coordinateSystems::find(const keyType& key) const
 {
-    forAll(*this, i)
+    if (key.isPattern())
     {
-        if (keyword == operator[](i).name())
+        labelList allFound = findAll(key);
+        // return first element
+        if (!allFound.empty())
         {
-            return i;
+            return allFound[0];
+        }
+    }
+    else
+    {
+        forAll(*this, i)
+        {
+            if (key == operator[](i).name())
+            {
+                return i;
+            }
         }
     }
 
@@ -111,9 +124,34 @@ Foam::label Foam::coordinateSystems::find(const word& keyword) const
 }
 
 
-bool Foam::coordinateSystems::found(const word& keyword) const
+Foam::labelList Foam::coordinateSystems::findAll(const keyType& key) const
+{
+    labelList allFound;
+    if (key.isPattern())
+    {
+        allFound = findStrings(key, toc());
+    }
+    else
+    {
+        allFound.setSize(size());
+        label nFound = 0;
+        forAll(*this, i)
+        {
+            if (key == operator[](i).name())
+            {
+                allFound[nFound++] = i;
+            }
+        }
+        allFound.setSize(nFound);
+    }
+
+    return allFound;
+}
+
+
+bool Foam::coordinateSystems::found(const keyType& key) const
 {
-    return find(keyword) >= 0;
+    return find(key) >= 0;
 }
 
 
diff --git a/src/meshTools/coordinateSystems/coordinateSystems.H b/src/meshTools/coordinateSystems/coordinateSystems.H
index 60bd169ba0de9aa8407b1f1ada61b0639df4f2b6..2976a6f94efa48a726a39946bf87cb88843b12f0 100644
--- a/src/meshTools/coordinateSystems/coordinateSystems.H
+++ b/src/meshTools/coordinateSystems/coordinateSystems.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -97,11 +97,14 @@ public:
 
     // Member Functions
 
-        //- Find and return index for a given keyword, returns -1 if not found
-        label find(const word& key) const;
+        //- Find and return index for the first match, returns -1 if not found
+        label find(const keyType& key) const;
 
-        //- Search for given keyword
-        bool found(const word& keyword) const;
+        //- Find and return indices for all matches
+        labelList findAll(const keyType& key) const;
+
+        //- Search for given key
+        bool found(const keyType& key) const;
 
         //- Return the table of contents (list of all keywords)
         wordList toc() const;
diff --git a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C
index e5d6a0d71355a7ae077988bbccac92f536a092b1..f48abc08eb24e6bf75875766d6764ef18f3398bd 100644
--- a/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C
+++ b/src/meshTools/directMapped/directMappedPolyPatch/directMappedPatchBase.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -32,6 +32,9 @@ License
 #include "Random.H"
 #include "treeDataFace.H"
 #include "indexedOctree.H"
+#include "polyMesh.H"
+#include "polyPatch.H"
+#include "Time.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/src/meshTools/indexedOctree/indexedOctree.C b/src/meshTools/indexedOctree/indexedOctree.C
index e6b77b1d9d15e022e621fcd8194a3e0bffe4f64d..2f1e13648bca18f1bc684e5ea74e6ac74429b33a 100644
--- a/src/meshTools/indexedOctree/indexedOctree.C
+++ b/src/meshTools/indexedOctree/indexedOctree.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -1046,7 +1046,8 @@ Foam::point Foam::indexedOctree<Type>::pushPointIntoFace
 }
 
 
-//// Takes a bb and a point on the outside of the bb. Checks if on multiple faces
+//// Takes a bb and a point on the outside of the bb. Checks if on multiple
+// faces
 //// and if so perturbs point so it is only on one face.
 //template <class Type>
 //void Foam::indexedOctree<Type>::checkMultipleFaces
@@ -2495,6 +2496,59 @@ Foam::labelBits Foam::indexedOctree<Type>::findNode
 }
 
 
+template <class Type>
+Foam::label Foam::indexedOctree<Type>::findInside(const point& sample) const
+{
+    labelBits index = findNode(0, sample);
+
+    const node& nod = nodes_[getNode(index)];
+
+    labelBits contentIndex = nod.subNodes_[getOctant(index)];
+
+    // Need to check for the presence of content, in-case the node is empty
+    if (isContent(contentIndex))
+    {
+        labelList indices = contents_[getContent(contentIndex)];
+
+        forAll(indices, elemI)
+        {
+            label shapeI = indices[elemI];
+
+            if (shapes_.contains(shapeI, sample))
+            {
+                return shapeI;
+            }
+        }
+    }
+
+    return -1;
+}
+
+
+template <class Type>
+const Foam::labelList& Foam::indexedOctree<Type>::findIndices
+(
+    const point& sample
+) const
+{
+    labelBits index = findNode(0, sample);
+
+    const node& nod = nodes_[getNode(index)];
+
+    labelBits contentIndex = nod.subNodes_[getOctant(index)];
+
+    // Need to check for the presence of content, in-case the node is empty
+    if (isContent(contentIndex))
+    {
+        return contents_[getContent(contentIndex)];
+    }
+    else
+    {
+        return emptyList<label>();
+    }
+}
+
+
 // Determine type (inside/outside/mixed) per node.
 template <class Type>
 typename Foam::indexedOctree<Type>::volumeType
diff --git a/src/meshTools/indexedOctree/indexedOctree.H b/src/meshTools/indexedOctree/indexedOctree.H
index d72d8de4abb5d60f366e1f59cc53cb3949a9fbf5..6d7f42517693e59451720fe768eafb6a51ce463c 100644
--- a/src/meshTools/indexedOctree/indexedOctree.H
+++ b/src/meshTools/indexedOctree/indexedOctree.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -549,9 +549,16 @@ public:
 
             //- Find deepest node (as parent+octant) containing point. Starts
             //  off from starting index in nodes_ (use 0 to start from top)
-            //  Use getNode, getOctant to extract info.
+            //  Use getNode and getOctant to extract info, or call findIndices.
             labelBits findNode(const label nodeI, const point&) const;
 
+            //- Find shape containing point. Only implemented for certain
+            //  shapes.
+            label findInside(const point&) const;
+
+            //- Find the shape indices that occupy the result of findNode
+            const labelList& findIndices(const point&) const;
+
             //- Determine type (inside/outside/mixed) for point. unknown if
             //  cannot be determined (e.g. non-manifold surface)
             volumeType getVolumeType(const point&) const;
diff --git a/src/meshTools/indexedOctree/treeDataCell.C b/src/meshTools/indexedOctree/treeDataCell.C
index 7988d55301f90a9dcf50b945bd87f2aac20288dc..87b5dde12388bde1b1fa3c120c266792f8ed016f 100644
--- a/src/meshTools/indexedOctree/treeDataCell.C
+++ b/src/meshTools/indexedOctree/treeDataCell.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -145,6 +145,16 @@ bool Foam::treeDataCell::overlaps
 }
 
 
+bool Foam::treeDataCell::contains
+(
+    const label index,
+    const point& sample
+) const
+{
+    return mesh_.pointInCell(sample, cellLabels_[index]);
+}
+
+
 // Calculate nearest point to sample. Updates (if any) nearestDistSqr, minIndex,
 // nearestPoint.
 void Foam::treeDataCell::findNearest
diff --git a/src/meshTools/indexedOctree/treeDataCell.H b/src/meshTools/indexedOctree/treeDataCell.H
index f6371198a2bd89de07b8ab10dea3a184579c39a8..7e42a6d9066a3e0dcc4b092674d92c9620a5fb07 100644
--- a/src/meshTools/indexedOctree/treeDataCell.H
+++ b/src/meshTools/indexedOctree/treeDataCell.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -142,6 +142,13 @@ public:
                 const treeBoundBox& sampleBb
             ) const;
 
+            //- Does shape at index contain sample
+            bool contains
+            (
+                const label index,
+                const point& sample
+            ) const;
+
             //- Calculates nearest (to sample) point in shape.
             //  Returns actual point and distance (squared)
             void findNearest
diff --git a/src/meshTools/indexedOctree/treeDataEdge.H b/src/meshTools/indexedOctree/treeDataEdge.H
index 30ef2329bae6a0f30d88e17102d70681239e5b5a..68f3a5924a3602900dfd2fafd735c05b329ee453 100644
--- a/src/meshTools/indexedOctree/treeDataEdge.H
+++ b/src/meshTools/indexedOctree/treeDataEdge.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -103,6 +103,11 @@ public:
 
         // Access
 
+            const labelList& edgeLabels() const
+            {
+                return edgeLabels_;
+            }
+
             label size() const
             {
                 return edgeLabels_.size();
diff --git a/src/meshTools/meshSearch/meshSearch.C b/src/meshTools/meshSearch/meshSearch.C
index 4ae5ffc616e98af4193d215caff8233d67a523c3..84315fa869f3dac078da406da92f8380d1f9ddd8 100644
--- a/src/meshTools/meshSearch/meshSearch.C
+++ b/src/meshTools/meshSearch/meshSearch.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -99,7 +99,7 @@ bool Foam::meshSearch::findNearer
 // tree based searching
 Foam::label Foam::meshSearch::findNearestCellTree(const point& location) const
 {
-    const indexedOctree<treeDataPoint>& tree = cellCentreTree();
+    const indexedOctree<treeDataCell>& tree = cellTree();
 
     scalar span = tree.bb().mag();
 
@@ -176,7 +176,7 @@ Foam::label Foam::meshSearch::findNearestCellWalk
 Foam::label Foam::meshSearch::findNearestFaceTree(const point& location) const
 {
     // Search nearest cell centre.
-    const indexedOctree<treeDataPoint>& tree = cellCentreTree();
+    const indexedOctree<treeDataCell>& tree = cellTree();
 
     scalar span = tree.bb().mag();
 
@@ -320,6 +320,80 @@ Foam::label Foam::meshSearch::findCellLinear(const point& location) const
 }
 
 
+// walking from seed
+Foam::label Foam::meshSearch::findCellWalk
+(
+    const point& location,
+    const label seedCellI
+) const
+{
+    if (seedCellI < 0)
+    {
+        FatalErrorIn
+        (
+            "meshSearch::findCellWalk(const point&, const label)"
+        )   << "illegal seedCell:" << seedCellI << exit(FatalError);
+    }
+
+    if (pointInCell(location, seedCellI))
+    {
+        return seedCellI;
+    }
+
+    // Walk in direction of face that decreases distance
+    label curCellI = seedCellI;
+    scalar nearestDistSqr = magSqr(mesh_.cellCentres()[curCellI] - location);
+
+    while(true)
+    {
+        // Try neighbours of curCellI
+
+        const cell& cFaces = mesh_.cells()[curCellI];
+
+        label nearestCellI = -1;
+
+        forAll(cFaces, i)
+        {
+            label faceI = cFaces[i];
+
+            if (mesh_.isInternalFace(faceI))
+            {
+                label cellI = mesh_.faceOwner()[faceI];
+                if (cellI == curCellI)
+                {
+                    cellI = mesh_.faceNeighbour()[faceI];
+                }
+
+                // Check if this is the correct cell
+                if (pointInCell(location, cellI))
+                {
+                    return cellI;
+                }
+
+                // Also calculate the nearest cell
+                scalar distSqr = magSqr(mesh_.cellCentres()[cellI] - location);
+
+                if (distSqr < nearestDistSqr)
+                {
+                    nearestDistSqr = distSqr;
+                    nearestCellI = cellI;
+                }
+            }
+        }
+
+        if (nearestCellI == -1)
+        {
+            return -1;
+        }
+
+        // Continue with the nearest cell
+        curCellI = nearestCellI;
+    }
+
+    return -1;
+}
+
+
 Foam::label Foam::meshSearch::findNearestBoundaryFaceWalk
 (
     const point& location,
@@ -426,11 +500,7 @@ Foam::vector Foam::meshSearch::offset
 Foam::meshSearch::meshSearch(const polyMesh& mesh, const bool faceDecomp)
 :
     mesh_(mesh),
-    faceDecomp_(faceDecomp),
-    cloud_(mesh_, "meshSearchCloud", IDLList<passiveParticle>()),
-    boundaryTreePtr_(NULL),
-    cellTreePtr_(NULL),
-    cellCentreTreePtr_(NULL)
+    faceDecomp_(faceDecomp)
 {}
 
 
@@ -447,7 +517,7 @@ Foam::meshSearch::~meshSearch()
 const Foam::indexedOctree<Foam::treeDataFace>& Foam::meshSearch::boundaryTree()
  const
 {
-    if (!boundaryTreePtr_)
+    if (!boundaryTreePtr_.valid())
     {
         //
         // Construct tree
@@ -466,85 +536,59 @@ const Foam::indexedOctree<Foam::treeDataFace>& Foam::meshSearch::boundaryTree()
         overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
         overallBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
 
-        boundaryTreePtr_ = new indexedOctree<treeDataFace>
+        boundaryTreePtr_.reset
         (
-            treeDataFace    // all information needed to search faces
+            new indexedOctree<treeDataFace>
             (
-                false,                      // do not cache bb
-                mesh_,
-                bndFaces                    // boundary faces only
-            ),
-            overallBb,                      // overall search domain
-            8,                              // maxLevel
-            10,                             // leafsize
-            3.0                             // duplicity
+                treeDataFace    // all information needed to search faces
+                (
+                    false,                      // do not cache bb
+                    mesh_,
+                    bndFaces                    // boundary faces only
+                ),
+                overallBb,                      // overall search domain
+                8,                              // maxLevel
+                10,                             // leafsize
+                3.0                             // duplicity
+            )
         );
     }
 
-    return *boundaryTreePtr_;
+    return boundaryTreePtr_();
 }
 
 
 const Foam::indexedOctree<Foam::treeDataCell>& Foam::meshSearch::cellTree()
- const
+const
 {
-    if (!cellTreePtr_)
+    if (!cellTreePtr_.valid())
     {
-        //
-        // Construct tree
-        //
-
         treeBoundBox overallBb(mesh_.points());
-        Random rndGen(123456);
-        overallBb = overallBb.extend(rndGen, 1E-4);
-        overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
-        overallBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
-
-        cellTreePtr_ = new indexedOctree<treeDataCell>
-        (
-            treeDataCell
-            (
-                false,  // not cache bb
-                mesh_
-            ),
-            overallBb,  // overall search domain
-            8,      // maxLevel
-            10,     // leafsize
-            3.0     // duplicity
-        );
-    }
-
-    return *cellTreePtr_;
-
-}
 
+        Random rndGen(261782);
 
-const Foam::indexedOctree<Foam::treeDataPoint>&
- Foam::meshSearch::cellCentreTree() const
-{
-    if (!cellCentreTreePtr_)
-    {
-        //
-        // Construct tree
-        //
-
-        treeBoundBox overallBb(mesh_.cellCentres());
-        Random rndGen(123456);
         overallBb = overallBb.extend(rndGen, 1E-4);
         overallBb.min() -= point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
         overallBb.max() += point(ROOTVSMALL, ROOTVSMALL, ROOTVSMALL);
 
-        cellCentreTreePtr_ = new indexedOctree<treeDataPoint>
+        cellTreePtr_.reset
         (
-            treeDataPoint(mesh_.cellCentres()),
-            overallBb,  // overall search domain
-            10,         // max levels
-            10.0,       // maximum ratio of cubes v.s. cells
-            100.0       // max. duplicity; n/a since no bounding boxes.
+            new indexedOctree<treeDataCell>
+            (
+                treeDataCell
+                (
+                    false,  // not cache bb
+                    mesh_
+                ),
+                overallBb,
+                8,              // maxLevel
+                10,             // leafsize
+                3.0             // duplicity
+            )
         );
     }
 
-    return *cellCentreTreePtr_;
+    return cellTreePtr_();
 }
 
 
@@ -697,107 +741,21 @@ Foam::label Foam::meshSearch::findCell
 ) const
 {
     // Find the nearest cell centre to this location
-    label nearCellI = findNearestCell(location, seedCellI, useTreeSearch);
-
-    if (debug)
-    {
-        Pout<< "findCell : nearCellI:" << nearCellI
-            << " ctr:" << mesh_.cellCentres()[nearCellI]
-            << endl;
-    }
-
-    if (pointInCell(location, nearCellI))
-    {
-        return nearCellI;
-    }
-    else
+    if (seedCellI == -1)
     {
         if (useTreeSearch)
         {
-            // Start searching from cell centre of nearCell
-            point curPoint = mesh_.cellCentres()[nearCellI];
-
-            vector edgeVec = location - curPoint;
-            edgeVec /= mag(edgeVec);
-
-            do
-            {
-                // Walk neighbours (using tracking) to get closer
-                passiveParticle tracker(cloud_, curPoint, nearCellI);
-
-                if (debug)
-                {
-                    Pout<< "findCell : tracked from curPoint:" << curPoint
-                        << " nearCellI:" << nearCellI;
-                }
-
-                tracker.track(location);
-
-                if (debug)
-                {
-                    Pout<< " to " << tracker.position()
-                        << " need:" << location
-                        << " onB:" << tracker.onBoundary()
-                        << " cell:" << tracker.cell()
-                        << " face:" << tracker.face() << endl;
-                }
-
-                if (!tracker.onBoundary())
-                {
-                    // stopped not on boundary -> reached location
-                    return tracker.cell();
-                }
-
-                // stopped on boundary face. Compare positions
-                scalar typDim = sqrt(mag(mesh_.faceAreas()[tracker.face()]));
-
-                if ((mag(tracker.position() - location)/typDim) < SMALL)
-                {
-                    return tracker.cell();
-                }
-
-                // tracking stopped at boundary. Find next boundary
-                // intersection from current point (shifted out a little bit)
-                // in the direction of the destination
-
-                curPoint =
-                    tracker.position()
-                  + offset(tracker.position(), tracker.face(), edgeVec);
-
-                if (debug)
-                {
-                    Pout<< "Searching for next boundary from curPoint:"
-                        << curPoint
-                        << " to location:" << location  << endl;
-                }
-                pointIndexHit curHit = intersection(curPoint, location);
-                if (debug)
-                {
-                    Pout<< "Returned from line search with ";
-                    curHit.write(Pout);
-                    Pout<< endl;
-                }
-
-                if (!curHit.hit())
-                {
-                    return -1;
-                }
-                else
-                {
-                    nearCellI = mesh_.faceOwner()[curHit.index()];
-                    curPoint =
-                        curHit.hitPoint()
-                      + offset(curHit.hitPoint(), curHit.index(), edgeVec);
-                }
-            }
-            while (true);
+            return cellTree().findInside(location);
         }
         else
         {
              return findCellLinear(location);
         }
     }
-    return -1;
+    else
+    {
+        return findCellWalk(location, seedCellI);
+    }
 }
 
 
@@ -947,9 +905,8 @@ bool Foam::meshSearch::isInside(const point& p) const
 // Delete all storage
 void Foam::meshSearch::clearOut()
 {
-    deleteDemandDrivenData(boundaryTreePtr_);
-    deleteDemandDrivenData(cellTreePtr_);
-    deleteDemandDrivenData(cellCentreTreePtr_);
+    boundaryTreePtr_.clear();
+    cellTreePtr_.clear();
 }
 
 
diff --git a/src/meshTools/meshSearch/meshSearch.H b/src/meshTools/meshSearch/meshSearch.H
index dfaf71229b8546e37a303875eec7f38ce46e9c67..e39d2b75cd4e0980cbb28851cb51683f2a53258c 100644
--- a/src/meshTools/meshSearch/meshSearch.H
+++ b/src/meshTools/meshSearch/meshSearch.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -37,7 +37,7 @@ SourceFiles
 #define meshSearch_H
 
 #include "pointIndexHit.H"
-#include "passiveParticleCloud.H"
+#include "pointField.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -48,7 +48,6 @@ namespace Foam
 class polyMesh;
 class treeDataCell;
 class treeDataFace;
-class treeDataPoint;
 template<class Type> class indexedOctree;
 
 /*---------------------------------------------------------------------------*\
@@ -65,14 +64,10 @@ class meshSearch
         //- Whether to use face decomposition for all geometric tests
         const bool faceDecomp_;
 
-        //- Dummy cloud to put particles on for tracking.
-        passiveParticleCloud cloud_;
-
         //- demand driven octrees
 
-        mutable indexedOctree<treeDataFace>* boundaryTreePtr_;
-        mutable indexedOctree<treeDataCell>* cellTreePtr_;
-        mutable indexedOctree<treeDataPoint>* cellCentreTreePtr_;
+        mutable autoPtr<indexedOctree<treeDataFace> > boundaryTreePtr_;
+        mutable autoPtr<indexedOctree<treeDataCell> > cellTreePtr_;
 
 
     // Private Member Functions
@@ -112,8 +107,12 @@ class meshSearch
             //- cell containing location. Linear search.
             label findCellLinear(const point&) const;
 
+            //- walk from seed. Does not 'go around' boundary, just returns
+            //  last cell before boundary.
+            label findCellWalk(const point&, const label) const;
+
 
-        // Cells
+        // Faces
 
             label findNearestFaceTree(const point&) const;
 
@@ -188,9 +187,6 @@ public:
             //- Get (demand driven) reference to octree holding all cells
             const indexedOctree<treeDataCell>& cellTree() const;
 
-            //- Get (demand driven) reference to octree holding all cell centres
-            const indexedOctree<treeDataPoint>& cellCentreTree() const;
-
 
         // Queries
 
diff --git a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C
index cd7f0305dbf4ee4f361e7a90545fb5ee20b5ecae..f060a3f078c2b3c71093a2d3459eca78c7a2fd78 100644
--- a/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C
+++ b/src/meshTools/sets/cellSources/surfaceToCell/surfaceToCell.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -29,6 +29,7 @@ License
 #include "triSurface.H"
 #include "triSurfaceSearch.H"
 #include "cellClassification.H"
+#include "cpuTime.H"
 
 #include "addToRunTimeSelectionTable.H"
 
diff --git a/src/meshTools/sets/pointSources/surfaceToPoint/surfaceToPoint.C b/src/meshTools/sets/pointSources/surfaceToPoint/surfaceToPoint.C
index 173f771f73c3b8ecfe308e009487dfbe0f0e6a60..2dadffa9b16c9091988eba2304cb69db081655a2 100644
--- a/src/meshTools/sets/pointSources/surfaceToPoint/surfaceToPoint.C
+++ b/src/meshTools/sets/pointSources/surfaceToPoint/surfaceToPoint.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -27,6 +27,7 @@ License
 #include "polyMesh.H"
 #include "meshSearch.H"
 #include "triSurfaceSearch.H"
+#include "cpuTime.H"
 
 #include "addToRunTimeSelectionTable.H"
 
diff --git a/src/postProcessing/functionObjects/field/fieldMinMax/controlDict b/src/postProcessing/functionObjects/field/fieldMinMax/controlDict
index d90c5c84fe58b286da3eef8c644a1ba2303eb2cc..4a20373246be10ee96ebdfc2b60ad0add0112e09 100644
--- a/src/postProcessing/functionObjects/field/fieldMinMax/controlDict
+++ b/src/postProcessing/functionObjects/field/fieldMinMax/controlDict
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.6                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
diff --git a/src/sampling/sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C b/src/sampling/sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C
index 7cfa11de2180d0a6dfa69155aeb355869c90d90a..ebf4a7978c0f8255520cb43a1026c074058b985d 100644
--- a/src/sampling/sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C
+++ b/src/sampling/sampledSet/triSurfaceMeshPointSet/triSurfaceMeshPointSet.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -29,6 +29,7 @@ License
 #include "polyMesh.H"
 #include "addToRunTimeSelectionTable.H"
 #include "triSurfaceMesh.H"
+#include "Time.H"
 
 // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
 
diff --git a/src/sampling/sampledSurface/sampledPlane/sampledPlane.H b/src/sampling/sampledSurface/sampledPlane/sampledPlane.H
index 5142c63143965e4308ffb5cc557b8bc8b27e6689..0262860a945acbc8f98abf8190f3619cac3a4b3e 100644
--- a/src/sampling/sampledSurface/sampledPlane/sampledPlane.H
+++ b/src/sampling/sampledSurface/sampledPlane/sampledPlane.H
@@ -27,7 +27,8 @@ Class
 Description
     A sampledSurface defined by a cuttingPlane. Always triangulated.
 
-    Note: does not actually cut until update() called.
+Note
+    Does not actually cut until update() called.
 
 SourceFiles
     sampledPlane.C
diff --git a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C
index 2619818647b1db6a811f0e25e319e3fda856f8b9..fc5c31911e851d4b347b4c7d379f484077a9cb9d 100644
--- a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C
+++ b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C
@@ -28,6 +28,7 @@ License
 #include "meshSearch.H"
 #include "Tuple2.H"
 #include "globalIndex.H"
+#include "treeDataCell.H"
 
 #include "addToRunTimeSelectionTable.H"
 
@@ -166,8 +167,7 @@ bool Foam::sampledTriSurfaceMesh::update()
 
     meshSearch meshSearcher(mesh(), false);
 
-    const indexedOctree<treeDataPoint>& cellCentreTree =
-        meshSearcher.cellCentreTree();
+    const indexedOctree<treeDataCell>& cellTree = meshSearcher.cellTree();
 
 
     // Global numbering for cells - only used to uniquely identify local cells.
@@ -182,7 +182,7 @@ bool Foam::sampledTriSurfaceMesh::update()
     // Search triangles using nearest on local mesh
     forAll(fc, triI)
     {
-        pointIndexHit nearInfo = cellCentreTree.findNearest
+        pointIndexHit nearInfo = cellTree.findNearest
         (
             fc[triI],
             sqr(GREAT)
diff --git a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C
index 77ea290e62f1ee8f495a3e6dd9025e7b7764b1ab..0de4b2162a646aa05de1a04ae9bceead6554ca68 100644
--- a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C
+++ b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C
@@ -57,7 +57,7 @@ makeBasicMixture
 (
     pureMixture,
     constTransport,
-    hConstThermo,
+    eConstThermo,
     perfectGas
 );
 
@@ -65,15 +65,16 @@ makeBasicMixture
 (
     pureMixture,
     sutherlandTransport,
-    hConstThermo,
+    eConstThermo,
     perfectGas
 );
 
+
 makeBasicMixture
 (
     pureMixture,
     constTransport,
-    eConstThermo,
+    hConstThermo,
     perfectGas
 );
 
@@ -81,7 +82,7 @@ makeBasicMixture
 (
     pureMixture,
     sutherlandTransport,
-    eConstThermo,
+    hConstThermo,
     perfectGas
 );
 
diff --git a/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermos.C b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermos.C
index 156de029b01fdc7fe50cf828b2ccdb7f33901dfe..fc39529ff563990c1cbe5aae875ff93f806ecbd4 100644
--- a/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermos.C
+++ b/src/thermophysicalModels/basic/psiThermo/ePsiThermo/ePsiThermos.C
@@ -63,6 +63,7 @@ makeBasicPsiThermo
     perfectGas
 );
 
+
 makeBasicPsiThermo
 (
     ePsiThermo,
diff --git a/src/thermophysicalModels/basicSolidThermo/Make/files b/src/thermophysicalModels/basicSolidThermo/Make/files
index f7f64d01d21c1bd4184502453288301f27abbfd0..e550ce20352aba5e8072c26af063a839b4c53f8b 100644
--- a/src/thermophysicalModels/basicSolidThermo/Make/files
+++ b/src/thermophysicalModels/basicSolidThermo/Make/files
@@ -1,7 +1,7 @@
 constSolidThermo/constSolidThermo.C
 directionalSolidThermo/directionalSolidThermo.C
 basicSolidThermo/basicSolidThermo.C
-basicSolidThermo/newBasicSolidThermo.C
+basicSolidThermo/basicSolidThermoNew.C
 interpolatedSolidThermo/interpolatedSolidThermo.C
 
 LIB = $(FOAM_LIBBIN)/libbasicSolidThermo
diff --git a/src/thermophysicalModels/basicSolidThermo/basicSolidThermo/newBasicSolidThermo.C b/src/thermophysicalModels/basicSolidThermo/basicSolidThermo/basicSolidThermoNew.C
similarity index 100%
rename from src/thermophysicalModels/basicSolidThermo/basicSolidThermo/newBasicSolidThermo.C
rename to src/thermophysicalModels/basicSolidThermo/basicSolidThermo/basicSolidThermoNew.C
diff --git a/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermos.C b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermos.C
index 6e6cef2959ea5998d6ca36c09beccfc5ef42fd01..419e000f9bd13669b84ec5687511fca137b2bfed 100644
--- a/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermos.C
+++ b/src/thermophysicalModels/reactionThermo/combustionThermo/hCombustionThermo/hCombustionThermos.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -53,6 +53,8 @@ namespace Foam
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
+// constTransport, hConstThermo
+
 makeCombustionThermo
 (
     hCombustionThermo,
@@ -83,6 +85,42 @@ makeCombustionThermo
     perfectGas
 );
 
+
+// sutherlandTransport, hConstThermo
+
+makeCombustionThermo
+(
+    hCombustionThermo,
+    hPsiMixtureThermo,
+    homogeneousMixture,
+    sutherlandTransport,
+    hConstThermo,
+    perfectGas
+);
+
+makeCombustionThermo
+(
+    hCombustionThermo,
+    hPsiMixtureThermo,
+    inhomogeneousMixture,
+    sutherlandTransport,
+    hConstThermo,
+    perfectGas
+);
+
+makeCombustionThermo
+(
+    hCombustionThermo,
+    hPsiMixtureThermo,
+    veryInhomogeneousMixture,
+    sutherlandTransport,
+    hConstThermo,
+    perfectGas
+);
+
+
+// sutherlandTransport, janafThermo
+
 makeCombustionThermo
 (
     hCombustionThermo,
@@ -113,6 +151,7 @@ makeCombustionThermo
     perfectGas
 );
 
+
 makeCombustionThermo
 (
     hCombustionThermo,
diff --git a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.C b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.C
index 322260c6439980cb193434b76b405d9c4d47e0ec..df6a32d84b65cbda8d872056cdf78890bbdcb049 100644
--- a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.C
+++ b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -32,12 +32,12 @@ License
 
 Foam::thermalPorousZone::thermalPorousZone
 (
-    const word& name,
+    const keyType& key,
     const fvMesh& mesh,
     const dictionary& dict
 )
 :
-    porousZone(name, mesh, dict),
+    porousZone(key, mesh, dict),
     T_("T", dimTemperature, -GREAT)
 {
     if (const dictionary* dictPtr = dict.subDictPtr("thermalModel"))
@@ -53,11 +53,7 @@ Foam::thermalPorousZone::thermalPorousZone
             FatalIOErrorIn
             (
                 "thermalPorousZone::thermalPorousZone"
-                "("
-                    "const word& name, "
-                    "const fvMesh& mesh, "
-                    "const dictionary& dict"
-                ")",
+                "(const keyType&, const fvMesh&, const dictionary&)",
                 *dictPtr
             )   << "thermalModel " << thermalModel << " is not supported" << nl
                 << "    Supported thermalModels are: fixedTemperature"
@@ -76,23 +72,28 @@ void Foam::thermalPorousZone::addEnthalpySource
     fvScalarMatrix& hEqn
 ) const
 {
-    if (zoneId() == -1 || T_.value() < 0.0)
+    const labelList& zones = this->zoneIds();
+    if (zones.empty() || T_.value() < 0.0)
     {
         return;
     }
 
-    const labelList& cells = mesh().cellZones()[zoneId()];
     const scalarField& V = mesh().V();
     scalarField& hDiag = hEqn.diag();
     scalarField& hSource = hEqn.source();
 
-    scalarField hZone = thermo.h(scalarField(cells.size(), T_.value()), cells);
-    scalar rate = 1e6;
+    // TODO: generalize for non-fixedTemperature methods
+    const scalar rate = 1e6;
 
-    forAll(cells, i)
+    forAll(zones, zoneI)
     {
-        hDiag[cells[i]] += rate*V[cells[i]]*rho[cells[i]];
-        hSource[cells[i]] += rate*V[cells[i]]*rho[cells[i]]*hZone[i];
+        const labelList& cells = mesh().cellZones()[zones[zoneI]];
+
+        forAll(cells, i)
+        {
+            hDiag[cells[i]] += rate*V[cells[i]]*rho[cells[i]];
+            hSource[cells[i]] += rate*V[cells[i]]*rho[cells[i]]*T_.value();
+        }
     }
 }
 
diff --git a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.H b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.H
index f3cf5b339665ae889d4500ed6b058120eff4d0d4..7278f4ec980fc6f6f9d9280a26f2e87346c67438 100644
--- a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.H
+++ b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZone.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -33,7 +33,6 @@ See Also
 
 SourceFiles
     thermalPorousZone.C
-    thermalPorousZoneTemplates.C
 
 \*---------------------------------------------------------------------------*/
 
@@ -76,7 +75,7 @@ public:
     // Constructors
 
         //- Construct from components
-        thermalPorousZone(const word& name, const fvMesh&, const dictionary&);
+        thermalPorousZone(const keyType& key, const fvMesh&, const dictionary&);
 
         //- Return clone
         autoPtr<thermalPorousZone> clone() const
@@ -101,12 +100,12 @@ public:
 
             autoPtr<thermalPorousZone> operator()(Istream& is) const
             {
-                word name(is);
+                keyType key(is);
                 dictionary dict(is);
 
                 return autoPtr<thermalPorousZone>
                 (
-                    new thermalPorousZone(name, mesh_, dict)
+                    new thermalPorousZone(key, mesh_, dict)
                 );
             }
         };
@@ -149,12 +148,6 @@ public:
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
-#ifdef NoRepository
-//#   include "thermalPorousZoneTemplates.C"
-#endif
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
 #endif
 
 // ************************************************************************* //
diff --git a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZoneTemplates.C b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZoneTemplates.C
deleted file mode 100644
index 261abb18e958ccc160b67f5c73116a3e6a221a96..0000000000000000000000000000000000000000
--- a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZoneTemplates.C
+++ /dev/null
@@ -1,79 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-\*----------------------------------------------------------------------------*/
-
-#include "porousZone.H"
-#include "fvMesh.H"
-
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
-
-template<class RhoFieldType>
-void Foam::porousZone::addPowerLawResistance
-(
-    scalarField& Udiag,
-    const labelList& cells,
-    const scalarField& V,
-    const RhoFieldType& rho,
-    const vectorField& U
-) const
-{
-    const scalar C0 = C0_;
-    const scalar C1m1b2 = (C1_ - 1.0)/2.0;
-
-    forAll(cells, i)
-    {
-        Udiag[cells[i]] +=
-            V[cells[i]]*rho[cells[i]]*C0*pow(magSqr(U[cells[i]]), C1m1b2);
-    }
-}
-
-
-template<class RhoFieldType>
-void Foam::porousZone::addViscousInertialResistance
-(
-    scalarField& Udiag,
-    vectorField& Usource,
-    const labelList& cells,
-    const scalarField& V,
-    const RhoFieldType& rho,
-    const scalarField& mu,
-    const vectorField& U
-) const
-{
-    const tensor& D = D_.value();
-    const tensor& F = F_.value();
-
-    forAll(cells, i)
-    {
-        tensor dragCoeff = mu[cells[i]]*D + (rho[cells[i]]*mag(U[cells[i]]))*F;
-        scalar isoDragCoeff = tr(dragCoeff);
-
-        Udiag[cells[i]] += V[cells[i]]*isoDragCoeff;
-        Usource[cells[i]] -=
-            V[cells[i]]*((dragCoeff - I*isoDragCoeff) & U[cells[i]]);
-    }
-}
-
-
-// ************************************************************************* //
diff --git a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.C b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.C
index a98b0e064ccb8f79024d0bd607b8c9cd9daaf2a2..c35bd5c0dd6d273d22a162331acd596e170bb626 100644
--- a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.C
+++ b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
diff --git a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.H b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.H
index e696f2bb5b4aa7a18629ddcf25395c0c71315e9e..5d72c6f90e37524a521a24223e732f7100c96125 100644
--- a/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.H
+++ b/src/thermophysicalModels/thermalPorousZone/thermalPorousZone/thermalPorousZones.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -46,7 +46,11 @@ Description
             d   d [0 -2 0 0 0]  (-1000 -1000 0.50753e+08);
             f   f [0 -1 0 0 0]  (-1000 -1000 12.83);
         }
-        Temperature [0 0 1 0 0] 600;
+        thermalModel
+        {
+            type    fixedTemperature;
+            T       T [0 0 1 0 0] 600;
+        }
     }
     )
     @endverbatim
@@ -69,7 +73,7 @@ namespace Foam
 {
 
 /*---------------------------------------------------------------------------*\
-                           Class thermalPorousZones Declaration
+                     Class thermalPorousZones Declaration
 \*---------------------------------------------------------------------------*/
 
 class thermalPorousZones
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties
index c27f08c9f16e4ab325456ceee37ca55ece67442e..6afd8ebe64622b34804728109e2644ee4a2b0cc8 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.6                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
@@ -57,7 +57,7 @@ directionalSolidThermoCoeffs
     cpValues            (1700 1700);
 
     KValues             ((40 40 40) (40 40 40));
-    
+
     coordinateSystem
     {
         origin  (-0.000062 0.000019 0.000039);
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/heater/solidThermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/heater/solidThermophysicalProperties
index c27f08c9f16e4ab325456ceee37ca55ece67442e..6afd8ebe64622b34804728109e2644ee4a2b0cc8 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/heater/solidThermophysicalProperties
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/heater/solidThermophysicalProperties
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.6                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
@@ -57,7 +57,7 @@ directionalSolidThermoCoeffs
     cpValues            (1700 1700);
 
     KValues             ((40 40 40) (40 40 40));
-    
+
     coordinateSystem
     {
         origin  (-0.000062 0.000019 0.000039);
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/leftSolid/solidThermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/leftSolid/solidThermophysicalProperties
index c27f08c9f16e4ab325456ceee37ca55ece67442e..6afd8ebe64622b34804728109e2644ee4a2b0cc8 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/leftSolid/solidThermophysicalProperties
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/leftSolid/solidThermophysicalProperties
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.6                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
@@ -57,7 +57,7 @@ directionalSolidThermoCoeffs
     cpValues            (1700 1700);
 
     KValues             ((40 40 40) (40 40 40));
-    
+
     coordinateSystem
     {
         origin  (-0.000062 0.000019 0.000039);
diff --git a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/rightSolid/solidThermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/rightSolid/solidThermophysicalProperties
index c27f08c9f16e4ab325456ceee37ca55ece67442e..6afd8ebe64622b34804728109e2644ee4a2b0cc8 100644
--- a/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/rightSolid/solidThermophysicalProperties
+++ b/tutorials/heatTransfer/chtMultiRegionFoam/snappyMultiRegionHeater/constant/rightSolid/solidThermophysicalProperties
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.6                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
@@ -57,7 +57,7 @@ directionalSolidThermoCoeffs
     cpValues            (1700 1700);
 
     KValues             ((40 40 40) (40 40 40));
-    
+
     coordinateSystem
     {
         origin  (-0.000062 0.000019 0.000039);
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties
index c27f08c9f16e4ab325456ceee37ca55ece67442e..6afd8ebe64622b34804728109e2644ee4a2b0cc8 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/heater/solidThermophysicalProperties
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.6                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
@@ -57,7 +57,7 @@ directionalSolidThermoCoeffs
     cpValues            (1700 1700);
 
     KValues             ((40 40 40) (40 40 40));
-    
+
     coordinateSystem
     {
         origin  (-0.000062 0.000019 0.000039);
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/leftSolid/solidThermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/leftSolid/solidThermophysicalProperties
index c27f08c9f16e4ab325456ceee37ca55ece67442e..6afd8ebe64622b34804728109e2644ee4a2b0cc8 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/leftSolid/solidThermophysicalProperties
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/leftSolid/solidThermophysicalProperties
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.6                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
@@ -57,7 +57,7 @@ directionalSolidThermoCoeffs
     cpValues            (1700 1700);
 
     KValues             ((40 40 40) (40 40 40));
-    
+
     coordinateSystem
     {
         origin  (-0.000062 0.000019 0.000039);
diff --git a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/rightSolid/solidThermophysicalProperties b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/rightSolid/solidThermophysicalProperties
index c27f08c9f16e4ab325456ceee37ca55ece67442e..b301ae2e0d1b649ba9cb186a8567b63607646de8 100644
--- a/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/rightSolid/solidThermophysicalProperties
+++ b/tutorials/heatTransfer/chtMultiRegionSimpleFoam/multiRegionHeater/constant/rightSolid/solidThermophysicalProperties
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.6                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/U b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/U
index 806874149edb5b2071ae742090816e34cf5a575c..f23d0ce783e8acb8f889a028d5fc023111649420 100644
--- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/U
+++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/U
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.7                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/epsilon b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/epsilon
index 0663cafd8c7caa3fb0774cd4744e53e27d1d2158..a49793464ea592df2b65cbf0d686c9b488707eab 100644
--- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/epsilon
+++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/epsilon
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.7                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/include/ABLConditions b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/include/ABLConditions
index 7a66146f6762692fc120100d534cdbeb5d5317ad..ce4fb2091855149619ff12eb75abf30dc35d201b 100644
--- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/include/ABLConditions
+++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/include/ABLConditions
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.7                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 
diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/include/initialConditions b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/include/initialConditions
index b7847f97cf1e2cb853217522c14fd4c5a4a65473..f38c46f61ac2532bae719c9efeeb7c212c4151ec 100644
--- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/include/initialConditions
+++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/include/initialConditions
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.7                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 
diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/k b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/k
index 54ed104991c537ab16d47d2e519fa34da159d66b..b42f64236c9fe2dfc8beb2ed5fb84c758366a811 100644
--- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/k
+++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/0/k
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.7                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/polyMesh/blockMeshDict b/tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/polyMesh/blockMeshDict
index 17849fcf9975f92e9967b57b05355f3bf2cb99c0..99d86d5d233acdfd1e807431195e60083ced862a 100644
--- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/polyMesh/blockMeshDict
+++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/polyMesh/blockMeshDict
@@ -1,11 +1,10 @@
-/*---------------------------------------------------------------------------*\
+/*--------------------------------*- C++ -*----------------------------------*\
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.6                                   |
-|   \\  /    A nd           | Web:      http://www.openfoam.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
-
 FoamFile
 {
     version         2.0;
diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/polyMesh/boundary b/tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/polyMesh/boundary
index 0ae74fcca85aa00d5570883a4201b99105eb6001..e47d69bab0815d689b4ad7ddf7ba514d0395757c 100644
--- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/polyMesh/boundary
+++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/polyMesh/boundary
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/sourcesProperties b/tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/sourcesProperties
index 0b880a857149d2b22fdaa163d989c55a406f0faa..90b086769aa416a30f27e32c1cc9415f9d602513 100644
--- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/sourcesProperties
+++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/sourcesProperties
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.7                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/transportProperties b/tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/transportProperties
index a9799687c1e962f4cbf16888814b0232f9c73890..6b86c0cf8f957da0fc87047cf7db1639e005bbff 100644
--- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/transportProperties
+++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/constant/transportProperties
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.7                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/controlDict b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/controlDict
index 654f1c98897ff1aa6e0effa1efff3abdfcb11f41..e4c516e48e8008cd3806f8e80aaf4e715a5f385f 100644
--- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/controlDict
+++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/controlDict
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.7                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/fvSchemes b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/fvSchemes
index 60d14bfab4b07b56238ac85ba9d1021f5da5b6a8..30ee3b82f49ff82ba3e0560ea7bff1366ff233fe 100644
--- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/fvSchemes
+++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/fvSchemes
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.7                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/fvSolution b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/fvSolution
index ed73a38677bd807aa8b0cb7469337e24f6c56877..948be6e57aeb05bde0e2211644c323d4b00a6ede 100644
--- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/fvSolution
+++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/fvSolution
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.7                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
diff --git a/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/snappyHexMeshDict b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/snappyHexMeshDict
index 66e1715156c78d6bfb045b7bfd6ac0fb33180da4..2d64f746344793486c1bf0d6385f29edd6794973 100644
--- a/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/snappyHexMeshDict
+++ b/tutorials/incompressible/simpleFoam/windTurbineTerrain/system/snappyHexMeshDict
@@ -2,7 +2,7 @@
 | =========                 |                                                 |
 | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
 |  \\    /   O peration     | Version:  1.7                                   |
-|   \\  /    A nd           | Web:      http://www.OpenFOAM.org               |
+|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
 |    \\/     M anipulation  |                                                 |
 \*---------------------------------------------------------------------------*/
 FoamFile
diff --git a/wmake/rules/SiCortex64Gcc/general b/wmake/rules/SiCortex64Gcc/general
index eb820ab36dcb8239b2ced6df5fb78393810645dc..aeab411b5b4f55648bc88bd3fd0a22c6e4378abd 100644
--- a/wmake/rules/SiCortex64Gcc/general
+++ b/wmake/rules/SiCortex64Gcc/general
@@ -1,3 +1,4 @@
+CPP        = cpp -traditional-cpp $(GFLAGS)
 LD         = ld -A64
 
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
diff --git a/wmake/rules/linux64Gcc/general b/wmake/rules/linux64Gcc/general
index e7faa0c0f2019de8ef82545820d26f5b4787e460..809751cd0afab5ce33a04b3c72e266b16b7cc267 100644
--- a/wmake/rules/linux64Gcc/general
+++ b/wmake/rules/linux64Gcc/general
@@ -1,3 +1,5 @@
+CPP        = cpp -traditional-cpp $(GFLAGS)
+
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
 
 include $(GENERAL_RULES)/standard
diff --git a/wmake/rules/linux64Gcc43/general b/wmake/rules/linux64Gcc43/general
index e7faa0c0f2019de8ef82545820d26f5b4787e460..809751cd0afab5ce33a04b3c72e266b16b7cc267 100644
--- a/wmake/rules/linux64Gcc43/general
+++ b/wmake/rules/linux64Gcc43/general
@@ -1,3 +1,5 @@
+CPP        = cpp -traditional-cpp $(GFLAGS)
+
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
 
 include $(GENERAL_RULES)/standard
diff --git a/wmake/rules/linux64Gcc44/general b/wmake/rules/linux64Gcc44/general
index e7faa0c0f2019de8ef82545820d26f5b4787e460..809751cd0afab5ce33a04b3c72e266b16b7cc267 100644
--- a/wmake/rules/linux64Gcc44/general
+++ b/wmake/rules/linux64Gcc44/general
@@ -1,3 +1,5 @@
+CPP        = cpp -traditional-cpp $(GFLAGS)
+
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
 
 include $(GENERAL_RULES)/standard
diff --git a/wmake/rules/linux64Gcc45/general b/wmake/rules/linux64Gcc45/general
index f9bb2e6b1e5263d0b8c898a72ba3ade1e3e66a9a..fcd79624e9a80bbf60ff30384dacb7650e6afccf 100644
--- a/wmake/rules/linux64Gcc45/general
+++ b/wmake/rules/linux64Gcc45/general
@@ -1,4 +1,3 @@
-# need single-line output from cpp
 CPP        = cpp -traditional-cpp
 
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
diff --git a/wmake/rules/linux64Icc/general b/wmake/rules/linux64Icc/general
index e7faa0c0f2019de8ef82545820d26f5b4787e460..4f411aec989330f96ea47be5eccfa01f5273967b 100644
--- a/wmake/rules/linux64Icc/general
+++ b/wmake/rules/linux64Icc/general
@@ -1,3 +1,5 @@
+CPP        = /lib/cpp -traditional-cpp $(GFLAGS)
+
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
 
 include $(GENERAL_RULES)/standard
diff --git a/wmake/rules/linuxGcc/general b/wmake/rules/linuxGcc/general
index ce84842fee3e8cf5493ae29693e0391613115cb8..97ce8c940c5b38bfcf1ec91f9399bfc3561d13b5 100644
--- a/wmake/rules/linuxGcc/general
+++ b/wmake/rules/linuxGcc/general
@@ -1,3 +1,4 @@
+CPP        = cpp -traditional-cpp $(GFLAGS)
 LD         = ld -melf_i386
 
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
diff --git a/wmake/rules/linuxGcc43/general b/wmake/rules/linuxGcc43/general
index ce84842fee3e8cf5493ae29693e0391613115cb8..97ce8c940c5b38bfcf1ec91f9399bfc3561d13b5 100644
--- a/wmake/rules/linuxGcc43/general
+++ b/wmake/rules/linuxGcc43/general
@@ -1,3 +1,4 @@
+CPP        = cpp -traditional-cpp $(GFLAGS)
 LD         = ld -melf_i386
 
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
diff --git a/wmake/rules/linuxGcc44/general b/wmake/rules/linuxGcc44/general
index ce84842fee3e8cf5493ae29693e0391613115cb8..97ce8c940c5b38bfcf1ec91f9399bfc3561d13b5 100644
--- a/wmake/rules/linuxGcc44/general
+++ b/wmake/rules/linuxGcc44/general
@@ -1,3 +1,4 @@
+CPP        = cpp -traditional-cpp $(GFLAGS)
 LD         = ld -melf_i386
 
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
diff --git a/wmake/rules/linuxGcc45/general b/wmake/rules/linuxGcc45/general
index 91c54db85d6abfe3914892c18e54146370d9a9d4..fdd03dc9a50b9590d2cb4821ae4e3e4e106858a4 100644
--- a/wmake/rules/linuxGcc45/general
+++ b/wmake/rules/linuxGcc45/general
@@ -1,4 +1,3 @@
-# need single-line output from cpp
 CPP        = cpp -traditional-cpp
 LD         = ld -melf_i386
 
diff --git a/wmake/rules/linuxIA64Gcc/general b/wmake/rules/linuxIA64Gcc/general
index 7285501d981c0bd3c55ca4134d0457d0fca23239..44c2e33667bcdd72fdbc7ccc2a2aee2a6d432cc5 100644
--- a/wmake/rules/linuxIA64Gcc/general
+++ b/wmake/rules/linuxIA64Gcc/general
@@ -1,3 +1,4 @@
+CPP        = cpp -traditional-cpp $(GFLAGS)
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
 
 include $(GENERAL_RULES)/standard
diff --git a/wmake/rules/linuxIA64Icc/general b/wmake/rules/linuxIA64Icc/general
index 66953a96525da7764520e91af5771154c97cd1ac..748cfe770d5dda60224f9a6da477b837cdf182f0 100644
--- a/wmake/rules/linuxIA64Icc/general
+++ b/wmake/rules/linuxIA64Icc/general
@@ -1,4 +1,4 @@
-CPP        = cpp -DICC_IA64_PREFETCH
+CPP        = /lib/cpp -traditional-cpp $(GFLAGS) -DICC_IA64_PREFETCH
 
 GLIBS      = -liberty
 
diff --git a/wmake/rules/linuxIcc/general b/wmake/rules/linuxIcc/general
index ce84842fee3e8cf5493ae29693e0391613115cb8..e4d0cb7d7bde0d7c97d1877312285088148f7773 100644
--- a/wmake/rules/linuxIcc/general
+++ b/wmake/rules/linuxIcc/general
@@ -1,3 +1,4 @@
+CPP        = /lib/cpp -traditional-cpp $(GFLAGS)
 LD         = ld -melf_i386
 
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
diff --git a/wmake/rules/linuxPPC64Gcc/general b/wmake/rules/linuxPPC64Gcc/general
index 81927e682b5ace461356fb95c0dbbe661cf311fb..ad4126abe80df9f7b7f8699d17ee5f9a0a280959 100644
--- a/wmake/rules/linuxPPC64Gcc/general
+++ b/wmake/rules/linuxPPC64Gcc/general
@@ -1,3 +1,4 @@
+CPP        = cpp -traditional-cpp $(GFLAGS)
 LD         = ld -m elf64ppc
 
 PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl