diff --git a/applications/test/memInfo/Make/files b/applications/test/memInfo/Make/files
new file mode 100644
index 0000000000000000000000000000000000000000..c42564e8fc69cca6781dae6ff6b15ff0d28197e2
--- /dev/null
+++ b/applications/test/memInfo/Make/files
@@ -0,0 +1,3 @@
+memInfo.C
+
+EXE = $(FOAM_USER_APPBIN)/memInfo
diff --git a/applications/test/memInfo/Make/options b/applications/test/memInfo/Make/options
new file mode 100644
index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
diff --git a/applications/test/memInfo/memInfo.C b/applications/test/memInfo/memInfo.C
new file mode 100644
index 0000000000000000000000000000000000000000..fb20be6d8d8adb10e13b0e5701fa056042db22d8
--- /dev/null
+++ b/applications/test/memInfo/memInfo.C
@@ -0,0 +1,19 @@
+#include "memInfo.H"
+#include "IOstreams.H"
+#include "List.H"
+#include "vector.H"
+
+using namespace Foam;
+
+int main()
+{
+    memInfo m;
+
+    Info<< m << endl;
+
+    List<vector> l(10000000, vector::one);
+
+    Info<< m.update() << endl;
+
+    return 0;
+}
diff --git a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
index 559bb4a7155664a8be5fde569731603f1a69fe71..8d0867f0edb4320278e8000ede3d3da7cb7ef73c 100644
--- a/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
+++ b/applications/utilities/parallelProcessing/reconstructPar/reconstructPar.C
@@ -56,6 +56,14 @@ int main(int argc, char *argv[])
         "specify a list of fields to be reconstructed. Eg, '(U T p)' - "
         "regular expressions not currently supported"
     );
+    argList::addOption
+    (
+        "lagrangianFields",
+        "list",
+        "specify a list of lagrangian fields to be reconstructed. Eg, '(U d)' -"
+        "regular expressions not currently supported, "
+        "positions always included."
+    );
     argList::addBoolOption
     (
         "noLagrangian",
@@ -73,6 +81,20 @@ int main(int argc, char *argv[])
 
     const bool noLagrangian = args.optionFound("noLagrangian");
 
+    HashSet<word> selectedLagrangianFields;
+    if (args.optionFound("lagrangianFields"))
+    {
+        if (noLagrangian)
+        {
+            FatalErrorIn(args.executable())
+                << "Cannot specify noLagrangian and lagrangianFields "
+                << "options together."
+                << exit(FatalError);
+        }
+
+        args.optionLookup("lagrangianFields")() >> selectedLagrangianFields;
+    }
+
     // determine the processor count directly
     label nProcs = 0;
     while (isDir(args.path()/(word("processor") + name(nProcs))))
@@ -403,84 +425,96 @@ int main(int argc, char *argv[])
                         cloudName,
                         mesh,
                         procMeshes.meshes(),
-                        sprayObjs
+                        sprayObjs,
+                        selectedLagrangianFields
                     );
                     reconstructLagrangianFieldFields<label>
                     (
                         cloudName,
                         mesh,
                         procMeshes.meshes(),
-                        sprayObjs
+                        sprayObjs,
+                        selectedLagrangianFields
                     );
                     reconstructLagrangianFields<scalar>
                     (
                         cloudName,
                         mesh,
                         procMeshes.meshes(),
-                        sprayObjs
+                        sprayObjs,
+                        selectedLagrangianFields
                     );
                     reconstructLagrangianFieldFields<scalar>
                     (
                         cloudName,
                         mesh,
                         procMeshes.meshes(),
-                        sprayObjs
+                        sprayObjs,
+                        selectedLagrangianFields
                     );
                     reconstructLagrangianFields<vector>
                     (
                         cloudName,
                         mesh,
                         procMeshes.meshes(),
-                        sprayObjs
+                        sprayObjs,
+                        selectedLagrangianFields
                     );
                     reconstructLagrangianFieldFields<vector>
                     (
                         cloudName,
                         mesh,
                         procMeshes.meshes(),
-                        sprayObjs
+                        sprayObjs,
+                        selectedLagrangianFields
                     );
                     reconstructLagrangianFields<sphericalTensor>
                     (
                         cloudName,
                         mesh,
                         procMeshes.meshes(),
-                        sprayObjs
+                        sprayObjs,
+                        selectedLagrangianFields
                     );
                     reconstructLagrangianFieldFields<sphericalTensor>
                     (
                         cloudName,
                         mesh,
                         procMeshes.meshes(),
-                        sprayObjs
+                        sprayObjs,
+                        selectedLagrangianFields
                     );
                     reconstructLagrangianFields<symmTensor>
                     (
                         cloudName,
                         mesh,
                         procMeshes.meshes(),
-                        sprayObjs
+                        sprayObjs,
+                        selectedLagrangianFields
                     );
                     reconstructLagrangianFieldFields<symmTensor>
                     (
                         cloudName,
                         mesh,
                         procMeshes.meshes(),
-                        sprayObjs
+                        sprayObjs,
+                        selectedLagrangianFields
                     );
                     reconstructLagrangianFields<tensor>
                     (
                         cloudName,
                         mesh,
                         procMeshes.meshes(),
-                        sprayObjs
+                        sprayObjs,
+                        selectedLagrangianFields
                     );
                     reconstructLagrangianFieldFields<tensor>
                     (
                         cloudName,
                         mesh,
                         procMeshes.meshes(),
-                        sprayObjs
+                        sprayObjs,
+                        selectedLagrangianFields
                     );
                 }
             }
diff --git a/bin/foamJob b/bin/foamJob
index 12f3211d2fd772523d33ec97deac080446b464b0..c882cefefe8a37ea5ee73d8be825d6b1efc3c03e 100755
--- a/bin/foamJob
+++ b/bin/foamJob
@@ -188,12 +188,12 @@ then
     fi
     mpiopts="-np $NPROCS"
 
-    # 
+    #
     # is the machine ready to run parallel?
     #
     echo "Parallel processing using $WM_MPLIB with $NPROCS processors"
     case "$WM_MPLIB" in
-    OPENMPI)
+    *OPENMPI)
         # add hostfile info
         for hostfile in \
             hostfile \
diff --git a/bin/tools/pre-commit-hook b/bin/tools/pre-commit-hook
index b06ddd50b6bf83fbc5af17ed00f4dfdcb4a186f1..ae8ca7c21c6cb3e5a3406092a2c50f13235e5de3 100755
--- a/bin/tools/pre-commit-hook
+++ b/bin/tools/pre-commit-hook
@@ -146,13 +146,20 @@ checkIllegalCode()
     badFiles=$(
     for f in $fileList
     do
-        # parse line numbers from grep output:
-        #        <lineNr>:   contents
-        lines=$(git grep -E -hn -e "$reBad" $scope"$f" |
-            sed -e 's@:.*@@' |
-            tr '\n' ' '
-        )
-        [ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
+        case "$f" in
+        # exclude potential makefiles
+        (wmake/[Mm]akefile* | wmake/rules/*)
+        ;;
+        (*)
+            # parse line numbers from grep output:
+            #        <lineNr>:   contents
+            lines=$(git grep -E -hn -e "$reBad" $scope"$f" |
+                sed -e 's@:.*@@' |
+                tr '\n' ' '
+            )
+            [ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
+        ;;
+        esac
     done
     )
 
@@ -243,7 +250,7 @@ checkLineLengthNonComments()
             # parse line numbers from grep output:
             #        <lineNr>:   contents
             lines=$(git grep -hn -e '^.\{81,\}' \
-                --and --not -e "^ *//" \
+                --and --not -e '^ *//' \
                 $scope"$f" |
                 sed -e 's@:.*@@' |
                 tr '\n' ' '
@@ -276,7 +283,7 @@ checkLineLengthNonDirective()
             # parse line numbers from grep output:
             #        <lineNr>:   contents
             lines=$(git grep -hn -e '^.\{81,\}' \
-                --and --not -e "^ *#" \
+                --and --not -e '^ *#' \
                 $scope"$f" |
                 sed -e 's@:.*@@' |
                 tr '\n' ' '
diff --git a/bin/tools/pre-receive-hook b/bin/tools/pre-receive-hook
index f289b99be702a3b94179713f069751ed09a2bd27..84ac684bc39e9f38e024f88e22e2262b3633cf4f 100755
--- a/bin/tools/pre-receive-hook
+++ b/bin/tools/pre-receive-hook
@@ -109,13 +109,20 @@ checkIllegalCode()
     badFiles=$(
     for f in $fileList
     do
-        # parse line numbers from grep output:
-        #        <lineNr>:   contents
-        lines=$(git grep -E -hn -e "$reBad" $scope"$f" |
-            sed -e 's@:.*@@' |
-            tr '\n' ' '
-        )
-        [ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
+        case "$f" in
+        # exclude potential makefiles
+        (wmake/[Mm]akefile* | wmake/rules/*)
+        ;;
+        (*)
+            # parse line numbers from grep output:
+            #        <lineNr>:   contents
+            lines=$(git grep -E -hn -e "$reBad" $scope"$f" |
+                sed -e 's@:.*@@' |
+                tr '\n' ' '
+            )
+            [ -n "$lines" ] && echo "$Indent$f -- lines: $lines"
+        ;;
+        esac
     done
     )
 
@@ -206,7 +213,7 @@ checkLineLengthNonComments()
             # parse line numbers from grep output:
             #        <lineNr>:   contents
             lines=$(git grep -hn -e '^.\{81,\}' \
-                --and --not -e "^ *//" \
+                --and --not -e '^ *//' \
                 $scope"$f" |
                 sed -e 's@:.*@@' |
                 tr '\n' ' '
@@ -239,7 +246,7 @@ checkLineLengthNonDirective()
             # parse line numbers from grep output:
             #        <lineNr>:   contents
             lines=$(git grep -hn -e '^.\{81,\}' \
-                --and --not -e "^ *#" \
+                --and --not -e '^ *#' \
                 $scope"$f" |
                 sed -e 's@:.*@@' |
                 tr '\n' ' '
diff --git a/etc/controlDict b/etc/controlDict
index b7beefbcd38992ad12619df5f140c21bf99c057c..32663f0873d50d80e846e320a8ae1cfc34102a6f 100644
--- a/etc/controlDict
+++ b/etc/controlDict
@@ -876,8 +876,8 @@ OptimisationSwitches
     //- Modification checking:
     //  - timeStamp         : use modification time on file
     //  - inotify           : use inotify framework
-    //  - timeStampMaster   : do time stamp (and file reading) only on master. 
-    //  - inotifyMaster     : do inotify (and file reading) only on master. 
+    //  - timeStampMaster   : do time stamp (and file reading) only on master.
+    //  - inotifyMaster     : do inotify (and file reading) only on master.
     fileModificationChecking timeStampMaster;//inotify;timeStamp;inotifyMaster;
 
     commsType       nonBlocking; //scheduled; //blocking;
diff --git a/etc/settings.csh b/etc/settings.csh
index 4fd95a1c9d08bac4bd86998b46599533f7f35ebd..f3bec0d91565f395ec53ce26a59d4f453ac40181 100644
--- a/etc/settings.csh
+++ b/etc/settings.csh
@@ -90,17 +90,20 @@ switch ("$compilerInstall")
 case OpenFOAM:
     switch ("$WM_COMPILER")
     case Gcc:
+    case Gcc++0x:
         set gcc_version=gcc-4.4.3
         set gmp_version=gmp-5.0.1
         set mpfr_version=mpfr-2.4.2
         breaksw
     case Gcc45:
+    case Gcc45++0x:
         set gcc_version=gcc-4.5.0
         set gmp_version=gmp-5.0.1
         set mpfr_version=mpfr-2.4.2
         set mpc_version=mpc-0.8.1
         breaksw
     case Gcc44:
+    case Gcc44++0x:
         set gcc_version=gcc-4.4.3
         set gmp_version=gmp-5.0.1
         set mpfr_version=mpfr-2.4.2
@@ -190,6 +193,18 @@ case OpenFOAM:
 endsw
 
 
+#
+# add c++0x flags for external programs
+#
+if ( $?WM_CXXFLAGS ) then
+    switch ("$WM_COMPILER")
+    case Gcc*++0x:
+        setenv WM_CXXFLAGS "$WM_CXXFLAGS -std=c++0x"
+        breaksw
+    endsw
+endif
+
+
 # boost and CGAL
 # ~~~~~~~~~~~~~~
 
@@ -236,12 +251,9 @@ case OPENMPI:
     breaksw
 
 case SYSTEMOPENMPI:
-    # use the system installed openmpi, get library directory via mpicc
+    # Use the system installed openmpi, get library directory via mpicc
     set mpi_version=openmpi-system
 
-    # Set to dummy value (but existing directory)
-    setenv MPI_ARCH_PATH /
-
     # Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
     setenv PINC "`mpicc --showme:compile`"
     setenv PLIBS "`mpicc --showme:link`"
diff --git a/etc/settings.sh b/etc/settings.sh
index 9f46523377c2a499f9311fd4c1c3ff3013f9fc51..785c3f97dde17d3c10cc6f8bef3eb5cf69b93faf 100644
--- a/etc/settings.sh
+++ b/etc/settings.sh
@@ -111,18 +111,18 @@ unset MPFR_ARCH_PATH
 case "${compilerInstall:-OpenFOAM}" in
 OpenFOAM)
     case "$WM_COMPILER" in
-    Gcc)
+    Gcc | Gcc++0x)
         gcc_version=gcc-4.4.3
         gmp_version=gmp-5.0.1
         mpfr_version=mpfr-2.4.2
         ;;
-    Gcc45)
+    Gcc45 | Gcc45++0x)
         gcc_version=gcc-4.5.0
         gmp_version=gmp-5.0.1
         mpfr_version=mpfr-2.4.2
         mpc_version=mpc-0.8.1
         ;;
-    Gcc44)
+    Gcc44 | Gcc44++0x)
         gcc_version=gcc-4.4.3
         gmp_version=gmp-5.0.1
         mpfr_version=mpfr-2.4.2
@@ -213,6 +213,19 @@ OpenFOAM)
 esac
 
 
+#
+# add c++0x flags for external programs
+#
+if [ -n "$WM_CXXFLAGS" ]
+then
+    case "$WM_COMPILER" in
+    Gcc*++0x)
+        WM_CXXFLAGS="$WM_CXXFLAGS -std=c++0x"
+        ;;
+    esac
+fi
+
+
 # boost and CGAL
 # ~~~~~~~~~~~~~~
 
@@ -261,12 +274,9 @@ OPENMPI)
     ;;
 
 SYSTEMOPENMPI)
-    # use the system installed openmpi, get library directory via mpicc
+    # Use the system installed openmpi, get library directory via mpicc
     mpi_version=openmpi-system
 
-    # Set to dummy (but existing directory). Used in Thirdparty Allwmake.
-    export MPI_ARCH_PATH=/
-
     # Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
     export PINC="`mpicc --showme:compile`"
     export PLIBS="`mpicc --showme:link`"
diff --git a/src/OSspecific/POSIX/Make/files b/src/OSspecific/POSIX/Make/files
index 788a08105ae3f40dca14cb2ed15e7ec8af77b363..c7396b63452db5569a2c52116371d2fa3e50aaba 100644
--- a/src/OSspecific/POSIX/Make/files
+++ b/src/OSspecific/POSIX/Make/files
@@ -8,6 +8,7 @@ fileStat.C
 POSIX.C
 cpuTime/cpuTime.C
 clockTime/clockTime.C
+memInfo/memInfo.C
 
 /*
  * Note: fileMonitor assumes inotify by default. Compile with -DFOAM_USE_STAT
diff --git a/src/OSspecific/POSIX/POSIX.C b/src/OSspecific/POSIX/POSIX.C
index 8f068f4dba81ebe927ec354bfe60754dd29f8389..fecea27cbe3c98514396df0688ffbe41c925bec0 100644
--- a/src/OSspecific/POSIX/POSIX.C
+++ b/src/OSspecific/POSIX/POSIX.C
@@ -36,6 +36,7 @@ Description
 #include "fileName.H"
 #include "fileStat.H"
 #include "timer.H"
+#include "IFstream.H"
 
 #include <fstream>
 #include <cstdlib>
diff --git a/src/OSspecific/POSIX/clockTime/clockTime.C b/src/OSspecific/POSIX/clockTime/clockTime.C
index 31a6d2c4bd824014d909c30680058add616d8ad2..3c65d023ff48a5805c10c79d4f8f879515b7656c 100644
--- a/src/OSspecific/POSIX/clockTime/clockTime.C
+++ b/src/OSspecific/POSIX/clockTime/clockTime.C
@@ -24,38 +24,25 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "clockTime.H"
-#include "scalar.H"
 #include <sys/time.h>
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
-// * * * * * * * * * * * * * * * Static Members  * * * * * * * * * * * * * * //
-
-
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
-void clockTime::getTime(struct timeval& t)
+void Foam::clockTime::getTime(timeType& t)
 {
-    gettimeofday(&t, NULL);
+    gettimeofday(&t, 0);
 }
 
 
-double clockTime::timeDifference
-(
-    const struct timeval& start,
-    const struct timeval& end
-)
+double Foam::clockTime::timeDifference(const timeType& beg, const timeType& end)
 {
-    return end.tv_sec - start.tv_sec + 1E-6*(end.tv_usec - start.tv_usec);
+    return end.tv_sec - beg.tv_sec + 1E-6*(end.tv_usec - beg.tv_usec);
 }
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-clockTime::clockTime()
+Foam::clockTime::clockTime()
 {
     getTime(startTime_);
     lastTime_ = startTime_;
@@ -65,14 +52,14 @@ clockTime::clockTime()
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-double clockTime::elapsedTime() const
+double Foam::clockTime::elapsedTime() const
 {
     getTime(newTime_);
     return timeDifference(startTime_, newTime_);
 }
 
 
-double clockTime::timeIncrement() const
+double Foam::clockTime::timeIncrement() const
 {
     lastTime_ = newTime_;
     getTime(newTime_);
@@ -80,8 +67,4 @@ double clockTime::timeIncrement() const
 }
 
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
 // ************************************************************************* //
diff --git a/src/OSspecific/POSIX/clockTime/clockTime.H b/src/OSspecific/POSIX/clockTime/clockTime.H
index 5237233f056590b2b45c7575f737239225205266..c8bbbdba6c4e57a5badea31178d2215afc343b0a 100644
--- a/src/OSspecific/POSIX/clockTime/clockTime.H
+++ b/src/OSspecific/POSIX/clockTime/clockTime.H
@@ -44,43 +44,45 @@ namespace Foam
 {
 
 /*---------------------------------------------------------------------------*\
-                           Class clockTime Declaration
+                          Class clockTime Declaration
 \*---------------------------------------------------------------------------*/
 
 class clockTime
 {
     // Private data
 
-        struct timeval startTime_;
-        mutable struct timeval lastTime_;
-        mutable struct timeval newTime_;
+        //- Time structure used
+        typedef struct timeval timeType;
 
-        static void getTime(struct timeval& t);
+        timeType startTime_;
 
-        static double timeDifference
-        (
-            const struct timeval& start,
-            const struct timeval& end
-        );
+        mutable timeType lastTime_;
+        mutable timeType newTime_;
+
+    // Private Member Functions
+
+        //- Retrieve the current time values from the system
+        static void getTime(timeType&);
+
+        //- Difference between two times
+        static double timeDifference(const timeType& beg, const timeType& end);
 
 
 public:
 
     // Constructors
 
-        //- Construct from components
+        //- Construct with the current clock time
         clockTime();
 
 
     // Member Functions
 
-        // Access
-
-            //- Returns CPU time from start of run
-            double elapsedTime() const;
+        //- Return time (in seconds) from the start
+        double elapsedTime() const;
 
-            //- Returns CPU time from last call of clockTimeIncrement()
-            double timeIncrement() const;
+        //- Return time (in seconds) since last call to timeIncrement()
+        double timeIncrement() const;
 };
 
 
diff --git a/src/OSspecific/POSIX/cpuTime/cpuTime.C b/src/OSspecific/POSIX/cpuTime/cpuTime.C
index b5ef0c42833119f891e23b57a99791dcc5adb6c4..5af53026fd294da2540ed807820bddd3a4b737ca 100644
--- a/src/OSspecific/POSIX/cpuTime/cpuTime.C
+++ b/src/OSspecific/POSIX/cpuTime/cpuTime.C
@@ -21,45 +21,32 @@ License
     You should have received a copy of the GNU General Public License
     along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
 
-Description
-    Starts timing CPU usage and return elapsed time from start.
-
 \*---------------------------------------------------------------------------*/
 
 #include "cpuTime.H"
-
 #include <unistd.h>
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
 // * * * * * * * * * * * * * * * Static Members  * * * * * * * * * * * * * * //
 
-long cpuTime::Hz_(sysconf(_SC_CLK_TCK));
+const long Foam::cpuTime::Hz_(sysconf(_SC_CLK_TCK));
 
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
-void cpuTime::getTime(struct tms& t)
+void Foam::cpuTime::getTime(timeType& t)
 {
     times(&t);
 }
 
 
-double cpuTime::timeDifference
-(
-    const struct tms& start,
-    const struct tms& end
-)
+double Foam::cpuTime::timeDifference(const timeType& beg, const timeType& end)
 {
     return
     (
         double
         (
             (end.tms_utime + end.tms_stime)
-          - (start.tms_utime + start.tms_stime)
+          - (beg.tms_utime + beg.tms_stime)
         )/Hz_
     );
 }
@@ -67,7 +54,7 @@ double cpuTime::timeDifference
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-cpuTime::cpuTime()
+Foam::cpuTime::cpuTime()
 {
     getTime(startTime_);
     lastTime_ = startTime_;
@@ -77,14 +64,14 @@ cpuTime::cpuTime()
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-double cpuTime::elapsedCpuTime() const
+double Foam::cpuTime::elapsedCpuTime() const
 {
     getTime(newTime_);
     return timeDifference(startTime_, newTime_);
 }
 
 
-double cpuTime::cpuTimeIncrement() const
+double Foam::cpuTime::cpuTimeIncrement() const
 {
     lastTime_ = newTime_;
     getTime(newTime_);
@@ -92,8 +79,4 @@ double cpuTime::cpuTimeIncrement() const
 }
 
 
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
 // ************************************************************************* //
diff --git a/src/OSspecific/POSIX/cpuTime/cpuTime.H b/src/OSspecific/POSIX/cpuTime/cpuTime.H
index e3a6376360ff3b39af389f42f31b078b4fecbde8..33e32593046a7931bb1e7fc5e73c2c87ffd21af8 100644
--- a/src/OSspecific/POSIX/cpuTime/cpuTime.H
+++ b/src/OSspecific/POSIX/cpuTime/cpuTime.H
@@ -54,38 +54,41 @@ class cpuTime
 {
     // Private data
 
-        static long Hz_;
+        //- Time structure used
+        typedef struct tms timeType;
 
-        struct tms startTime_;
-        mutable struct tms lastTime_;
-        mutable struct tms newTime_;
+        //- Clock-ticks per second
+        static const long Hz_;
 
-        static void getTime(struct tms& t);
+        //- The start time
+        timeType startTime_;
+        mutable timeType lastTime_;
+        mutable timeType newTime_;
 
-        static double timeDifference
-        (
-            const struct tms& start,
-            const struct tms& end
-        );
+    // Private Member Functions
+
+        //- Retrieve the current time values from the system
+        static void getTime(timeType&);
+
+        //- Difference between two times
+        static double timeDifference(const timeType& beg, const timeType& end);
 
 
 public:
 
     // Constructors
 
-        //- Construct from components
+        //- Construct with the current clock time
         cpuTime();
 
 
     // Member Functions
 
-        // Access
-
-            //- Returns CPU time from start of run
-            double elapsedCpuTime() const;
+        //- Return CPU time (in seconds) from the start
+        double elapsedCpuTime() const;
 
-            //- Returns CPU time from last call of cpuTimeIncrement()
-            double cpuTimeIncrement() const;
+        //- Return CPU time (in seconds) since last call to cpuTimeIncrement()
+        double cpuTimeIncrement() const;
 };
 
 
diff --git a/src/OSspecific/POSIX/memInfo/memInfo.C b/src/OSspecific/POSIX/memInfo/memInfo.C
new file mode 100644
index 0000000000000000000000000000000000000000..ef76fe004ffc158d8ad5a9487c50ba2787a1be2e
--- /dev/null
+++ b/src/OSspecific/POSIX/memInfo/memInfo.C
@@ -0,0 +1,117 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  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/>.
+
+\*---------------------------------------------------------------------------*/
+
+#include "memInfo.H"
+
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::memInfo::memInfo()
+:
+    peak_(-1),
+    size_(-1),
+    rss_(-1)
+{
+    update();
+}
+
+
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
+Foam::memInfo::~memInfo()
+{}
+
+
+// * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * * //
+
+const Foam::memInfo& Foam::memInfo::update()
+{
+    IFstream is("/proc/" + name(pid()) + "/status");
+
+    while (is.good())
+    {
+        string line;
+        is.getLine(line);
+        char tag[32];
+        int value;
+
+        if (sscanf(line.c_str(), "%30s %d", tag, &value) == 2)
+        {
+            if (!strcmp(tag, "VmPeak:"))
+            {
+                peak_ = value;
+            }
+            else if (!strcmp(tag, "VmSize:"))
+            {
+                size_ = value;
+            }
+            else if (!strcmp(tag, "VmRSS:"))
+            {
+                rss_ = value;
+            }
+        }
+    }
+
+    return *this;
+}
+
+
+// * * * * * * * * * * * * * * * IOstream Operators  * * * * * * * * * * * * //
+
+Foam::Istream& Foam::operator>>(Istream& is, memInfo& m)
+{
+    is.readBegin("memInfo");
+
+    is  >> m.peak_ >> m.size_ >> m.rss_;
+
+    is.readEnd("memInfo");
+
+    // Check state of Istream
+    is.check
+    (
+        "Foam::Istream& Foam::operator>>(Foam::Istream&, Foam::memInfo&)"
+    );
+
+    return is;
+}
+
+
+Foam::Ostream& Foam::operator<<(Ostream& os, const memInfo& m)
+{
+    os  << token::BEGIN_LIST
+        << m.peak_ << token::SPACE << m.size_ << token::SPACE << m.rss_
+        << token::END_LIST;
+
+    // Check state of Ostream
+    os.check
+    (
+        "Foam::Ostream& Foam::operator<<(Foam::Ostream&, "
+        "const Foam::memInfo&)"
+    );
+
+    return os;
+}
+
+
+// ************************************************************************* //
diff --git a/src/OSspecific/POSIX/memInfo/memInfo.H b/src/OSspecific/POSIX/memInfo/memInfo.H
new file mode 100644
index 0000000000000000000000000000000000000000..73f614fea73168b9614286df4681f874088b3352
--- /dev/null
+++ b/src/OSspecific/POSIX/memInfo/memInfo.H
@@ -0,0 +1,118 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  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/>.
+
+Class
+    Foam::memInfo
+
+Description
+    Memory usage information for the process running this object.
+
+SourceFiles
+    memInfo.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef memInfo_H
+#define memInfo_H
+
+#include "OSspecific.H"
+#include "POSIX.H"
+#include "IFstream.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+                           Class memInfo Declaration
+\*---------------------------------------------------------------------------*/
+
+class memInfo
+{
+    // Private data
+
+        //- Peak memory used by the process (VmPeak in /proc/<pid>/status)
+        int peak_;
+
+        //- Memory used by the process (VmSize in /proc/<pid>/status)
+        int size_;
+
+        //- Resident set size of the process (VmRSS in /proc/<pid>/status)
+        int rss_;
+
+
+public:
+
+    // Constructors
+
+        //- Construct null
+        memInfo();
+
+
+    //- Destructor
+    ~memInfo();
+
+
+    // Member Functions
+
+        //- Parse /proc/<pid>/status
+        const memInfo& update();
+
+        // Access
+
+            //- Access the stored peak memory
+            int peak() const
+            {
+                return peak_;
+            }
+
+            //- Access the stored memory size
+            int size() const
+            {
+                return size_;
+            }
+
+            //- Access the stored rss value
+            int rss() const
+            {
+                return rss_;
+            }
+
+
+    // IOstream Operators
+
+        friend Istream& operator>>(Istream&, memInfo&);
+        friend Ostream& operator<<(Ostream&, const memInfo&);
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/containers/NamedEnum/NamedEnum.C b/src/OpenFOAM/containers/NamedEnum/NamedEnum.C
index 2d6a3836fe88afd594d6ded036349bac1b6bdb09..d02ba34f555a5b8f8fbfb2377239796901c75277 100644
--- a/src/OpenFOAM/containers/NamedEnum/NamedEnum.C
+++ b/src/OpenFOAM/containers/NamedEnum/NamedEnum.C
@@ -24,7 +24,6 @@ License
 \*---------------------------------------------------------------------------*/
 
 #include "NamedEnum.H"
-#include "stringList.H"
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
@@ -85,4 +84,42 @@ void Foam::NamedEnum<Enum, nEnum>::write(const Enum e, Ostream& os) const
 }
 
 
+template<class Enum, int nEnum>
+Foam::stringList Foam::NamedEnum<Enum, nEnum>::strings()
+{
+    stringList lst(nEnum);
+
+    label nElem = 0;
+    for (int enumI = 0; enumI < nEnum; ++enumI)
+    {
+        if (names[enumI] && names[enumI][0])
+        {
+            lst[nElem++] = names[enumI];
+        }
+    }
+
+    lst.setSize(nElem);
+    return lst;
+}
+
+
+template<class Enum, int nEnum>
+Foam::wordList Foam::NamedEnum<Enum, nEnum>::words()
+{
+    wordList lst(nEnum);
+
+    label nElem = 0;
+    for (int enumI = 0; enumI < nEnum; ++enumI)
+    {
+        if (names[enumI] && names[enumI][0])
+        {
+            lst[nElem++] = names[enumI];
+        }
+    }
+
+    lst.setSize(nElem);
+    return lst;
+}
+
+
 // ************************************************************************* //
diff --git a/src/OpenFOAM/containers/NamedEnum/NamedEnum.H b/src/OpenFOAM/containers/NamedEnum/NamedEnum.H
index f3d3d6d1d6c47d4d80c345ca131b6200ac1b3909..1b5df04111705015a6cca7e520785c5fed07b110 100644
--- a/src/OpenFOAM/containers/NamedEnum/NamedEnum.H
+++ b/src/OpenFOAM/containers/NamedEnum/NamedEnum.H
@@ -37,6 +37,8 @@ SourceFiles
 
 #include "HashTable.H"
 #include "StaticAssert.H"
+#include "stringList.H"
+#include "wordList.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -87,6 +89,12 @@ public:
         //- Write the name representation of the enumeration to an Ostream
         void write(const Enum e, Ostream&) const;
 
+        //- The set of names as a list of strings
+        static stringList strings();
+
+        //- The set of names as a list of words
+        static wordList words();
+
 
     // Member Operators
 
diff --git a/src/lagrangian/basic/Particle/Particle.H b/src/lagrangian/basic/Particle/Particle.H
index d17a9c995b71ff20a6a4c40e1de1f60b772413e8..8e7604bef5dc4cab226fa7921fec25452d5099fe 100644
--- a/src/lagrangian/basic/Particle/Particle.H
+++ b/src/lagrangian/basic/Particle/Particle.H
@@ -517,12 +517,18 @@ public:
             //-  Return the fraction of time-step completed
             inline scalar stepFraction() const;
 
-            //- Return the originating processor id
+            //- Return const access to the originating processor id
             inline label origProc() const;
 
-            //- Return the particle id on originating processor
+            //- Return the originating processor id for manipulation
+            inline label& origProc();
+
+            //- Return const access to  the particle id on originating processor
             inline label origId() const;
 
+            //- Return the particle id on originating processor for manipulation
+            inline label& origId();
+
 
         // Track
 
diff --git a/src/lagrangian/basic/Particle/ParticleI.H b/src/lagrangian/basic/Particle/ParticleI.H
index 50c727fe4a27b0ca4814f1579f2880fcdea8a266..0ef468ea2fee26db20fa09de3644a7b67f289f87 100644
--- a/src/lagrangian/basic/Particle/ParticleI.H
+++ b/src/lagrangian/basic/Particle/ParticleI.H
@@ -1117,6 +1117,13 @@ inline Foam::label Foam::Particle<ParticleType>::origProc() const
 }
 
 
+template<class ParticleType>
+inline Foam::label& Foam::Particle<ParticleType>::origProc()
+{
+    return origProc_;
+}
+
+
 template<class ParticleType>
 inline Foam::label Foam::Particle<ParticleType>::origId() const
 {
@@ -1124,6 +1131,13 @@ inline Foam::label Foam::Particle<ParticleType>::origId() const
 }
 
 
+template<class ParticleType>
+inline Foam::label& Foam::Particle<ParticleType>::origId()
+{
+    return origId_;
+}
+
+
 template<class ParticleType>
 inline bool Foam::Particle<ParticleType>::softImpact() const
 {
diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C
index a5f1b44d840a274ccd2723bc4787e9ad4164b7ae..cccb87fea114408c2df13a544ff2248a93672bfa 100644
--- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C
+++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C
@@ -426,11 +426,8 @@ bool Foam::KinematicParcel<ParcelType>::hitPatch
     td.cloud().postProcessing().postPatch(p, patchI);
 
     // Invoke surface film model
-    if (td.cloud().surfaceFilm().transferParcel(p, patchI))
+    if (td.cloud().surfaceFilm().transferParcel(p, pp, td.keepParticle))
     {
-        // Parcel transferred to the surface film
-        td.keepParticle = false;
-
         // All interactions done
         return true;
     }
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C
index d71ab361723695b6358df55f8dcae58f7222e90d..f1ef48de9dcb6a17c521a9ea98802d0b04bbe5ab 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C
+++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C
@@ -37,10 +37,12 @@ Foam::SurfaceFilmModel<CloudType>::SurfaceFilmModel(CloudType& owner)
 :
     SubModelBase<CloudType>(owner),
     g_(dimensionedVector("zero", dimAcceleration, vector::zero)),
+    ejectedParcelType_(0),
     massParcelPatch_(0),
     diameterParcelPatch_(0),
     UFilmPatch_(0),
     rhoFilmPatch_(0),
+    deltaFilmPatch_(0),
     nParcelsTransferred_(0),
     nParcelsInjected_(0)
 {}
@@ -57,10 +59,15 @@ Foam::SurfaceFilmModel<CloudType>::SurfaceFilmModel
 :
     SubModelBase<CloudType>(owner, dict, type),
     g_(g),
+    ejectedParcelType_
+    (
+        this->coeffDict().lookupOrDefault("ejectedParcelType", -1)
+    ),
     massParcelPatch_(0),
     diameterParcelPatch_(0),
     UFilmPatch_(0),
     rhoFilmPatch_(0),
+    deltaFilmPatch_(owner.mesh().boundary().size()),
     nParcelsTransferred_(0),
     nParcelsInjected_(0)
 {}
@@ -74,10 +81,12 @@ Foam::SurfaceFilmModel<CloudType>::SurfaceFilmModel
 :
     SubModelBase<CloudType>(sfm),
     g_(sfm.g_),
+    ejectedParcelType_(sfm.ejectedParcelType_),
     massParcelPatch_(sfm.massParcelPatch_),
     diameterParcelPatch_(sfm.diameterParcelPatch_),
     UFilmPatch_(sfm.UFilmPatch_),
     rhoFilmPatch_(sfm.rhoFilmPatch_),
+    deltaFilmPatch_(sfm.deltaFilmPatch_),
     nParcelsTransferred_(sfm.nParcelsTransferred_),
     nParcelsInjected_(sfm.nParcelsInjected_)
 {}
@@ -95,16 +104,18 @@ Foam::SurfaceFilmModel<CloudType>::~SurfaceFilmModel()
 template<class CloudType>
 bool Foam::SurfaceFilmModel<CloudType>::transferParcel
 (
-    const parcelType& p,
-    const label patchI
+    parcelType& p,
+    const polyPatch& pp,
+    bool& keepParticle
 )
 {
     notImplemented
     (
         "bool Foam::SurfaceFilmModel<CloudType>::transferParcel"
         "("
-            "const parcelType&, "
-            "const label"
+            "parcelType&, "
+            "const label, "
+            "const bool&"
         ")"
     );
 
@@ -145,7 +156,7 @@ void Foam::SurfaceFilmModel<CloudType>::inject(TrackData& td)
 
         const label filmPatchI = filmPatches[i];
         const mapDistribute& distMap = wpp.map();
-        cacheFilmFields(filmPatchI, distMap, filmModel);
+        cacheFilmFields(filmPatchI, primaryPatchI, distMap, filmModel);
 
         forAll(injectorCellsPatch, j)
         {
@@ -196,6 +207,7 @@ template<class CloudType>
 void Foam::SurfaceFilmModel<CloudType>::cacheFilmFields
 (
     const label filmPatchI,
+    const label primaryPatchI,
     const mapDistribute& distMap,
     const surfaceFilmModels::surfaceFilmModel& filmModel
 )
@@ -212,6 +224,10 @@ void Foam::SurfaceFilmModel<CloudType>::cacheFilmFields
 
     rhoFilmPatch_ = filmModel.rho().boundaryField()[filmPatchI];
     distMap.distribute(rhoFilmPatch_);
+
+    deltaFilmPatch_[primaryPatchI] =
+        filmModel.delta().boundaryField()[filmPatchI];
+    distMap.distribute(deltaFilmPatch_[primaryPatchI]);
 }
 
 
@@ -229,6 +245,11 @@ void Foam::SurfaceFilmModel<CloudType>::setParcelProperties
     p.rho() = rhoFilmPatch_[filmFaceI];
 
     p.nParticle() = massParcelPatch_[filmFaceI]/p.rho()/vol;
+
+    if (ejectedParcelType_ >= 0)
+    {
+        p.typeId() = ejectedParcelType_;
+    }
 }
 
 
diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H
index 25452ce1d7afb3f104f6661752562bd0022ad5cc..35c415751258957b906b66878d0e6c9e4272a0e9 100644
--- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H
+++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H
@@ -73,6 +73,11 @@ protected:
         //- Gravitational acceleration constant
         const dimensionedVector& g_;
 
+        //- Ejected parcel type label - id assigned to identify parcel for
+        //  post-processing. If not specified, defaults to originating cloud
+        //  type
+        label ejectedParcelType_;
+
 
         // Cached injector fields per film patch
 
@@ -88,6 +93,9 @@ protected:
             //- Film density / patch face
             scalarList rhoFilmPatch_;
 
+            //- Film height of all film patches / patch face
+            scalarListList deltaFilmPatch_;
+
 
         // Counters
 
@@ -104,6 +112,7 @@ protected:
         virtual void cacheFilmFields
         (
             const label filmPatchI,
+            const label primaryPatchI,
             const mapDistribute& distMap,
             const surfaceFilmModels::surfaceFilmModel& filmModel
         );
@@ -206,8 +215,9 @@ public:
             //  Returns true if parcel is to be transferred
             virtual bool transferParcel
             (
-                const parcelType& p,
-                const label patchI
+                parcelType& p,
+                const polyPatch& pp,
+                bool& keepParticle
             );
 
             //- Inject parcels into the cloud
diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C
index efc60d46b6751467f390f5608df1a2fe1f6d52ac..1a037fdc7792afb649a764aebd6065b42a70a23d 100644
--- a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C
+++ b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C
@@ -25,6 +25,460 @@ License
 
 #include "ThermoSurfaceFilm.H"
 #include "addToRunTimeSelectionTable.H"
+#include "mathematicalConstants.H"
+#include "Pstream.H"
+
+using namespace Foam::constant::mathematical;
+
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
+
+template<class CloudType>
+Foam::wordList Foam::ThermoSurfaceFilm<CloudType>::interactionTypeNames_
+(
+    IStringStream
+    (
+        "(absorb bounce splashBai)"
+    )()
+);
+
+
+// * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * * //
+
+template<class CloudType>
+typename Foam::ThermoSurfaceFilm<CloudType>::interactionType
+Foam::ThermoSurfaceFilm<CloudType>::interactionTypeEnum(const word& it) const
+{
+    forAll(interactionTypeNames_, i)
+    {
+        if (interactionTypeNames_[i] == it)
+        {
+            return interactionType(i);
+        }
+    }
+
+    FatalErrorIn
+    (
+        "ThermoSurfaceFilm<CloudType>::interactionType "
+        "ThermoSurfaceFilm<CloudType>::interactionTypeEnum"
+        "("
+            "const word& it"
+        ") const"
+    )   << "Unknown interaction type " << it
+        << ". Valid interaction types include: " << interactionTypeNames_
+        << abort(FatalError);
+
+    return interactionType(0);
+}
+
+
+template<class CloudType>
+Foam::word Foam::ThermoSurfaceFilm<CloudType>::interactionTypeStr
+(
+    const interactionType& it
+) const
+{
+    if (it >= interactionTypeNames_.size())
+    {
+        FatalErrorIn
+        (
+            "ThermoSurfaceFilm<CloudType>::interactionType "
+            "ThermoSurfaceFilm<CloudType>::interactionTypeStr"
+            "("
+                "const interactionType& it"
+            ") const"
+        )   << "Unknown interaction type enumeration" << abort(FatalError);
+    }
+
+    return interactionTypeNames_[it];
+}
+
+
+template<class CloudType>
+Foam::vector Foam::ThermoSurfaceFilm<CloudType>::tangentVector
+(
+    const vector& v
+) const
+{
+    vector tangent = vector::zero;
+    scalar magTangent = 0.0;
+
+    while (magTangent < SMALL)
+    {
+        vector vTest = rndGen_.sample01<vector>();
+        tangent = vTest - (vTest & v)*v;
+        magTangent = mag(tangent);
+    }
+
+    return tangent/magTangent;
+}
+
+
+template<class CloudType>
+Foam::vector Foam::ThermoSurfaceFilm<CloudType>::splashDirection
+(
+    const vector& tanVec1,
+    const vector& tanVec2,
+    const vector& nf
+) const
+{
+    // azimuthal angle [rad]
+    const scalar phiSi = twoPi*rndGen_.sample01<scalar>();
+
+    // ejection angle [rad]
+    const scalar thetaSi = pi/180.0*(rndGen_.sample01<scalar>()*(50 - 5) + 5);
+
+    // direction vector of new parcel
+    const scalar alpha = sin(thetaSi);
+    const scalar dcorr = cos(thetaSi);
+    const vector normal = alpha*(tanVec1*cos(phiSi) + tanVec2*sin(phiSi));
+    vector dirVec = dcorr*nf;
+    dirVec += normal;
+
+    return dirVec/mag(dirVec);
+}
+
+
+template<class CloudType>
+void Foam::ThermoSurfaceFilm<CloudType>::absorbInteraction
+(
+    surfaceFilmModels::surfaceFilmModel& filmModel,
+    const parcelType& p,
+    const polyPatch& pp,
+    const label faceI,
+    const scalar mass,
+    bool& keepParticle
+)
+{
+    if (debug)
+    {
+        Info<< "Parcel " << p.origId() << " absorbInteraction" << endl;
+    }
+
+    // Patch face normal
+    const vector& nf = pp.faceNormals()[faceI];
+
+    // Patch velocity
+    const vector& Up = this->owner().U().boundaryField()[pp.index()][faceI];
+
+    // Relative parcel velocity
+    const vector Urel = p.U() - Up;
+
+    // Parcel normal velocity
+    const vector Un = nf*(Urel & nf);
+
+    // Parcel tangential velocity
+    const vector Ut = Urel - Un;
+
+    filmModel.addSources
+    (
+        pp.index(),
+        faceI,
+        mass,                           // mass
+        mass*Ut,                        // tangential momentum
+        mass*mag(Un),                   // impingement pressure
+        mass*p.hs()                     // energy
+    );
+
+    this->nParcelsTransferred()++;
+
+    keepParticle = false;
+}
+
+
+template<class CloudType>
+void Foam::ThermoSurfaceFilm<CloudType>::bounceInteraction
+(
+    parcelType& p,
+    const polyPatch& pp,
+    const label faceI,
+    bool& keepParticle
+) const
+{
+    if (debug)
+    {
+        Info<< "Parcel " << p.origId() << " bounceInteraction" << endl;
+    }
+
+    // Patch face normal
+    const vector& nf = pp.faceNormals()[faceI];
+
+    // Patch velocity
+    const vector& Up = this->owner().U().boundaryField()[pp.index()][faceI];
+
+    // Relative parcel velocity
+    const vector Urel = p.U() - Up;
+
+    // Flip parcel normal velocity component
+    p.U() -= 2.0*nf*(Urel & nf);
+
+    keepParticle = true;
+}
+
+
+template<class CloudType>
+void Foam::ThermoSurfaceFilm<CloudType>::drySplashInteraction
+(
+    surfaceFilmModels::surfaceFilmModel& filmModel,
+    const parcelType& p,
+    const polyPatch& pp,
+    const label faceI,
+    bool& keepParticle
+)
+{
+    if (debug)
+    {
+        Info<< "Parcel " << p.origId() << " drySplashInteraction" << endl;
+    }
+
+    const liquid& liq = thermo_.liquids().properties()[0];
+
+    // Patch face velocity and normal
+    const vector& Up = this->owner().U().boundaryField()[pp.index()][faceI];
+    const vector& nf = pp.faceNormals()[faceI];
+
+    // local pressure
+    const scalar pc = thermo_.thermo().p()[p.cell()];
+
+    // Retrieve parcel properties
+    const scalar m = p.mass()*p.nParticle();
+    const scalar rho = p.rho();
+    const scalar d = p.d();
+    const scalar sigma = liq.sigma(pc, p.T());
+    const scalar mu = liq.mu(pc, p.T());
+    const vector Urel = p.U() - Up;
+    const vector Un = nf*(Urel & nf);
+
+    // Laplace number
+    const scalar La = rho*sigma*d/sqr(mu);
+
+    // Weber number
+    const scalar We = rho*magSqr(Un)*d/sigma;
+
+    // Critical Weber number
+    const scalar Wec = Adry_*pow(La, -0.183);
+
+    if (We < Wec) // adhesion - assume absorb
+    {
+        absorbInteraction(filmModel, p, pp, faceI, m, keepParticle);
+    }
+    else // splash
+    {
+        // ratio of incident mass to splashing mass
+        const scalar mRatio = 0.2 + 0.6*rndGen_.sample01<scalar>();
+        splashInteraction
+            (filmModel, p, pp, faceI, mRatio, We, Wec, sigma, keepParticle);
+    }
+}
+
+
+template<class CloudType>
+void Foam::ThermoSurfaceFilm<CloudType>::wetSplashInteraction
+(
+    surfaceFilmModels::surfaceFilmModel& filmModel,
+    parcelType& p,
+    const polyPatch& pp,
+    const label faceI,
+    bool& keepParticle
+)
+{
+    if (debug)
+    {
+        Info<< "Parcel " << p.origId() << " wetSplashInteraction" << endl;
+    }
+
+    const liquid& liq = thermo_.liquids().properties()[0];
+
+    // Patch face velocity and normal
+    const vector& Up = this->owner().U().boundaryField()[pp.index()][faceI];
+    const vector& nf = pp.faceNormals()[faceI];
+
+    // local pressure
+    const scalar pc = thermo_.thermo().p()[p.cell()];
+
+    // Retrieve parcel properties
+    const scalar m = p.mass()*p.nParticle();
+    const scalar rho = p.rho();
+    const scalar d = p.d();
+    vector& U = p.U();
+    const scalar sigma = liq.sigma(pc, p.T());
+    const scalar mu = liq.mu(pc, p.T());
+    const vector Urel = p.U() - Up;
+    const vector Un = nf*(Urel & nf);
+    const vector Ut = Urel - Un;
+
+    // Laplace number
+    const scalar La = rho*sigma*d/sqr(mu);
+
+    // Weber number
+    const scalar We = rho*magSqr(Un)*d/sigma;
+
+    // Critical Weber number
+    const scalar Wec = Awet_*pow(La, -0.183);
+
+    if (We < 1) // adhesion - assume absorb
+    {
+        absorbInteraction(filmModel, p, pp, faceI, m, keepParticle);
+    }
+    else if ((We >= 1) && (We < 20)) // bounce
+    {
+        // incident angle of impingement
+        const scalar theta = pi/2 - acos(U/mag(U) & nf);
+
+        // restitution coefficient
+        const scalar epsilon = 0.993 - theta*(1.76 - theta*(1.56 - theta*0.49));
+
+        // update parcel velocity
+        U = -epsilon*(Un) + 5/7*(Ut);
+
+        keepParticle = true;
+    }
+    else if ((We >= 20) && (We < Wec)) // spread - assume absorb
+    {
+        absorbInteraction(filmModel, p, pp, faceI, m, keepParticle);
+    }
+    else    // splash
+    {
+        // ratio of incident mass to splashing mass
+        // splash mass can be > incident mass due to film entrainment
+        const scalar mRatio = 0.2 + 0.9*rndGen_.sample01<scalar>();
+        splashInteraction
+            (filmModel, p, pp, faceI, mRatio, We, Wec, sigma, keepParticle);
+    }
+}
+
+
+template<class CloudType>
+void Foam::ThermoSurfaceFilm<CloudType>::splashInteraction
+(
+    surfaceFilmModels::surfaceFilmModel& filmModel,
+    const parcelType& p,
+    const polyPatch& pp,
+    const label faceI,
+    const scalar mRatio,
+    const scalar We,
+    const scalar Wec,
+    const scalar sigma,
+    bool& keepParticle
+)
+{
+    // Patch face velocity and normal
+    const fvMesh& mesh = this->owner().mesh();
+    const vector& Up = this->owner().U().boundaryField()[pp.index()][faceI];
+    const vector& nf = pp.faceNormals()[faceI];
+
+    // Determine direction vectors tangential to patch normal
+    const vector tanVec1 = tangentVector(nf);
+    const vector tanVec2 = nf^tanVec1;
+
+    // Retrieve parcel properties
+    const scalar np = p.nParticle();
+    const scalar m = p.mass()*np;
+    const scalar d = p.d();
+    const vector Urel = p.U() - Up;
+    const vector Un = nf*(Urel & nf);
+    const vector Ut = Urel - Un;
+    const vector& posC = mesh.C()[p.cell()];
+    const vector& posCf = mesh.Cf().boundaryField()[pp.index()][faceI];
+
+    // total mass of (all) splashed parcels
+    const scalar mSplash = m*mRatio;
+
+    // number of splashed particles per incoming particle
+    const scalar Ns = 5.0*(We/Wec - 1.0);
+
+    // average diameter of splashed particles
+    const scalar dBarSplash = 1/cbrt(6.0)*cbrt(mRatio/Ns)*d + ROOTVSMALL;
+
+    // cumulative diameter splash distribution
+    const scalar dMin = 0.01*d;
+    const scalar dMax = d;
+    const scalar K = exp(-dMin/dBarSplash) - exp(-dMax/dBarSplash);
+
+    // surface energy of secondary parcels [J]
+    scalar ESigmaSec = 0;
+
+    // sample splash distribution to detrmine secondary parcel diameters
+    scalarList dNew(parcelsPerSplash_);
+    forAll(dNew, i)
+    {
+        const scalar y = rndGen_.sample01<scalar>();
+        dNew[i] = -dBarSplash*log(exp(-dMin/dBarSplash) - y*K);
+        ESigmaSec += sigma*p.areaS(dNew[i]);
+    }
+
+    // incident kinetic energy [J]
+    const scalar EKIn = 0.5*m*magSqr(Urel);
+
+    // incident surface energy [J]
+    const scalar ESigmaIn = sigma*p.areaS(d);
+
+    // dissipative energy
+    const scalar Ed = max(0.8*EKIn, Wec/12*pi*sigma*sqr(d));
+
+    // total energy [J]
+    const scalar EKs = EKIn + ESigmaIn - ESigmaSec - Ed;
+
+    // switch to absorb if insufficient energy for splash
+    if (EKs <= 0)
+    {
+        absorbInteraction(filmModel, p, pp, faceI, m, keepParticle);
+        return;
+    }
+
+    // helper variables to calculate magUns0
+    const scalar logD = log(d);
+    const scalar coeff2 = log(dNew[0]) - logD + ROOTVSMALL;
+    scalar coeff1 = 0.0;
+    forAll(dNew, i)
+    {
+        coeff1 += sqr(log(dNew[i]) - logD);
+    }
+
+    // magnitude of the normal velocity of the first splashed parcel
+    const scalar magUns0 =
+        sqrt(2.0*parcelsPerSplash_*EKs/mSplash/(1 + coeff1/sqr(coeff2)));
+
+    // Set splashed parcel properties
+    forAll(dNew, i)
+    {
+        const vector dirVec = splashDirection(tanVec1, tanVec2, -nf);
+
+        // Create a new parcel by copying source parcel
+        parcelType* pPtr = new parcelType(p);
+
+        pPtr->origId() = this->owner().getNewParticleID();
+
+        pPtr->origProc() = Pstream::myProcNo();
+
+        if (splashParcelType_ >= 0)
+        {
+            pPtr->typeId() = splashParcelType_;
+        }
+
+        // perturb new parcels towards the owner cell centre
+        pPtr->position() += 0.5*rndGen_.sample01<scalar>()*(posC - posCf);
+
+        pPtr->nParticle() = mRatio*np*pow3(d)/pow3(dNew[i])/parcelsPerSplash_;
+
+        pPtr->d() = dNew[i];
+
+        pPtr->U() = dirVec*(mag(Cf_*Ut) + magUns0*(log(dNew[i]) - logD)/coeff2);
+
+        // Apply correction to velocity for 2-D cases
+        meshTools::constrainDirection(mesh, mesh.solutionD(), pPtr->U());
+
+        // Add the new parcel
+        this->owner().addParticle(pPtr);
+
+        nParcelsSplashed_++;
+    }
+
+    // transfer remaining part of parcel to film 0 - splashMass can be -ve
+    // if entraining from the film
+    const scalar mDash = m - mSplash;
+    absorbInteraction(filmModel, p, pp, faceI, mDash, keepParticle);
+}
+
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
@@ -37,9 +491,37 @@ Foam::ThermoSurfaceFilm<CloudType>::ThermoSurfaceFilm
 )
 :
     SurfaceFilmModel<CloudType>(dict, owner, g, typeName),
+    rndGen_(owner.rndGen()),
+    thermo_(owner.db().objectRegistry::lookupObject<SLGThermo>("SLGThermo")),
     TFilmPatch_(0),
-    CpFilmPatch_(0)
-{}
+    CpFilmPatch_(0),
+    interactionType_
+    (
+        interactionTypeEnum(this->coeffDict().lookup("interactionType"))
+    ),
+    deltaWet_(0.0),
+    splashParcelType_(0),
+    parcelsPerSplash_(0),
+    Adry_(0.0),
+    Awet_(0.0),
+    Cf_(0.0),
+    nParcelsSplashed_(0)
+{
+    Info<< "    Applying " << interactionTypeStr(interactionType_)
+        << " interaction model" << endl;
+
+    if (interactionType_ == itSplashBai)
+    {
+        this->coeffDict().lookup("deltaWet") >> deltaWet_;
+        splashParcelType_ =
+            this->coeffDict().lookupOrDefault("splashParcelType", -1);
+        parcelsPerSplash_ =
+            this->coeffDict().lookupOrDefault("parcelsPerSplash", 2);
+        this->coeffDict().lookup("Adry") >> Adry_;
+        this->coeffDict().lookup("Awet") >> Awet_;
+        this->coeffDict().lookup("Cf") >> Cf_;
+    }
+}
 
 
 template<class CloudType>
@@ -49,8 +531,18 @@ Foam::ThermoSurfaceFilm<CloudType>::ThermoSurfaceFilm
 )
 :
     SurfaceFilmModel<CloudType>(sfm),
+    rndGen_(sfm.rndGen_),
+    thermo_(sfm.thermo_),
     TFilmPatch_(sfm.TFilmPatch_),
-    CpFilmPatch_(sfm.CpFilmPatch_)
+    CpFilmPatch_(sfm.CpFilmPatch_),
+    interactionType_(sfm.interactionType_),
+    deltaWet_(sfm.deltaWet_),
+    splashParcelType_(sfm.splashParcelType_),
+    parcelsPerSplash_(sfm.parcelsPerSplash_),
+    Adry_(sfm.Adry_),
+    Awet_(sfm.Awet_),
+    Cf_(sfm.Cf_),
+    nParcelsSplashed_(sfm.nParcelsSplashed_)
 {}
 
 
@@ -66,8 +558,9 @@ Foam::ThermoSurfaceFilm<CloudType>::~ThermoSurfaceFilm()
 template<class CloudType>
 bool Foam::ThermoSurfaceFilm<CloudType>::transferParcel
 (
-    const parcelType& p,
-    const label patchI
+    parcelType& p,
+    const polyPatch& pp,
+    bool& keepParticle
 )
 {
     // Retrieve the film model from the owner database
@@ -81,49 +574,61 @@ bool Foam::ThermoSurfaceFilm<CloudType>::transferParcel
                 )
         );
 
+    const label patchI = pp.index();
+
     if (filmModel.isFilmPatch(patchI))
     {
-        const polyPatch& pp = this->owner().mesh().boundaryMesh()[patchI];
-
         const label faceI = pp.whichFace(p.face());
 
-        // Patch face normal
-        const vector& nf = pp.faceNormals()[faceI];
-
-        // Relative parcel velocity
-        const vector Urel =
-            p.U() - this->owner().U().boundaryField()[patchI][faceI];
-
-        // Parcel mass
-        const scalar m = p.nParticle()*p.mass();
-
-        // Add the particle properties as sources to the film model
-        filmModel.addSources
-        (
-            patchI,
-            faceI,
-            m,                              // mass
-            m*(Urel - nf*(Urel & nf)),      // tangential momentum
-            m*mag(Urel & nf),               // impingement pressure
-            m*p.hs()                        // energy
-        );
-
-        if (debug)
+        switch (interactionType_)
         {
-            Info<< "ThermoSurfaceFilm<CloudType>::transferParcel:" << nl
-                << "    Effective increase in film height = "
-                << p.nParticle()*p.volume()/mag(pp.faceAreas()[faceI]) << endl;
+            case itBounce:
+            {
+                bounceInteraction(p, pp, faceI, keepParticle);
+
+                break;
+            }
+            case itAbsorb:
+            {
+                const scalar m = p.nParticle()*p.mass();
+                absorbInteraction(filmModel, p, pp, faceI, m, keepParticle);
+
+                break;
+            }
+            case itSplashBai:
+            {
+                bool dry = this->deltaFilmPatch_[patchI][faceI] < deltaWet_;
+
+                if (dry)
+                {
+                    drySplashInteraction(filmModel, p, pp, faceI, keepParticle);
+                }
+                else
+                {
+                    wetSplashInteraction(filmModel, p, pp, faceI, keepParticle);
+                }
+
+                break;
+            }
+            default:
+            {
+                FatalErrorIn
+                (
+                    "bool ThermoSurfaceFilm<CloudType>::transferParcel"
+                    "("
+                        "const parcelType&, "
+                        "const label"
+                    ")"
+                )   << "Unknown interaction type enumeration"
+                    << abort(FatalError);
+            }
         }
 
-        this->nParcelsTransferred()++;
-
-        // Flag to remove parcel p from owner cloud
         return true;
     }
-    else
-    {
-        return false;
-    }
+
+    // do not transfer parcel
+    return false;
 }
 
 
@@ -131,6 +636,7 @@ template<class CloudType>
 void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields
 (
     const label filmPatchI,
+    const label primaryPatchI,
     const mapDistribute& distMap,
     const surfaceFilmModels::surfaceFilmModel& filmModel
 )
@@ -138,6 +644,7 @@ void Foam::ThermoSurfaceFilm<CloudType>::cacheFilmFields
     SurfaceFilmModel<CloudType>::cacheFilmFields
     (
         filmPatchI,
+        primaryPatchI,
         distMap,
         filmModel
     );
@@ -168,10 +675,12 @@ void Foam::ThermoSurfaceFilm<CloudType>::setParcelProperties
 template<class CloudType>
 void Foam::ThermoSurfaceFilm<CloudType>::info(Ostream& os) const
 {
-    os  << "    Parcels transferred to film     = "
+    os  << "    Parcels absorbed into film      = "
         << returnReduce(this->nParcelsTransferred(), sumOp<label>()) << nl
-        << "    Number of film parcels added    = "
-        << returnReduce(this->nParcelsInjected(), sumOp<label>()) << nl;
+        << "    New film detached parcels       = "
+        << returnReduce(this->nParcelsInjected(), sumOp<label>()) << nl
+        << "    New film splash parcels         = "
+        << returnReduce(nParcelsSplashed_, sumOp<label>()) << nl;
 }
 
 
diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.H b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.H
index 74944fc58c4aa58401bde23bbe17d7c6a9f1f155..fa1b6a1af23025c8fe0d0e9e2b5fdc064da78d5f 100644
--- a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.H
+++ b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.H
@@ -27,6 +27,19 @@ Class
 Description
     Thermo parcel surface film model.
 
+    Responsible for:
+    - injecting parcelss from the film model into the cloud, e.g. for dripping
+    - parcel interaction with the film, e.g absorb, bounce, splash
+
+    Splash model references:
+
+        Bai and Gosman, `Mathematical modelling of wall films formed by
+        impinging sprays', SAE 960626, 1996
+
+        Bai et al, `Modelling off gasoline spray impingement', Atom. Sprays,
+        vol 12, pp 1-27, 2002
+
+
 SourceFiles
     ThermoSurfaceFilm.C
     ThermoSurfaceFilmI.H
@@ -52,6 +65,31 @@ class ThermoSurfaceFilm
 :
     public SurfaceFilmModel<CloudType>
 {
+public:
+
+    // Public data
+
+        //  Interaction type enumerations
+        enum interactionType
+        {
+            itAbsorb,
+            itBounce,
+            itSplashBai
+        };
+
+        //- Word descriptions of interaction type names
+        static wordList interactionTypeNames_;
+
+
+    // Public Member Functions
+
+        // Return interaction type enum from word
+        interactionType interactionTypeEnum(const word& it) const;
+
+        // Return word from interaction type enum
+        word interactionTypeStr(const interactionType& it) const;
+
+
 protected:
 
     // Protected data
@@ -59,6 +97,12 @@ protected:
         //- Convenience typedef to the cloud's parcel type
         typedef typename CloudType::parcelType parcelType;
 
+        //- Reference to the cloud random number generator
+        cachedRandom& rndGen_;
+
+        //- Reference to the cloud thermo package
+        const SLGThermo& thermo_;
+
 
        // Cached injector fields per film patch
 
@@ -69,24 +113,132 @@ protected:
             scalarList CpFilmPatch_;
 
 
-    // Protected functions
+        // Interaction model data
 
-        //- Cache the film fields in preparation for injection
-        virtual void cacheFilmFields
-        (
-            const label filmPatchI,
-            const mapDistribute& distMap,
-            const surfaceFilmModels::surfaceFilmModel& filmModel
-        );
+            //- Interaction type enumeration
+            interactionType interactionType_;
+
+            //- Film thickness beyond which patch is assumed to be wet
+            scalar deltaWet_;
+
+            //- Splash parcel type label - id assigned to identify parcel for
+            //  post-processing. If not specified, defaults to originating cloud
+            //  type
+            label splashParcelType_;
+
+            //- Number of new parcels resulting from splash event
+            label parcelsPerSplash_;
+
+
+            // Surface roughness coefficient typically in the range 1300 - 5200
+            // and decreases with increasing surface roughness
+
+                //- Dry surface roughness coefficient
+                //  = 2630 for dry interaction (ref. Bai)
+                scalar Adry_;
+
+                //- Wet surface roughness coefficient
+                //  = 1320 for wet interaction (ref. Bai)
+                scalar Awet_;
+
+
+            //- Skin friction typically in the range 0.6 < Cf < 0.8
+            scalar Cf_;
+
+            //- Counter for number of new splash parcels
+            label nParcelsSplashed_;
 
-        //- Set the individual parcel properties
-        virtual void setParcelProperties
+
+    // Protected Member Functions
+
+        //- Return a vector tangential to input vector, v
+        vector tangentVector(const vector& v) const;
+
+        //- Return splashed parcel direction
+        vector splashDirection
         (
-            parcelType& p,
-            const label filmFaceI
+            const vector& tanVec1,
+            const vector& tanVec2,
+            const vector& nf
         ) const;
 
 
+        // Interaction models
+
+            //- Absorb parcel into film
+            void absorbInteraction
+            (
+                surfaceFilmModels::surfaceFilmModel& filmModel,
+                const parcelType& p,
+                const polyPatch& pp,
+                const label faceI,
+                const scalar mass,
+                bool& keepParticle
+            );
+
+            //- Bounce parcel (flip parcel normal velocity)
+            void bounceInteraction
+            (
+                parcelType& p,
+                const polyPatch& pp,
+                const label faceI,
+                bool& keepParticle
+            ) const;
+
+            //- Parcel interaction with dry surface
+            void drySplashInteraction
+            (
+                surfaceFilmModels::surfaceFilmModel& filmModel,
+                const parcelType& p,
+                const polyPatch& pp,
+                const label faceI,
+                bool& keepParticle
+            );
+
+            //- Parcel interaction with wetted surface
+            void wetSplashInteraction
+            (
+                surfaceFilmModels::surfaceFilmModel& filmModel,
+                parcelType& p,
+                const polyPatch& pp,
+                const label faceI,
+                bool& keepParticle
+            );
+
+            //- Bai parcel splash interaction model
+            void splashInteraction
+            (
+                surfaceFilmModels::surfaceFilmModel& filmModel,
+                const parcelType& p,
+                const polyPatch& pp,
+                const label faceI,
+                const scalar mRatio,
+                const scalar We,
+                const scalar Wec,
+                const scalar sigma,
+                bool& keepParticle
+            );
+
+
+        // Injection from sheet (ejection) helper functions
+
+            //- Cache the film fields in preparation for injection
+            virtual void cacheFilmFields
+            (
+                const label filmPatchI,
+                const label primaryPatchI,
+                const mapDistribute& distMap,
+                const surfaceFilmModels::surfaceFilmModel& filmModel
+            );
+
+            //- Set the individual parcel properties
+            virtual void setParcelProperties
+            (
+                parcelType& p,
+                const label filmFaceI
+            ) const;
+
+
 public:
 
     //- Runtime type information
@@ -128,8 +280,9 @@ public:
             //  Returns true if parcel is to be transferred
             virtual bool transferParcel
             (
-                const parcelType& p,
-                const label patchI
+                parcelType& p,
+                const polyPatch& pp,
+                bool& keepParticle
             );
 
 
diff --git a/src/parallel/reconstruct/reconstruct/fvFieldReconstructorReconstructFields.C b/src/parallel/reconstruct/reconstruct/fvFieldReconstructorReconstructFields.C
index def5b3b1cd5d56d1925efb5e09a0243330ac3fba..50ea4dd9dc89eab05221887e113c0ef9b180d657 100644
--- a/src/parallel/reconstruct/reconstruct/fvFieldReconstructorReconstructFields.C
+++ b/src/parallel/reconstruct/reconstruct/fvFieldReconstructorReconstructFields.C
@@ -539,7 +539,7 @@ void Foam::fvFieldReconstructor::reconstructFvVolumeInternalFields
         {
             if
             (
-                !selectedFields.size()
+                selectedFields.empty()
              || selectedFields.found(fieldIter()->name())
             )
             {
@@ -575,7 +575,7 @@ void Foam::fvFieldReconstructor::reconstructFvVolumeFields
         {
             if
             (
-                !selectedFields.size()
+                selectedFields.empty()
              || selectedFields.found(fieldIter()->name())
             )
             {
@@ -611,7 +611,7 @@ void Foam::fvFieldReconstructor::reconstructFvSurfaceFields
         {
             if
             (
-                !selectedFields.size()
+                selectedFields.empty()
              || selectedFields.found(fieldIter()->name())
             )
             {
diff --git a/src/parallel/reconstruct/reconstruct/reconstructLagrangian.H b/src/parallel/reconstruct/reconstruct/reconstructLagrangian.H
index 6107e9f3694df76df5bb7a8d81512a070b4efcba..68d141806319dd8fcb729ce0a66dd4e0dbcefd1b 100644
--- a/src/parallel/reconstruct/reconstruct/reconstructLagrangian.H
+++ b/src/parallel/reconstruct/reconstruct/reconstructLagrangian.H
@@ -84,7 +84,8 @@ void reconstructLagrangianFields
     const word& cloudName,
     const polyMesh& mesh,
     const PtrList<fvMesh>& meshes,
-    const IOobjectList& objects
+    const IOobjectList& objects,
+    const HashSet<word>& selectedFields
 );
 
 
@@ -94,7 +95,8 @@ void reconstructLagrangianFieldFields
     const word& cloudName,
     const polyMesh& mesh,
     const PtrList<fvMesh>& meshes,
-    const IOobjectList& objects
+    const IOobjectList& objects,
+    const HashSet<word>& selectedFields
 );
 
 
diff --git a/src/parallel/reconstruct/reconstruct/reconstructLagrangianFields.C b/src/parallel/reconstruct/reconstruct/reconstructLagrangianFields.C
index 9fa92b8cedcd010ab322415f3d9f8a02e58ffc51..88659b05bc4f11b2165c4ca5e84b01aed2f0b722 100644
--- a/src/parallel/reconstruct/reconstruct/reconstructLagrangianFields.C
+++ b/src/parallel/reconstruct/reconstruct/reconstructLagrangianFields.C
@@ -155,28 +155,36 @@ void Foam::reconstructLagrangianFields
     const word& cloudName,
     const polyMesh& mesh,
     const PtrList<fvMesh>& meshes,
-    const IOobjectList& objects
+    const IOobjectList& objects,
+    const HashSet<word>& selectedFields
 )
 {
     const word fieldClassName(IOField<Type>::typeName);
 
     IOobjectList fields = objects.lookupClass(fieldClassName);
 
-    if (fields.size())
+    if(fields.size())
     {
         Info<< "    Reconstructing lagrangian "
             << fieldClassName << "s\n" << endl;
 
         forAllConstIter(IOobjectList, fields, fieldIter)
         {
-            Info<< "        " << fieldIter()->name() << endl;
-            reconstructLagrangianField<Type>
+            if
             (
-                cloudName,
-                mesh,
-                meshes,
-                fieldIter()->name()
-            )().write();
+                selectedFields.empty()
+             || selectedFields.found(fieldIter()->name())
+            )
+            {
+                Info<< "        " << fieldIter()->name() << endl;
+                reconstructLagrangianField<Type>
+                (
+                    cloudName,
+                    mesh,
+                    meshes,
+                    fieldIter()->name()
+                )().write();
+            }
         }
 
         Info<< endl;
@@ -190,7 +198,8 @@ void Foam::reconstructLagrangianFieldFields
     const word& cloudName,
     const polyMesh& mesh,
     const PtrList<fvMesh>& meshes,
-    const IOobjectList& objects
+    const IOobjectList& objects,
+    const HashSet<word>& selectedFields
 )
 {
     {
@@ -205,14 +214,21 @@ void Foam::reconstructLagrangianFieldFields
 
             forAllConstIter(IOobjectList, fields, fieldIter)
             {
-                Info<< "        " << fieldIter()->name() << endl;
-                reconstructLagrangianFieldField<Type>
+                if
                 (
-                    cloudName,
-                    mesh,
-                    meshes,
-                    fieldIter()->name()
-                )().write();
+                    selectedFields.empty()
+                 || selectedFields.found(fieldIter()->name())
+                )
+                {
+                    Info<< "        " << fieldIter()->name() << endl;
+                    reconstructLagrangianFieldField<Type>
+                    (
+                        cloudName,
+                        mesh,
+                        meshes,
+                        fieldIter()->name()
+                    )().write();
+                }
             }
 
             Info<< endl;
@@ -231,14 +247,21 @@ void Foam::reconstructLagrangianFieldFields
 
             forAllConstIter(IOobjectList, fields, fieldIter)
             {
-                Info<< "        " << fieldIter()->name() << endl;
-                reconstructLagrangianFieldField<Type>
+                if
                 (
-                    cloudName,
-                    mesh,
-                    meshes,
-                    fieldIter()->name()
-                )().write();
+                    selectedFields.empty()
+                 || selectedFields.found(fieldIter()->name())
+                )
+                {
+                    Info<< "        " << fieldIter()->name() << endl;
+                    reconstructLagrangianFieldField<Type>
+                    (
+                        cloudName,
+                        mesh,
+                        meshes,
+                        fieldIter()->name()
+                    )().write();
+                }
             }
 
             Info<< endl;
diff --git a/src/sampling/sampledSurface/distanceSurface/distanceSurface.C b/src/sampling/sampledSurface/distanceSurface/distanceSurface.C
index 4a4c9219d690dcb106b3b409f6994f535d5d65f1..450384506a79664ba333bbc5f1450d4f95c40787 100644
--- a/src/sampling/sampledSurface/distanceSurface/distanceSurface.C
+++ b/src/sampling/sampledSurface/distanceSurface/distanceSurface.C
@@ -393,8 +393,7 @@ bool Foam::distanceSurface::update()
 }
 
 
-Foam::tmp<Foam::scalarField>
-Foam::distanceSurface::sample
+Foam::tmp<Foam::scalarField> Foam::distanceSurface::sample
 (
     const volScalarField& vField
 ) const
@@ -403,8 +402,7 @@ Foam::distanceSurface::sample
 }
 
 
-Foam::tmp<Foam::vectorField>
-Foam::distanceSurface::sample
+Foam::tmp<Foam::vectorField> Foam::distanceSurface::sample
 (
     const volVectorField& vField
 ) const
@@ -413,8 +411,7 @@ Foam::distanceSurface::sample
 }
 
 
-Foam::tmp<Foam::sphericalTensorField>
-Foam::distanceSurface::sample
+Foam::tmp<Foam::sphericalTensorField> Foam::distanceSurface::sample
 (
     const volSphericalTensorField& vField
 ) const
@@ -423,8 +420,7 @@ Foam::distanceSurface::sample
 }
 
 
-Foam::tmp<Foam::symmTensorField>
-Foam::distanceSurface::sample
+Foam::tmp<Foam::symmTensorField> Foam::distanceSurface::sample
 (
     const volSymmTensorField& vField
 ) const
@@ -433,8 +429,7 @@ Foam::distanceSurface::sample
 }
 
 
-Foam::tmp<Foam::tensorField>
-Foam::distanceSurface::sample
+Foam::tmp<Foam::tensorField> Foam::distanceSurface::sample
 (
     const volTensorField& vField
 ) const
@@ -443,8 +438,7 @@ Foam::distanceSurface::sample
 }
 
 
-Foam::tmp<Foam::scalarField>
-Foam::distanceSurface::interpolate
+Foam::tmp<Foam::scalarField> Foam::distanceSurface::interpolate
 (
     const interpolation<scalar>& interpolator
 ) const
@@ -453,8 +447,7 @@ Foam::distanceSurface::interpolate
 }
 
 
-Foam::tmp<Foam::vectorField>
-Foam::distanceSurface::interpolate
+Foam::tmp<Foam::vectorField> Foam::distanceSurface::interpolate
 (
     const interpolation<vector>& interpolator
 ) const
@@ -462,8 +455,7 @@ Foam::distanceSurface::interpolate
     return interpolateField(interpolator);
 }
 
-Foam::tmp<Foam::sphericalTensorField>
-Foam::distanceSurface::interpolate
+Foam::tmp<Foam::sphericalTensorField> Foam::distanceSurface::interpolate
 (
     const interpolation<sphericalTensor>& interpolator
 ) const
@@ -472,8 +464,7 @@ Foam::distanceSurface::interpolate
 }
 
 
-Foam::tmp<Foam::symmTensorField>
-Foam::distanceSurface::interpolate
+Foam::tmp<Foam::symmTensorField> Foam::distanceSurface::interpolate
 (
     const interpolation<symmTensor>& interpolator
 ) const
@@ -482,8 +473,7 @@ Foam::distanceSurface::interpolate
 }
 
 
-Foam::tmp<Foam::tensorField>
-Foam::distanceSurface::interpolate
+Foam::tmp<Foam::tensorField> Foam::distanceSurface::interpolate
 (
     const interpolation<tensor>& interpolator
 ) const
diff --git a/src/sampling/sampledSurface/sampledPatch/sampledPatch.C b/src/sampling/sampledSurface/sampledPatch/sampledPatch.C
index 9ed86afef8a9f63d6d9c942a96b59662e0ba1524..52e00080130f414019b66bf3659bc4f7d5caa4c3 100644
--- a/src/sampling/sampledSurface/sampledPatch/sampledPatch.C
+++ b/src/sampling/sampledSurface/sampledPatch/sampledPatch.C
@@ -162,8 +162,7 @@ void Foam::sampledPatch::remapFaces
 
 
 
-Foam::tmp<Foam::scalarField>
-Foam::sampledPatch::sample
+Foam::tmp<Foam::scalarField> Foam::sampledPatch::sample
 (
     const volScalarField& vField
 ) const
@@ -172,8 +171,7 @@ Foam::sampledPatch::sample
 }
 
 
-Foam::tmp<Foam::vectorField>
-Foam::sampledPatch::sample
+Foam::tmp<Foam::vectorField> Foam::sampledPatch::sample
 (
     const volVectorField& vField
 ) const
@@ -181,8 +179,7 @@ Foam::sampledPatch::sample
     return sampleField(vField);
 }
 
-Foam::tmp<Foam::sphericalTensorField>
-Foam::sampledPatch::sample
+Foam::tmp<Foam::sphericalTensorField> Foam::sampledPatch::sample
 (
     const volSphericalTensorField& vField
 ) const
@@ -191,8 +188,7 @@ Foam::sampledPatch::sample
 }
 
 
-Foam::tmp<Foam::symmTensorField>
-Foam::sampledPatch::sample
+Foam::tmp<Foam::symmTensorField> Foam::sampledPatch::sample
 (
     const volSymmTensorField& vField
 ) const
@@ -201,8 +197,7 @@ Foam::sampledPatch::sample
 }
 
 
-Foam::tmp<Foam::tensorField>
-Foam::sampledPatch::sample
+Foam::tmp<Foam::tensorField> Foam::sampledPatch::sample
 (
     const volTensorField& vField
 ) const
@@ -211,8 +206,7 @@ Foam::sampledPatch::sample
 }
 
 
-Foam::tmp<Foam::scalarField>
-Foam::sampledPatch::interpolate
+Foam::tmp<Foam::scalarField> Foam::sampledPatch::interpolate
 (
     const interpolation<scalar>& interpolator
 ) const
@@ -221,8 +215,7 @@ Foam::sampledPatch::interpolate
 }
 
 
-Foam::tmp<Foam::vectorField>
-Foam::sampledPatch::interpolate
+Foam::tmp<Foam::vectorField> Foam::sampledPatch::interpolate
 (
     const interpolation<vector>& interpolator
 ) const
@@ -230,8 +223,7 @@ Foam::sampledPatch::interpolate
     return interpolateField(interpolator);
 }
 
-Foam::tmp<Foam::sphericalTensorField>
-Foam::sampledPatch::interpolate
+Foam::tmp<Foam::sphericalTensorField> Foam::sampledPatch::interpolate
 (
     const interpolation<sphericalTensor>& interpolator
 ) const
@@ -240,8 +232,7 @@ Foam::sampledPatch::interpolate
 }
 
 
-Foam::tmp<Foam::symmTensorField>
-Foam::sampledPatch::interpolate
+Foam::tmp<Foam::symmTensorField> Foam::sampledPatch::interpolate
 (
     const interpolation<symmTensor>& interpolator
 ) const
@@ -250,8 +241,7 @@ Foam::sampledPatch::interpolate
 }
 
 
-Foam::tmp<Foam::tensorField>
-Foam::sampledPatch::interpolate
+Foam::tmp<Foam::tensorField> Foam::sampledPatch::interpolate
 (
     const interpolation<tensor>& interpolator
 ) const
diff --git a/src/sampling/sampledSurface/sampledPlane/sampledPlane.C b/src/sampling/sampledSurface/sampledPlane/sampledPlane.C
index 6c8e0f91a7a0ecd4cf90c08f830c20782cfea183..1147b8ec1ac18a13b04ee98a0c0d0fdb70aba77a 100644
--- a/src/sampling/sampledSurface/sampledPlane/sampledPlane.C
+++ b/src/sampling/sampledSurface/sampledPlane/sampledPlane.C
@@ -156,8 +156,7 @@ bool Foam::sampledPlane::update()
 }
 
 
-Foam::tmp<Foam::scalarField>
-Foam::sampledPlane::sample
+Foam::tmp<Foam::scalarField> Foam::sampledPlane::sample
 (
     const volScalarField& vField
 ) const
@@ -166,8 +165,7 @@ Foam::sampledPlane::sample
 }
 
 
-Foam::tmp<Foam::vectorField>
-Foam::sampledPlane::sample
+Foam::tmp<Foam::vectorField> Foam::sampledPlane::sample
 (
     const volVectorField& vField
 ) const
@@ -176,8 +174,7 @@ Foam::sampledPlane::sample
 }
 
 
-Foam::tmp<Foam::sphericalTensorField>
-Foam::sampledPlane::sample
+Foam::tmp<Foam::sphericalTensorField> Foam::sampledPlane::sample
 (
     const volSphericalTensorField& vField
 ) const
@@ -186,8 +183,7 @@ Foam::sampledPlane::sample
 }
 
 
-Foam::tmp<Foam::symmTensorField>
-Foam::sampledPlane::sample
+Foam::tmp<Foam::symmTensorField> Foam::sampledPlane::sample
 (
     const volSymmTensorField& vField
 ) const
@@ -196,8 +192,7 @@ Foam::sampledPlane::sample
 }
 
 
-Foam::tmp<Foam::tensorField>
-Foam::sampledPlane::sample
+Foam::tmp<Foam::tensorField> Foam::sampledPlane::sample
 (
     const volTensorField& vField
 ) const
@@ -206,8 +201,7 @@ Foam::sampledPlane::sample
 }
 
 
-Foam::tmp<Foam::scalarField>
-Foam::sampledPlane::interpolate
+Foam::tmp<Foam::scalarField> Foam::sampledPlane::interpolate
 (
     const interpolation<scalar>& interpolator
 ) const
@@ -216,8 +210,7 @@ Foam::sampledPlane::interpolate
 }
 
 
-Foam::tmp<Foam::vectorField>
-Foam::sampledPlane::interpolate
+Foam::tmp<Foam::vectorField> Foam::sampledPlane::interpolate
 (
     const interpolation<vector>& interpolator
 ) const
@@ -225,8 +218,7 @@ Foam::sampledPlane::interpolate
     return interpolateField(interpolator);
 }
 
-Foam::tmp<Foam::sphericalTensorField>
-Foam::sampledPlane::interpolate
+Foam::tmp<Foam::sphericalTensorField> Foam::sampledPlane::interpolate
 (
     const interpolation<sphericalTensor>& interpolator
 ) const
@@ -235,8 +227,7 @@ Foam::sampledPlane::interpolate
 }
 
 
-Foam::tmp<Foam::symmTensorField>
-Foam::sampledPlane::interpolate
+Foam::tmp<Foam::symmTensorField> Foam::sampledPlane::interpolate
 (
     const interpolation<symmTensor>& interpolator
 ) const
@@ -245,8 +236,7 @@ Foam::sampledPlane::interpolate
 }
 
 
-Foam::tmp<Foam::tensorField>
-Foam::sampledPlane::interpolate
+Foam::tmp<Foam::tensorField> Foam::sampledPlane::interpolate
 (
     const interpolation<tensor>& interpolator
 ) const
diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C
index ec4a413ad799e5f7a885b925d8281090d4a85588..5cb11429d2ddae130260ac6e7ed21eceda5ba159 100644
--- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.C
+++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.C
@@ -191,6 +191,7 @@ Foam::sampledSurface::~sampledSurface()
     clearGeom();
 }
 
+
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 const Foam::vectorField& Foam::sampledSurface::Sf() const
@@ -238,7 +239,6 @@ Foam::scalar Foam::sampledSurface::area() const
 }
 
 
-// do not project scalar - just copy values
 Foam::tmp<Foam::Field<Foam::scalar> >
 Foam::sampledSurface::project(const Field<scalar>& field) const
 {
@@ -295,6 +295,7 @@ void Foam::sampledSurface::print(Ostream& os) const
     os << type();
 }
 
+
 // * * * * * * * * * * * * * * * Friend Operators  * * * * * * * * * * * * * //
 
 Foam::Ostream& Foam::operator<<(Ostream &os, const sampledSurface& s)
@@ -304,4 +305,5 @@ Foam::Ostream& Foam::operator<<(Ostream &os, const sampledSurface& s)
     return os;
 }
 
+
 // ************************************************************************* //
diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurface.H b/src/sampling/sampledSurface/sampledSurface/sampledSurface.H
index c3967e298920761687d8688c58129fe3f6a0b658..e79fd0cfd7e5b01f84e3ad39f70938a7cdbc6aee 100644
--- a/src/sampling/sampledSurface/sampledSurface/sampledSurface.H
+++ b/src/sampling/sampledSurface/sampledSurface/sampledSurface.H
@@ -98,6 +98,7 @@ class sampledSurface
         //- Total surface area
         mutable scalar area_;
 
+
     // Make geometric data
 
         //- Make Sf
@@ -109,6 +110,7 @@ class sampledSurface
         //- Make Cf
         void makeCf() const;
 
+
     // Service methods
 
         //- Check field size matches surface size
@@ -135,33 +137,36 @@ class sampledSurface
         template<class ReturnType, class Type>
         tmp<Field<ReturnType> > project(const tmp<Field<Type> >&) const;
 
+
 protected:
 
     // Protected Member functions
 
         virtual void clearGeom() const;
 
+
 public:
 
     //- Runtime type information
-      TypeName("sampledSurface");
-
+    TypeName("sampledSurface");
 
-    // Declare run-time constructor selection table
 
-        declareRunTimeSelectionTable
+    //- Declare run-time constructor selection table
+    declareRunTimeSelectionTable
+    (
+        autoPtr,
+        sampledSurface,
+        word,
         (
-            autoPtr,
-            sampledSurface,
-            word,
-            (
-                const word& name,
-                const polyMesh& mesh,
-                const dictionary& dict
-            ),
-            (name, mesh, dict)
-        );
+            const word& name,
+            const polyMesh& mesh,
+            const dictionary& dict
+        ),
+        (name, mesh, dict)
+    );
+
 
+    // iNew helper class
 
         //- Class used for the PtrLists read-construction
         class iNew
@@ -260,7 +265,6 @@ public:
         //  Do nothing (and return false) if no update was required
         virtual bool update() = 0;
 
-
         //- Points of surface
         virtual const pointField& points() const = 0;
 
@@ -394,9 +398,7 @@ public:
         //- Write
         virtual void print(Ostream&) const;
 
-
-       // IOstream operators
-
+        //- Ostream operator
         friend Ostream& operator<<(Ostream&, const sampledSurface&);
 };
 
diff --git a/src/sampling/sampledSurface/sampledSurface/sampledSurfaceTemplates.C b/src/sampling/sampledSurface/sampledSurface/sampledSurfaceTemplates.C
index adc018a00e2873c0a8fef6c3d792665b42a51d9a..9d52bbe457248a13975db43594cb720bd74b0660 100644
--- a/src/sampling/sampledSurface/sampledSurface/sampledSurfaceTemplates.C
+++ b/src/sampling/sampledSurface/sampledSurface/sampledSurfaceTemplates.C
@@ -56,7 +56,7 @@ Type Foam::sampledSurface::integrate(const Field<Type>& field) const
 
     if (checkFieldSize(field))
     {
-        value = sum(field * magSf());
+        value = sum(field*magSf());
     }
 
     reduce(value, sumOp<Type>());
@@ -80,7 +80,7 @@ Type Foam::sampledSurface::average(const Field<Type>& field) const
 
     if (checkFieldSize(field))
     {
-        value = sum(field * magSf());
+        value = sum(field*magSf());
     }
 
     reduce(value, sumOp<Type>());
@@ -88,7 +88,7 @@ Type Foam::sampledSurface::average(const Field<Type>& field) const
     // avoid divide-by-zero
     if (area())
     {
-        return value / area();
+        return value/area();
     }
     else
     {
@@ -119,7 +119,7 @@ void Foam::sampledSurface::project
 
         forAll(norm, faceI)
         {
-            res[faceI] = field[faceI] & (norm[faceI] / mag(norm[faceI]));
+            res[faceI] = field[faceI] & (norm[faceI]/mag(norm[faceI]));
         }
     }
     else
@@ -208,5 +208,4 @@ Foam::sampledSurface::pointAverage
 }
 
 
-
 // ************************************************************************* //
diff --git a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C
index b117a4b2916e8ce97efac2759b293093e53dc366..e846221ce8243b9c9adc3591aef918a2af8fcdf4 100644
--- a/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C
+++ b/src/sampling/sampledSurface/sampledTriSurfaceMesh/sampledTriSurfaceMesh.C
@@ -301,8 +301,7 @@ bool Foam::sampledTriSurfaceMesh::update()
 }
 
 
-Foam::tmp<Foam::scalarField>
-Foam::sampledTriSurfaceMesh::sample
+Foam::tmp<Foam::scalarField> Foam::sampledTriSurfaceMesh::sample
 (
     const volScalarField& vField
 ) const
@@ -311,8 +310,7 @@ Foam::sampledTriSurfaceMesh::sample
 }
 
 
-Foam::tmp<Foam::vectorField>
-Foam::sampledTriSurfaceMesh::sample
+Foam::tmp<Foam::vectorField> Foam::sampledTriSurfaceMesh::sample
 (
     const volVectorField& vField
 ) const
@@ -320,8 +318,7 @@ Foam::sampledTriSurfaceMesh::sample
     return sampleField(vField);
 }
 
-Foam::tmp<Foam::sphericalTensorField>
-Foam::sampledTriSurfaceMesh::sample
+Foam::tmp<Foam::sphericalTensorField> Foam::sampledTriSurfaceMesh::sample
 (
     const volSphericalTensorField& vField
 ) const
@@ -330,8 +327,7 @@ Foam::sampledTriSurfaceMesh::sample
 }
 
 
-Foam::tmp<Foam::symmTensorField>
-Foam::sampledTriSurfaceMesh::sample
+Foam::tmp<Foam::symmTensorField> Foam::sampledTriSurfaceMesh::sample
 (
     const volSymmTensorField& vField
 ) const
@@ -340,8 +336,7 @@ Foam::sampledTriSurfaceMesh::sample
 }
 
 
-Foam::tmp<Foam::tensorField>
-Foam::sampledTriSurfaceMesh::sample
+Foam::tmp<Foam::tensorField> Foam::sampledTriSurfaceMesh::sample
 (
     const volTensorField& vField
 ) const
@@ -350,8 +345,7 @@ Foam::sampledTriSurfaceMesh::sample
 }
 
 
-Foam::tmp<Foam::scalarField>
-Foam::sampledTriSurfaceMesh::interpolate
+Foam::tmp<Foam::scalarField> Foam::sampledTriSurfaceMesh::interpolate
 (
     const interpolation<scalar>& interpolator
 ) const
@@ -360,8 +354,7 @@ Foam::sampledTriSurfaceMesh::interpolate
 }
 
 
-Foam::tmp<Foam::vectorField>
-Foam::sampledTriSurfaceMesh::interpolate
+Foam::tmp<Foam::vectorField> Foam::sampledTriSurfaceMesh::interpolate
 (
     const interpolation<vector>& interpolator
 ) const
@@ -369,8 +362,7 @@ Foam::sampledTriSurfaceMesh::interpolate
     return interpolateField(interpolator);
 }
 
-Foam::tmp<Foam::sphericalTensorField>
-Foam::sampledTriSurfaceMesh::interpolate
+Foam::tmp<Foam::sphericalTensorField> Foam::sampledTriSurfaceMesh::interpolate
 (
     const interpolation<sphericalTensor>& interpolator
 ) const
@@ -379,8 +371,7 @@ Foam::sampledTriSurfaceMesh::interpolate
 }
 
 
-Foam::tmp<Foam::symmTensorField>
-Foam::sampledTriSurfaceMesh::interpolate
+Foam::tmp<Foam::symmTensorField> Foam::sampledTriSurfaceMesh::interpolate
 (
     const interpolation<symmTensor>& interpolator
 ) const
@@ -389,8 +380,7 @@ Foam::sampledTriSurfaceMesh::interpolate
 }
 
 
-Foam::tmp<Foam::tensorField>
-Foam::sampledTriSurfaceMesh::interpolate
+Foam::tmp<Foam::tensorField> Foam::sampledTriSurfaceMesh::interpolate
 (
     const interpolation<tensor>& interpolator
 ) const
diff --git a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C
index 3c2d6b1b1c91d8d7d3ea469d0bac96b788d44a5a..0d9e1312ab7fdd1cec1ccffd92b5130e2dd83c4a 100644
--- a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C
+++ b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.C
@@ -215,8 +215,7 @@ bool Foam::sampledThresholdCellFaces::update()
 }
 
 
-Foam::tmp<Foam::scalarField>
-Foam::sampledThresholdCellFaces::sample
+Foam::tmp<Foam::scalarField> Foam::sampledThresholdCellFaces::sample
 (
     const volScalarField& vField
 ) const
@@ -225,8 +224,7 @@ Foam::sampledThresholdCellFaces::sample
 }
 
 
-Foam::tmp<Foam::vectorField>
-Foam::sampledThresholdCellFaces::sample
+Foam::tmp<Foam::vectorField> Foam::sampledThresholdCellFaces::sample
 (
     const volVectorField& vField
 ) const
@@ -235,8 +233,7 @@ Foam::sampledThresholdCellFaces::sample
 }
 
 
-Foam::tmp<Foam::sphericalTensorField>
-Foam::sampledThresholdCellFaces::sample
+Foam::tmp<Foam::sphericalTensorField> Foam::sampledThresholdCellFaces::sample
 (
     const volSphericalTensorField& vField
 ) const
@@ -245,8 +242,7 @@ Foam::sampledThresholdCellFaces::sample
 }
 
 
-Foam::tmp<Foam::symmTensorField>
-Foam::sampledThresholdCellFaces::sample
+Foam::tmp<Foam::symmTensorField> Foam::sampledThresholdCellFaces::sample
 (
     const volSymmTensorField& vField
 ) const
@@ -255,8 +251,7 @@ Foam::sampledThresholdCellFaces::sample
 }
 
 
-Foam::tmp<Foam::tensorField>
-Foam::sampledThresholdCellFaces::sample
+Foam::tmp<Foam::tensorField> Foam::sampledThresholdCellFaces::sample
 (
     const volTensorField& vField
 ) const
@@ -265,8 +260,7 @@ Foam::sampledThresholdCellFaces::sample
 }
 
 
-Foam::tmp<Foam::scalarField>
-Foam::sampledThresholdCellFaces::interpolate
+Foam::tmp<Foam::scalarField> Foam::sampledThresholdCellFaces::interpolate
 (
     const interpolation<scalar>& interpolator
 ) const
@@ -275,8 +269,7 @@ Foam::sampledThresholdCellFaces::interpolate
 }
 
 
-Foam::tmp<Foam::vectorField>
-Foam::sampledThresholdCellFaces::interpolate
+Foam::tmp<Foam::vectorField> Foam::sampledThresholdCellFaces::interpolate
 (
     const interpolation<vector>& interpolator
 ) const
@@ -294,8 +287,7 @@ Foam::sampledThresholdCellFaces::interpolate
 }
 
 
-Foam::tmp<Foam::symmTensorField>
-Foam::sampledThresholdCellFaces::interpolate
+Foam::tmp<Foam::symmTensorField> Foam::sampledThresholdCellFaces::interpolate
 (
     const interpolation<symmTensor>& interpolator
 ) const
@@ -304,8 +296,7 @@ Foam::sampledThresholdCellFaces::interpolate
 }
 
 
-Foam::tmp<Foam::tensorField>
-Foam::sampledThresholdCellFaces::interpolate
+Foam::tmp<Foam::tensorField> Foam::sampledThresholdCellFaces::interpolate
 (
     const interpolation<tensor>& interpolator
 ) const
diff --git a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H
index 47204a856de1b81d368e7b11a02c465d58f36eab..89317f09cd45600d3d63120d913adc1432a99c22 100644
--- a/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H
+++ b/src/sampling/sampledSurface/thresholdCellFaces/sampledThresholdCellFaces.H
@@ -136,7 +136,6 @@ public:
         //  Do nothing (and return false) if no update was needed
         virtual bool update();
 
-
         //- Points of surface
         virtual const pointField& points() const
         {
@@ -150,16 +149,10 @@ public:
         }
 
         //- sample field on surface
-        virtual tmp<scalarField> sample
-        (
-            const volScalarField&
-        ) const;
+        virtual tmp<scalarField> sample(const volScalarField&) const;
 
         //- sample field on surface
-        virtual tmp<vectorField> sample
-        (
-            const volVectorField&
-        ) const;
+        virtual tmp<vectorField> sample( const volVectorField&) const;
 
         //- sample field on surface
         virtual tmp<sphericalTensorField> sample
@@ -168,10 +161,7 @@ public:
         ) const;
 
         //- sample field on surface
-        virtual tmp<symmTensorField> sample
-        (
-            const volSymmTensorField&
-        ) const;
+        virtual tmp<symmTensorField> sample(const volSymmTensorField&) const;
 
         //- sample field on surface
         virtual tmp<tensorField> sample
@@ -179,7 +169,6 @@ public:
             const volTensorField&
         ) const;
 
-
         //- interpolate field on surface
         virtual tmp<scalarField> interpolate
         (
diff --git a/src/surfaceFilmModels/surfaceFilmModel/noFilm/noFilm.C b/src/surfaceFilmModels/surfaceFilmModel/noFilm/noFilm.C
index 619226bb8ff1f9f09e66c10debddeed8a0ffa1bc..63ea47880d65439b57aee75ca12a946bdfb5d87f 100644
--- a/src/surfaceFilmModels/surfaceFilmModel/noFilm/noFilm.C
+++ b/src/surfaceFilmModels/surfaceFilmModel/noFilm/noFilm.C
@@ -136,9 +136,17 @@ void Foam::surfaceFilmModels::noFilm::addSources
 }
 
 
+const Foam::volScalarField& Foam::surfaceFilmModels::noFilm::delta() const
+{
+    FatalErrorIn("const volScalarField& noFilm::delta() const")
+        << "delta field not available for " << type() << abort(FatalError);
+
+    return volScalarField::null();
+}
+
 const Foam::volVectorField& Foam::surfaceFilmModels::noFilm::U() const
 {
-    FatalErrorIn("const volScalarField& noFilm::U() const")
+    FatalErrorIn("const volVectorField& noFilm::U() const")
         << "U field not available for " << type() << abort(FatalError);
 
     return volVectorField::null();
@@ -147,7 +155,7 @@ const Foam::volVectorField& Foam::surfaceFilmModels::noFilm::U() const
 
 const Foam::volVectorField& Foam::surfaceFilmModels::noFilm::Us() const
 {
-    FatalErrorIn("const volScalarField& noFilm::Us() const")
+    FatalErrorIn("const volVectorField& noFilm::Us() const")
         << "Us field not available for " << type() << abort(FatalError);
 
     return volVectorField::null();
@@ -156,7 +164,7 @@ const Foam::volVectorField& Foam::surfaceFilmModels::noFilm::Us() const
 
 const Foam::volVectorField& Foam::surfaceFilmModels::noFilm::Uw() const
 {
-    FatalErrorIn("const volScalarField& noFilm::Uw() const")
+    FatalErrorIn("const volVectorField& noFilm::Uw() const")
         << "Uw field not available for " << type() << abort(FatalError);
 
     return volVectorField::null();
diff --git a/src/surfaceFilmModels/surfaceFilmModel/noFilm/noFilm.H b/src/surfaceFilmModels/surfaceFilmModel/noFilm/noFilm.H
index 7c3d7f89d91d61986d178e0a598c4c07489fe7ac..40726066ac0be26b29bb344c097e0427eb41236e 100644
--- a/src/surfaceFilmModels/surfaceFilmModel/noFilm/noFilm.H
+++ b/src/surfaceFilmModels/surfaceFilmModel/noFilm/noFilm.H
@@ -126,6 +126,9 @@ public:
 
        // Fields
 
+           //- Return the film thickness [m]
+           virtual const volScalarField& delta() const;
+
            //- Return the film velocity [m/s]
            virtual const volVectorField& U() const;
 
diff --git a/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.H b/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.H
index 511a6204e4a9b65bc6ac3b95151522c9dfa2ea13..079f538c833d24d4b9ae20930437a4a3a071ca3f 100644
--- a/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.H
+++ b/src/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel/surfaceFilmModel.H
@@ -220,6 +220,9 @@ public:
 
        // Fields
 
+           //- Return the film thickness [m]
+           virtual const volScalarField& delta() const = 0;
+
            //- Return the film velocity [m/s]
            virtual const volVectorField& U() const = 0;
 
diff --git a/wmake/MakefileApps b/wmake/MakefileApps
index fcf4c9eb8cff853c858cd2ab10ced29e9f005e8c..3d23644558f503ec10e80600fd1b161105525962 100644
--- a/wmake/MakefileApps
+++ b/wmake/MakefileApps
@@ -1,4 +1,4 @@
-#------------------------------------------------------------------------------
+#-------------------------------*- makefile -*---------------------------------
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
diff --git a/wmake/MakefileFiles b/wmake/MakefileFiles
index 7303329f69177d0bb7ee9ff3e5fc8d36c8188e89..194df673f91da22b526ffac95843b4d05241246c 100644
--- a/wmake/MakefileFiles
+++ b/wmake/MakefileFiles
@@ -1,4 +1,4 @@
-#------------------------------------------------------------------------------
+#-------------------------------*- makefile -*---------------------------------
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
diff --git a/wmake/MakefileOptions b/wmake/MakefileOptions
index 45d33ffb719bec5df9fa08880666b64e781e7cff..d70737243b7c41a4618696df951fc1a71694d306 100644
--- a/wmake/MakefileOptions
+++ b/wmake/MakefileOptions
@@ -1,4 +1,4 @@
-#------------------------------------------------------------------------------
+#-------------------------------*- makefile -*---------------------------------
 # =========                 |
 # \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
 #  \\    /   O peration     |
diff --git a/wmake/rules/General/bison b/wmake/rules/General/bison
index fe2e00a0977f6e4c06f1d1e8169e5a69e011a89d..dd02dbd7aa3b672a53ea1e2b351d5ec9cd2d473d 100644
--- a/wmake/rules/General/bison
+++ b/wmake/rules/General/bison
@@ -1,8 +1,8 @@
 .SUFFIXES: .y .Y
 
-ytoo = bison -v -d -y $$SOURCE ; mv y.tab.c $*.c ; mv y.tab.h $*.h ; $(cc) $(cFLAGS) -c $*.c -o $@ 
+ytoo = bison -v -d -y $$SOURCE ; mv y.tab.c $*.c ; mv y.tab.h $*.h ; $(cc) $(cFLAGS) -c $*.c -o $@
 
-Ytoo = bison -v -d -y $$SOURCE ; mv y.tab.c $*.C ; mv y.tab.h $*.H ; $(CC) $(c++FLAGS) -c $*.C -o $@ 
+Ytoo = bison -v -d -y $$SOURCE ; mv y.tab.c $*.C ; mv y.tab.h $*.H ; $(CC) $(c++FLAGS) -c $*.C -o $@
 
 .y.dep:
 	$(MAKE_DEP)
diff --git a/wmake/rules/General/btyacc b/wmake/rules/General/btyacc
index f868b05afdee6face160a2e9a0d44fbff0aecb00..aaec4406fd013c14037994dd8034b351b49f871c 100644
--- a/wmake/rules/General/btyacc
+++ b/wmake/rules/General/btyacc
@@ -1,6 +1,6 @@
 .SUFFIXES: .y
 
-ytoo = btyacc -v -d $(SKELETON) $$SOURCE ; mv y_tab.c $*.C ; mv y_tab.h $*.H ; $(CC) $(c++FLAGS) -c $*.C -o $@ 
+ytoo = btyacc -v -d $(SKELETON) $$SOURCE ; mv y_tab.c $*.C ; mv y_tab.h $*.H ; $(CC) $(c++FLAGS) -c $*.C -o $@
 
 .y.dep:
 	$(MAKE_DEP)
diff --git a/wmake/rules/General/btyacc++ b/wmake/rules/General/btyacc++
index c65365c00943439d39932a44bb300082ec184ea0..0d2bd33ea78167738bc9e2248b1f59c88d98d1c1 100644
--- a/wmake/rules/General/btyacc++
+++ b/wmake/rules/General/btyacc++
@@ -1,6 +1,6 @@
 .SUFFIXES: .Y
 
-Ytoo = btyacc++ -v -d $(SKELETON) $$SOURCE ; mv y_tab.c $*.C ; mv y_tab.h $*.H ; $(CC) $(c++FLAGS) -c $*.C -o $@ 
+Ytoo = btyacc++ -v -d $(SKELETON) $$SOURCE ; mv y_tab.c $*.C ; mv y_tab.h $*.H ; $(CC) $(c++FLAGS) -c $*.C -o $@
 
 .Y.dep:
 	$(MAKE_DEP)
diff --git a/wmake/rules/General/byacc b/wmake/rules/General/byacc
index 919da82e616bd00ef78ec89cf71892c73fd60d07..e3393ee7ff198e7bdac823c557dbe2666c49fb3d 100644
--- a/wmake/rules/General/byacc
+++ b/wmake/rules/General/byacc
@@ -1,6 +1,6 @@
 .SUFFIXES: .y
 
-ytoo = byacc -v $(YYPREFIX) -d $$SOURCE ; mv y.tab.c $*.C ; mv y.tab.h $*.H ; $(CC) $(c++FLAGS) -c $*.C -o $@ 
+ytoo = byacc -v $(YYPREFIX) -d $$SOURCE ; mv y.tab.c $*.C ; mv y.tab.h $*.H ; $(CC) $(c++FLAGS) -c $*.C -o $@
 
 .y.dep:
 	$(MAKE_DEP)
diff --git a/wmake/rules/General/moc b/wmake/rules/General/moc
index e85cb479f581e57680529e4dd1ce9ef76157de0c..f47f586a3a3117de65f680721f9706440525a616 100644
--- a/wmake/rules/General/moc
+++ b/wmake/rules/General/moc
@@ -1,6 +1,6 @@
 .SUFFIXES: .qt
 
-qttoo = $(QTDIR)/bin/moc -f $$SOURCE -o $*.C ; $(CC) $(c++FLAGS) -c $*.C -o $@ 
+qttoo = $(QTDIR)/bin/moc -f $$SOURCE -o $*.C ; $(CC) $(c++FLAGS) -c $*.C -o $@
 
 .qt.dep:
 	$(MAKE_DEP)
diff --git a/wmake/rules/General/yacc b/wmake/rules/General/yacc
index f9d393e2838609a6bfc7f4f299006412454d38dc..959d4297374609c8d23c683fba5678d16c94ad54 100644
--- a/wmake/rules/General/yacc
+++ b/wmake/rules/General/yacc
@@ -1,8 +1,8 @@
 .SUFFIXES: .y .Y
 
-ytoo = yacc -v -d $$SOURCE ; mv y.tab.c $*.c ; mv y.tab.h $(@D)/parser.h ; $(CC) $(c++FLAGS) -c $*.c -o $@ 
+ytoo = yacc -v -d $$SOURCE ; mv y.tab.c $*.c ; mv y.tab.h $(@D)/parser.h ; $(CC) $(c++FLAGS) -c $*.c -o $@
 
-Ytoo = yacc -v -d $$SOURCE ; mv y.tab.c $*.C ; mv y.tab.h $(@D)/parser.H ; $(CC) $(c++FLAGS) -c $*.C -o $@ 
+Ytoo = yacc -v -d $$SOURCE ; mv y.tab.c $*.C ; mv y.tab.h $(@D)/parser.H ; $(CC) $(c++FLAGS) -c $*.C -o $@
 
 .y.dep:
 	$(MAKE_DEP)
diff --git a/wmake/rules/SiCortex64Gcc/c++Opt b/wmake/rules/SiCortex64Gcc/c++Opt
index 636689e9175bf6ba1007c8316e94855b11f35332..e37b9ee6e0c88a240bfacd71049d5288b79ba38d 100644
--- a/wmake/rules/SiCortex64Gcc/c++Opt
+++ b/wmake/rules/SiCortex64Gcc/c++Opt
@@ -1,4 +1,4 @@
-c++DBUG     = 
+c++DBUG     =
 c++OPT      = -O3
 #c++OPT      = -O3
 # -ftree-vectorize -ftree-vectorizer-verbose=3
diff --git a/wmake/rules/SiCortex64Gcc/cOpt b/wmake/rules/SiCortex64Gcc/cOpt
index a8b0635478db6e5968733b2f5f8f341b4af61d18..17318709f1fa39e6bf89cbe87778bc6fa459de17 100644
--- a/wmake/rules/SiCortex64Gcc/cOpt
+++ b/wmake/rules/SiCortex64Gcc/cOpt
@@ -1,2 +1,2 @@
-cDBUG       = 
+cDBUG       =
 cOPT        = -O3
diff --git a/wmake/rules/SunOS64Gcc/c++Opt b/wmake/rules/SunOS64Gcc/c++Opt
index 4cb95b5b3a9781b6508214a4ea55cf0930d2c9f4..2aedabd6280a3476bc58db13139a0a3aa579502b 100644
--- a/wmake/rules/SunOS64Gcc/c++Opt
+++ b/wmake/rules/SunOS64Gcc/c++Opt
@@ -1,2 +1,2 @@
-c++DBUG     = 
+c++DBUG     =
 c++OPT      = -O3
diff --git a/wmake/rules/SunOS64Gcc/cOpt b/wmake/rules/SunOS64Gcc/cOpt
index a8b0635478db6e5968733b2f5f8f341b4af61d18..17318709f1fa39e6bf89cbe87778bc6fa459de17 100644
--- a/wmake/rules/SunOS64Gcc/cOpt
+++ b/wmake/rules/SunOS64Gcc/cOpt
@@ -1,2 +1,2 @@
-cDBUG       = 
+cDBUG       =
 cOPT        = -O3
diff --git a/wmake/rules/linux64Gcc++0x/c b/wmake/rules/linux64Gcc++0x/c
new file mode 100644
index 0000000000000000000000000000000000000000..f4114be3143d1210ffea500a2b361008910abed0
--- /dev/null
+++ b/wmake/rules/linux64Gcc++0x/c
@@ -0,0 +1,16 @@
+.SUFFIXES: .c .h
+
+cWARN        = -Wall
+
+cc          = gcc -m64
+
+include $(RULES)/c$(WM_COMPILE_OPTION)
+
+cFLAGS      = $(GFLAGS) $(cWARN) $(cOPT) $(cDBUG) $(LIB_HEADER_DIRS) -fPIC
+
+ctoo        = $(WM_SCHEDULER) $(cc) $(cFLAGS) -c $$SOURCE -o $@
+
+LINK_LIBS   = $(cDBUG)
+
+LINKLIBSO   = $(cc) -shared
+LINKEXE     = $(cc) -Xlinker --add-needed -Xlinker -z -Xlinker nodefs
diff --git a/wmake/rules/linux64Gcc++0x/c++ b/wmake/rules/linux64Gcc++0x/c++
new file mode 100644
index 0000000000000000000000000000000000000000..4f858ff338c4d4f3e09d279d7168d9a368f05902
--- /dev/null
+++ b/wmake/rules/linux64Gcc++0x/c++
@@ -0,0 +1,21 @@
+.SUFFIXES: .C .cxx .cc .cpp
+
+c++WARN     = -Wall -Wextra -Wno-unused-parameter -Wold-style-cast -Wnon-virtual-dtor
+
+CC          = g++ -m64 -std=c++0x
+
+include $(RULES)/c++$(WM_COMPILE_OPTION)
+
+ptFLAGS     = -DNoRepository -ftemplate-depth-60
+
+c++FLAGS    = $(GFLAGS) $(c++WARN) $(c++OPT) $(c++DBUG) $(ptFLAGS) $(LIB_HEADER_DIRS) -fPIC
+
+Ctoo        = $(WM_SCHEDULER) $(CC) $(c++FLAGS) -c $$SOURCE -o $@
+cxxtoo      = $(Ctoo)
+cctoo       = $(Ctoo)
+cpptoo      = $(Ctoo)
+
+LINK_LIBS   = $(c++DBUG)
+
+LINKLIBSO   = $(CC) $(c++FLAGS) -shared
+LINKEXE     = $(CC) $(c++FLAGS) -Xlinker --add-needed
diff --git a/wmake/rules/linux64Gcc++0x/c++Debug b/wmake/rules/linux64Gcc++0x/c++Debug
new file mode 100644
index 0000000000000000000000000000000000000000..19bdb9c3346fc7a69380dfedd6e7911fe220a965
--- /dev/null
+++ b/wmake/rules/linux64Gcc++0x/c++Debug
@@ -0,0 +1,2 @@
+c++DBUG    = -ggdb3 -DFULLDEBUG
+c++OPT      = -O0 -fdefault-inline
diff --git a/wmake/rules/linux64Gcc++0x/c++Opt b/wmake/rules/linux64Gcc++0x/c++Opt
new file mode 100644
index 0000000000000000000000000000000000000000..3363be80905262684d0f126daa1cd6388231184d
--- /dev/null
+++ b/wmake/rules/linux64Gcc++0x/c++Opt
@@ -0,0 +1,3 @@
+#c++DBUG     = -O0 -DFULLDEBUG -g
+c++DBUG     =
+c++OPT      = -O3
diff --git a/wmake/rules/linux64Gcc++0x/c++Prof b/wmake/rules/linux64Gcc++0x/c++Prof
new file mode 100644
index 0000000000000000000000000000000000000000..3bda4dad55e898a8198f6e8bfe21e8d829d7230a
--- /dev/null
+++ b/wmake/rules/linux64Gcc++0x/c++Prof
@@ -0,0 +1,2 @@
+c++DBUG    = -pg
+c++OPT     = -O2
diff --git a/wmake/rules/linux64Gcc++0x/cDebug b/wmake/rules/linux64Gcc++0x/cDebug
new file mode 100644
index 0000000000000000000000000000000000000000..72b638f458220e329d52b59e3566a3c807101f9d
--- /dev/null
+++ b/wmake/rules/linux64Gcc++0x/cDebug
@@ -0,0 +1,2 @@
+cDBUG       = -ggdb -DFULLDEBUG
+cOPT        = -O1 -fdefault-inline -finline-functions
diff --git a/wmake/rules/linux64Gcc++0x/cOpt b/wmake/rules/linux64Gcc++0x/cOpt
new file mode 100644
index 0000000000000000000000000000000000000000..17318709f1fa39e6bf89cbe87778bc6fa459de17
--- /dev/null
+++ b/wmake/rules/linux64Gcc++0x/cOpt
@@ -0,0 +1,2 @@
+cDBUG       =
+cOPT        = -O3
diff --git a/wmake/rules/linux64Gcc++0x/cProf b/wmake/rules/linux64Gcc++0x/cProf
new file mode 100644
index 0000000000000000000000000000000000000000..ca3ac9bf5f0cd61fe99e0f05fa1bd4bdf9fa6cf7
--- /dev/null
+++ b/wmake/rules/linux64Gcc++0x/cProf
@@ -0,0 +1,2 @@
+cDBUG       = -pg
+cOPT        = -O2
diff --git a/wmake/rules/linux64Gcc++0x/general b/wmake/rules/linux64Gcc++0x/general
new file mode 100644
index 0000000000000000000000000000000000000000..809751cd0afab5ce33a04b3c72e266b16b7cc267
--- /dev/null
+++ b/wmake/rules/linux64Gcc++0x/general
@@ -0,0 +1,8 @@
+CPP        = cpp -traditional-cpp $(GFLAGS)
+
+PROJECT_LIBS = -l$(WM_PROJECT) -liberty -ldl
+
+include $(GENERAL_RULES)/standard
+
+include $(RULES)/c
+include $(RULES)/c++
diff --git a/wmake/rules/linux64Gcc++0x/mplibHPMPI b/wmake/rules/linux64Gcc++0x/mplibHPMPI
new file mode 100644
index 0000000000000000000000000000000000000000..574492a236a32f7d87d00bf0e3507a5ac8e54f55
--- /dev/null
+++ b/wmake/rules/linux64Gcc++0x/mplibHPMPI
@@ -0,0 +1,3 @@
+PFLAGS     =
+PINC       = -I$(MPI_ARCH_PATH)/include -D_MPICC_H
+PLIBS      = -L$(MPI_ARCH_PATH)/lib/linux_amd64 -lmpi
diff --git a/wmake/rules/linux64Gcc/c++Opt b/wmake/rules/linux64Gcc/c++Opt
index 5e2b738cd9bd0935ff3a504e9c7586c742493d63..3363be80905262684d0f126daa1cd6388231184d 100644
--- a/wmake/rules/linux64Gcc/c++Opt
+++ b/wmake/rules/linux64Gcc/c++Opt
@@ -1,3 +1,3 @@
 #c++DBUG     = -O0 -DFULLDEBUG -g
-c++DBUG     = 
+c++DBUG     =
 c++OPT      = -O3
diff --git a/wmake/rules/linux64Icc/c b/wmake/rules/linux64Icc/c
index 527c968bc9c6da1493147b24ffe06862a34abe42..08ea0f8049ef07e00b1f00af8f11616383492907 100644
--- a/wmake/rules/linux64Icc/c
+++ b/wmake/rules/linux64Icc/c
@@ -1,6 +1,6 @@
 .SUFFIXES: .c .h
 
-cWARN        = 
+cWARN        =
 
 cc          = icc
 
diff --git a/wmake/rules/linux64Icc/c++Debug b/wmake/rules/linux64Icc/c++Debug
index cfc504ee8d2e5362b45630fef0291f692bcb4cd3..0aec1fbffe1dd092d778540c501551d87474fb8e 100644
--- a/wmake/rules/linux64Icc/c++Debug
+++ b/wmake/rules/linux64Icc/c++Debug
@@ -1,2 +1,2 @@
 c++DBUG    = -g -DFULLDEBUG -O0
-c++OPT     = 
+c++OPT     =
diff --git a/wmake/rules/linux64Icc/c++Opt b/wmake/rules/linux64Icc/c++Opt
index efd90cbbcf7094482413702d44de12dd36b3006d..8b6fbd136d63f8a14710abfed01e4a49011f4180 100644
--- a/wmake/rules/linux64Icc/c++Opt
+++ b/wmake/rules/linux64Icc/c++Opt
@@ -1,2 +1,2 @@
-c++DBUG     = 
+c++DBUG     =
 c++OPT      = -xT -O3 -no-prec-div
diff --git a/wmake/rules/linux64Icc/cDebug b/wmake/rules/linux64Icc/cDebug
index d4abf632731d801bc522d01c459e8db021b0ba65..73dce0dfd01f70663ed42deb43c46cb36c39394e 100644
--- a/wmake/rules/linux64Icc/cDebug
+++ b/wmake/rules/linux64Icc/cDebug
@@ -1,2 +1,2 @@
 cDBUG       = -g -DFULLDEBUG -O0
-cOPT        = 
+cOPT        =
diff --git a/wmake/rules/linux64Icc/cOpt b/wmake/rules/linux64Icc/cOpt
index c11cbf0553b7398022d98013b8fe87e4ca40cb41..b5349135be42738b3d2ba658701c85c76d0bc0b3 100644
--- a/wmake/rules/linux64Icc/cOpt
+++ b/wmake/rules/linux64Icc/cOpt
@@ -1,2 +1,2 @@
-cDBUG       = 
+cDBUG       =
 cOPT        = -O3 -no-prec-div
diff --git a/wmake/rules/linuxIA64Gcc/c++Opt b/wmake/rules/linuxIA64Gcc/c++Opt
index 4cb95b5b3a9781b6508214a4ea55cf0930d2c9f4..2aedabd6280a3476bc58db13139a0a3aa579502b 100644
--- a/wmake/rules/linuxIA64Gcc/c++Opt
+++ b/wmake/rules/linuxIA64Gcc/c++Opt
@@ -1,2 +1,2 @@
-c++DBUG     = 
+c++DBUG     =
 c++OPT      = -O3
diff --git a/wmake/rules/linuxIA64Gcc/cOpt b/wmake/rules/linuxIA64Gcc/cOpt
index a8b0635478db6e5968733b2f5f8f341b4af61d18..17318709f1fa39e6bf89cbe87778bc6fa459de17 100644
--- a/wmake/rules/linuxIA64Gcc/cOpt
+++ b/wmake/rules/linuxIA64Gcc/cOpt
@@ -1,2 +1,2 @@
-cDBUG       = 
+cDBUG       =
 cOPT        = -O3
diff --git a/wmake/rules/linuxIA64Gcc/mplibMPI b/wmake/rules/linuxIA64Gcc/mplibMPI
index 67c18b2a2616668ebe4b76959a587a5e95e869cf..186769c0c26554ded137caac1e0d727e04fafd82 100644
--- a/wmake/rules/linuxIA64Gcc/mplibMPI
+++ b/wmake/rules/linuxIA64Gcc/mplibMPI
@@ -1,3 +1,3 @@
 PFLAGS     = -DSGIMPI -DMPI_NO_CPPBIND
-PINC       = 
+PINC       =
 PLIBS      = -lmpi
diff --git a/wmake/rules/linuxIA64Icc/c b/wmake/rules/linuxIA64Icc/c
index 86fd59f3f07ad66f00292795b22e7de6137057e5..d05b14867e4e22eb7ab922b55da28eda31eea333 100644
--- a/wmake/rules/linuxIA64Icc/c
+++ b/wmake/rules/linuxIA64Icc/c
@@ -1,6 +1,6 @@
 .SUFFIXES: .c .h
 
-cWARN        = 
+cWARN        =
 
 cc          = icc
 
diff --git a/wmake/rules/linuxIA64Icc/c++Debug b/wmake/rules/linuxIA64Icc/c++Debug
index cfc504ee8d2e5362b45630fef0291f692bcb4cd3..0aec1fbffe1dd092d778540c501551d87474fb8e 100644
--- a/wmake/rules/linuxIA64Icc/c++Debug
+++ b/wmake/rules/linuxIA64Icc/c++Debug
@@ -1,2 +1,2 @@
 c++DBUG    = -g -DFULLDEBUG -O0
-c++OPT     = 
+c++OPT     =
diff --git a/wmake/rules/linuxIA64Icc/c++Opt b/wmake/rules/linuxIA64Icc/c++Opt
index b29c39dd528c803c4d89d2e35974e38d52bdf223..dd3d557474213cb77371150ce00dfb24ed3db919 100644
--- a/wmake/rules/linuxIA64Icc/c++Opt
+++ b/wmake/rules/linuxIA64Icc/c++Opt
@@ -1,4 +1,4 @@
-c++DBUG     = 
+c++DBUG     =
 
 c++OPT      = \
     -DICC_IA64_PREFETCH \
diff --git a/wmake/rules/linuxIA64Icc/cDebug b/wmake/rules/linuxIA64Icc/cDebug
index d4abf632731d801bc522d01c459e8db021b0ba65..73dce0dfd01f70663ed42deb43c46cb36c39394e 100644
--- a/wmake/rules/linuxIA64Icc/cDebug
+++ b/wmake/rules/linuxIA64Icc/cDebug
@@ -1,2 +1,2 @@
 cDBUG       = -g -DFULLDEBUG -O0
-cOPT        = 
+cOPT        =
diff --git a/wmake/rules/linuxIA64Icc/cOpt b/wmake/rules/linuxIA64Icc/cOpt
index a8b0635478db6e5968733b2f5f8f341b4af61d18..17318709f1fa39e6bf89cbe87778bc6fa459de17 100644
--- a/wmake/rules/linuxIA64Icc/cOpt
+++ b/wmake/rules/linuxIA64Icc/cOpt
@@ -1,2 +1,2 @@
-cDBUG       = 
+cDBUG       =
 cOPT        = -O3
diff --git a/wmake/rules/linuxIA64Icc/mplibIMPI b/wmake/rules/linuxIA64Icc/mplibIMPI
index 67c18b2a2616668ebe4b76959a587a5e95e869cf..186769c0c26554ded137caac1e0d727e04fafd82 100644
--- a/wmake/rules/linuxIA64Icc/mplibIMPI
+++ b/wmake/rules/linuxIA64Icc/mplibIMPI
@@ -1,3 +1,3 @@
 PFLAGS     = -DSGIMPI -DMPI_NO_CPPBIND
-PINC       = 
+PINC       =
 PLIBS      = -lmpi
diff --git a/wmake/rules/linuxIA64Icc/mplibMPI b/wmake/rules/linuxIA64Icc/mplibMPI
index 67c18b2a2616668ebe4b76959a587a5e95e869cf..186769c0c26554ded137caac1e0d727e04fafd82 100644
--- a/wmake/rules/linuxIA64Icc/mplibMPI
+++ b/wmake/rules/linuxIA64Icc/mplibMPI
@@ -1,3 +1,3 @@
 PFLAGS     = -DSGIMPI -DMPI_NO_CPPBIND
-PINC       = 
+PINC       =
 PLIBS      = -lmpi
diff --git a/wmake/rules/linuxIcc/c b/wmake/rules/linuxIcc/c
index 0e755074f82efeeb6deac7bdcfad08960acb75ed..269eeaba47f37947712379112a41e8fc20b66de9 100644
--- a/wmake/rules/linuxIcc/c
+++ b/wmake/rules/linuxIcc/c
@@ -1,6 +1,6 @@
 .SUFFIXES: .c .h
 
-cWARN        = 
+cWARN        =
 
 cc          = icc -gcc-version=400
 
diff --git a/wmake/rules/linuxIcc/c++Debug b/wmake/rules/linuxIcc/c++Debug
index cfc504ee8d2e5362b45630fef0291f692bcb4cd3..0aec1fbffe1dd092d778540c501551d87474fb8e 100644
--- a/wmake/rules/linuxIcc/c++Debug
+++ b/wmake/rules/linuxIcc/c++Debug
@@ -1,2 +1,2 @@
 c++DBUG    = -g -DFULLDEBUG -O0
-c++OPT     = 
+c++OPT     =
diff --git a/wmake/rules/linuxIcc/c++Opt b/wmake/rules/linuxIcc/c++Opt
index 1148721d30681d66a59a8fe3502fb711b2999c2d..62f12c3eb533c5902776749d3e3916f78fe95790 100644
--- a/wmake/rules/linuxIcc/c++Opt
+++ b/wmake/rules/linuxIcc/c++Opt
@@ -1,4 +1,4 @@
-c++DBUG     = 
+c++DBUG     =
 #c++OPT      = -O3 -xP -no-prec-div
 c++OPT      = -ansi-alias -O3 -ftz -fno-alias \
               -fargument-noalias-global \
diff --git a/wmake/rules/linuxIcc/cDebug b/wmake/rules/linuxIcc/cDebug
index d4abf632731d801bc522d01c459e8db021b0ba65..73dce0dfd01f70663ed42deb43c46cb36c39394e 100644
--- a/wmake/rules/linuxIcc/cDebug
+++ b/wmake/rules/linuxIcc/cDebug
@@ -1,2 +1,2 @@
 cDBUG       = -g -DFULLDEBUG -O0
-cOPT        = 
+cOPT        =
diff --git a/wmake/rules/linuxIcc/cOpt b/wmake/rules/linuxIcc/cOpt
index c11cbf0553b7398022d98013b8fe87e4ca40cb41..b5349135be42738b3d2ba658701c85c76d0bc0b3 100644
--- a/wmake/rules/linuxIcc/cOpt
+++ b/wmake/rules/linuxIcc/cOpt
@@ -1,2 +1,2 @@
-cDBUG       = 
+cDBUG       =
 cOPT        = -O3 -no-prec-div
diff --git a/wmake/rules/linuxmingw32/X b/wmake/rules/linuxmingw32/X
index d4f8a960c5219f4c7310e0d17bfeec97ac2be36e..7848473828558dcba526fe65eca441eaea8cec89 100644
--- a/wmake/rules/linuxmingw32/X
+++ b/wmake/rules/linuxmingw32/X
@@ -1,3 +1,3 @@
 XFLAGS     =
-XINC       = 
+XINC       =
 XLIBS      =
diff --git a/wmake/rules/linuxmingw32/c++Opt b/wmake/rules/linuxmingw32/c++Opt
index 8d5bc55cee782d01b0bb9366587905941b722614..548bfecef8b96869557513d09761fe1974028039 100644
--- a/wmake/rules/linuxmingw32/c++Opt
+++ b/wmake/rules/linuxmingw32/c++Opt
@@ -1,2 +1,2 @@
-c++DBUG     = 
+c++DBUG     =
 c++OPT      = -O3 -DNDEBUG
diff --git a/wmake/rules/linuxmingw32/cOpt b/wmake/rules/linuxmingw32/cOpt
index f2abb5590ac3a0853b42db299d5cbc62a4dc9458..e4572a0e47aac2a8f587ddeb55914dfe064d7175 100644
--- a/wmake/rules/linuxmingw32/cOpt
+++ b/wmake/rules/linuxmingw32/cOpt
@@ -1,2 +1,2 @@
-cDBUG       = 
+cDBUG       =
 cOPT        = -O3 -DNDEBUG
diff --git a/wmake/rules/solarisGcc/c++Opt b/wmake/rules/solarisGcc/c++Opt
index 551785219b1e934493aded65871d5826573762f6..18428f18267ef49cb9100f03bc85573b245aecb6 100644
--- a/wmake/rules/solarisGcc/c++Opt
+++ b/wmake/rules/solarisGcc/c++Opt
@@ -1,2 +1,2 @@
-c++DBUG       = 
+c++DBUG       =
 c++OPT        = -O3 -fno-schedule-insns
diff --git a/wmake/rules/solarisGcc/cOpt b/wmake/rules/solarisGcc/cOpt
index 687e27cf1304d210cebb29fac5004e86cf44e13f..b0ce51585486811e127263b8755a7c88e5ab1f99 100644
--- a/wmake/rules/solarisGcc/cOpt
+++ b/wmake/rules/solarisGcc/cOpt
@@ -1,2 +1,2 @@
-cDBUG       = 
+cDBUG       =
 cOPT        = -O2 -fno-schedule-insns
diff --git a/wmake/rules/solarisGcc/mplibMPI b/wmake/rules/solarisGcc/mplibMPI
index c7096a13faa93b866ca5dcaf9bd7beb118c0c12b..0d79c1d72c738f74af4dfc47dd069c63b060fe4d 100644
--- a/wmake/rules/solarisGcc/mplibMPI
+++ b/wmake/rules/solarisGcc/mplibMPI
@@ -1,3 +1,3 @@
-PFLAGS     = 
-PINC       = -I$(MPI_ROOT)/include 
+PFLAGS     =
+PINC       = -I$(MPI_ROOT)/include
 PLIBS      = -L$(MPI_ROOT)/lib/$(MPI_ARCH) -lmpi