diff --git a/ReleaseNotes-dev b/ReleaseNotes-dev
new file mode 100644
index 0000000000000000000000000000000000000000..18a61718b0c7455d5ce9d6f4c7c150daebc61fdc
--- /dev/null
+++ b/ReleaseNotes-dev
@@ -0,0 +1,77 @@
+#                            -*- mode: org; -*-
+#
+#+TITLE:  OpenFOAM release notes for version dev
+#+AUTHOR:                      OpenCFD Ltd.
+#+DATE:                            TBA
+#+LINK:                  http://www.openfoam.com
+#+OPTIONS: author:nil ^:{}
+# Copyright (c) 2010 OpenCFD Ltd.
+
+* Overview
+  OpenFOAM-dev is the latest major release of OpenFOAM including many new
+  developments a number of bug-fixes.  This release passes our standard tests
+  and the tutorials have been broadly checked.  Please report any bugs by
+  following the link: http://www.openfoam.com/bugs.
+
+* GNU/Linux version
+  This release of OpenFOAM is distributed primarily in 2 ways: (1) as a Debian
+  pack containing binaries and source; (2) from the SourceForge source code
+  repository (see [[./README.org][README]]).
+
+  The Ubuntu/Debian pack is available for 32 and 64 bit versions of the 10.04
+  LTS operating system using the system compiler and libraries that will be
+  installed automatically from standard Debian packs.
+
+  To use the source version from the SourceForge repository, we provide a source
+  pack of third-party packages that can be compiled on the user's system.  This
+  does not include =gcc=, since the system installed version is typically
+  sufficient, but includes =paraview-3.8.0=, =openmpi-1.4.1=, =scotch_5.1=,
+  =metis-5.0pre2=, =ParMetis-3.1= and =ParMGridGen-1.0=.
+
+* Library developments
+  There have been a number of developments to the libraries to support the
+  extension of functionality in solver and utility applications.
+*** Core library
+    + Large number of code refinements and consistency improvements to support
+      other developments.
+*** Turbulence modelling
+*** Thermo-physical Models
+*** DSMC
+*** Dynamic Mesh
+*** Numerics
+
+* Solvers
+  A number of new solvers have been developed for a range of engineering
+  applications.  There has been a set of improvements to certain classes of
+  solver that are introduced in this release.
+*** *New* Solvers
+    + ...
+*** Modifications to multiphase and buoyant solvers
+    + ...
+*** Modifications to solvers for sensible enthalpy
+    + ...
+*** Modifications to steady-state compressible solvers
+    + ...
+*** Other modifications
+    + ...
+
+* Boundary conditions
+  New boundary conditions have been introduced to support new applications in
+  OpenFOAM.
+  + ...
+
+* Utilities
+  There have been some utilities added and updated in this release.
+*** *New* utilities
+    + ...
+*** Updated utilities
+    + ...
+
+* Post-processing
+  + =foamToEnsight=: new =-nodeValues= option to generate and output nodal
+    field data.
+
+* New tutorials
+  There is a large number of new tutorials to support the new solvers in the
+  release.
+  + ...
diff --git a/applications/test/IndirectList/IndirectListTest.C b/applications/test/IndirectList/IndirectListTest.C
index 44589f57c0791819534d2da3e48fae156faeec86..5fe724cc1b128870e00b08d9387b8662ff254d7f 100644
--- a/applications/test/IndirectList/IndirectListTest.C
+++ b/applications/test/IndirectList/IndirectListTest.C
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -30,6 +30,15 @@ Description
 
 using namespace Foam;
 
+template<class ListType>
+void printInfo(const ListType& lst)
+{
+    Info<< "addr: " << lst.addressing() << nl
+        << "list: " << lst << nl
+        << endl;
+}
+
+
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 // Main program:
 
@@ -42,8 +51,7 @@ int main(int argc, char *argv[])
         completeList[i] = 0.1*i;
     }
 
-    Info<< "raw : " << completeList << nl
-        << endl;
+    Info<< "raw : " << completeList << nl << endl;
 
 
     List<label> addresses(5);
@@ -53,11 +61,9 @@ int main(int argc, char *argv[])
     addresses[3] = 8;
     addresses[4] = 5;
 
-    IndirectList<double> idl(completeList, addresses);
+    IndirectList<double> idl1(completeList, addresses);
 
-    Info<< "addr: " << idl.addressing() << nl
-        << "list: " << idl() << nl
-        << endl;
+    printInfo(idl1);
 
     addresses[4] = 1;
     addresses[3] = 0;
@@ -65,11 +71,26 @@ int main(int argc, char *argv[])
     addresses[1] = 8;
     addresses[0] = 5;
 
-    idl.resetAddressing(addresses.xfer());
+    idl1.resetAddressing(addresses.xfer());
 
-    Info<< "addr: " << idl.addressing() << nl
-        << "list: " << idl() << nl
-        << endl;
+    printInfo(idl1);
+
+    // test copying
+    UIndirectList<double> uidl1(idl1);
+    IndirectList<double> idl2(uidl1);
+    IndirectList<double> idl3(idl2);
+
+    printInfo(uidl1);
+
+    idl1.resetAddressing(List<label>());
+//    idl2.resetAddressing(List<label>());
+
+    Info<<"after resetAddressing:" << nl << endl;
+
+    printInfo(uidl1);
+    printInfo(idl1);
+    printInfo(idl2);
+    printInfo(idl3);
 
     Info<< "End\n" << endl;
 
diff --git a/applications/test/IndirectList2/IndirectList2.H b/applications/test/IndirectList2/IndirectList2.H
deleted file mode 100644
index 3eb11d0e0498c2fb445b19bd79f26ec862b16951..0000000000000000000000000000000000000000
--- a/applications/test/IndirectList2/IndirectList2.H
+++ /dev/null
@@ -1,164 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  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::IndirectList2
-
-Description
-    A List with indirect addressing.
-
-SourceFiles
-    IndirectListI.H
-
-\*---------------------------------------------------------------------------*/
-
-#ifndef IndirectList2_H
-#define IndirectList2_H
-
-#include "UIndirectList.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-namespace Foam
-{
-
-/*---------------------------------------------------------------------------*\
-                   Class IndirectListAddressing Declaration
-\*---------------------------------------------------------------------------*/
-
-//- A helper class for storing addresses.
-class IndirectListAddressing
-{
-    // Private data
-
-        //- Storage for the list addressing
-        List<label> addressing_;
-
-
-    // Private Member Functions
-
-        //- Disallow default bitwise copy construct
-        IndirectListAddressing(const IndirectListAddressing&);
-
-        //- Disallow default bitwise assignment
-        void operator=(const IndirectListAddressing&);
-
-
-protected:
-
-    // Constructors
-
-        //- Construct by copying the addressing array
-        explicit inline IndirectListAddressing(const UList<label>& addr);
-
-        //- Construct by transferring addressing array
-        explicit inline IndirectListAddressing(const Xfer<List<label> >& addr);
-
-
-    // Member Functions
-
-        // Access
-
-            //- Return the list addressing
-            inline const List<label>& addressing() const;
-
-        // Edit
-
-            //- Reset addressing
-            inline void resetAddressing(const UList<label>&);
-            inline void resetAddressing(const Xfer<List<label> >&);
-
-};
-
-
-/*---------------------------------------------------------------------------*\
-                        Class IndirectList2 Declaration
-\*---------------------------------------------------------------------------*/
-
-template<class T>
-class IndirectList2
-:
-    private IndirectListAddressing,
-    public  UIndirectList<T>
-{
-    // Private Member Functions
-
-        //- Disable default assignment operator
-        void operator=(const IndirectList2<T>&);
-
-        //- Disable assignment from UIndirectList
-        void operator=(const UIndirectList<T>&);
-
-
-public:
-
-    // Constructors
-
-        //- Construct given the complete list and the addressing array
-        inline IndirectList2(const UList<T>&, const UList<label>&);
-
-        //- Construct given the complete list and by transferring addressing
-        inline IndirectList2(const UList<T>&, const Xfer<List<label> >&);
-
-        //- Copy constructor
-        inline IndirectList2(const IndirectList2<T>&);
-
-        //- Construct from UIndirectList
-        explicit inline IndirectList2(const UIndirectList<T>&);
-
-
-    // Member Functions
-
-
-        // Access
-
-            //- Return the list addressing
-            using UIndirectList<T>::addressing;
-
-
-        // Edit
-
-            //- Reset addressing
-            using IndirectListAddressing::resetAddressing;
-
-
-        // Member Operators
-
-            //- Assignment operator
-            using UIndirectList<T>::operator=;
-};
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-} // End namespace Foam
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#include "IndirectList2I.H"
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#endif
-
-// ************************************************************************* //
diff --git a/applications/test/IndirectList2/IndirectList2I.H b/applications/test/IndirectList2/IndirectList2I.H
deleted file mode 100644
index 66b4e0de844533dea90142dff515e3c70991d76e..0000000000000000000000000000000000000000
--- a/applications/test/IndirectList2/IndirectList2I.H
+++ /dev/null
@@ -1,136 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  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/>.
-
-\*---------------------------------------------------------------------------*/
-
-// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
-
-
-inline Foam::IndirectListAddressing::IndirectListAddressing
-(
-    const UList<label>& addr
-)
-:
-    addressing_(addr)
-{}
-
-
-inline Foam::IndirectListAddressing::IndirectListAddressing
-(
-    const Xfer<List<label> >& addr
-)
-:
-    addressing_(addr)
-{}
-
-
-template<class T>
-inline Foam::IndirectList2<T>::IndirectList2
-(
-    const UList<T>& completeList,
-    const UList<label>& addr
-)
-:
-    IndirectListAddressing(addr),
-    UIndirectList<T>
-    (
-        completeList,
-        IndirectListAddressing::addressing()
-    )
-{}
-
-
-template<class T>
-inline Foam::IndirectList2<T>::IndirectList2
-(
-    const UList<T>& completeList,
-    const Xfer<List<label> >& addr
-)
-:
-    IndirectListAddressing(addr),
-    UIndirectList<T>
-    (
-        completeList,
-        IndirectListAddressing::addressing()
-    )
-{}
-
-
-template<class T>
-inline Foam::IndirectList2<T>::IndirectList2
-(
-    const IndirectList2<T>& lst
-)
-:
-    IndirectListAddressing(lst.addressing()),
-    UIndirectList<T>
-    (
-        lst.completeList(),
-        IndirectListAddressing::addressing()
-    )
-{}
-
-
-template<class T>
-inline Foam::IndirectList2<T>::IndirectList2
-(
-    const UIndirectList<T>& lst
-)
-:
-    IndirectListAddressing(lst.addressing()),
-    UIndirectList<T>
-    (
-        lst.completeList(),
-        IndirectListAddressing::addressing()
-    )
-{}
-
-
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
-inline const Foam::List<Foam::label>&
-Foam::IndirectListAddressing::addressing() const
-{
-    return addressing_;
-}
-
-
-inline void Foam::IndirectListAddressing::resetAddressing
-(
-    const UList<label>& addr
-)
-{
-    addressing_ = addr;
-}
-
-
-inline void Foam::IndirectListAddressing::resetAddressing
-(
-    const Xfer<List<label> >& addr
-)
-{
-    addressing_.transfer(addr());
-}
-
-
-// ************************************************************************* //
diff --git a/applications/test/IndirectList2/IndirectListTest2.C b/applications/test/IndirectList2/IndirectListTest2.C
deleted file mode 100644
index 14d7d4dbae63c2c17901d2e0fe8e0a56cf208149..0000000000000000000000000000000000000000
--- a/applications/test/IndirectList2/IndirectListTest2.C
+++ /dev/null
@@ -1,101 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  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/>.
-
-Description
-
-\*---------------------------------------------------------------------------*/
-
-#include "IndirectList2.H"
-#include "IOstreams.H"
-
-using namespace Foam;
-
-template<class ListType>
-void printInfo(const ListType& lst)
-{
-    Info<< "addr: " << lst.addressing() << nl
-        << "list: " << lst << nl
-        << endl;
-}
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Main program:
-
-int main(int argc, char *argv[])
-{
-    List<double> completeList(10);
-
-    forAll(completeList, i)
-    {
-        completeList[i] = 0.1*i;
-    }
-
-    Info<< "raw : " << completeList << nl << endl;
-
-
-    List<label> addresses(5);
-    addresses[0] = 1;
-    addresses[1] = 0;
-    addresses[2] = 7;
-    addresses[3] = 8;
-    addresses[4] = 5;
-
-    IndirectList2<double> idl1(completeList, addresses);
-
-    printInfo(idl1);
-
-    addresses[4] = 1;
-    addresses[3] = 0;
-    addresses[2] = 7;
-    addresses[1] = 8;
-    addresses[0] = 5;
-
-    idl1.resetAddressing(addresses.xfer());
-
-    printInfo(idl1);
-
-    // test copying
-    UIndirectList<double> uidl1(idl1);
-    IndirectList2<double> idl2(uidl1);
-    IndirectList2<double> idl3(idl2);
-
-    printInfo(uidl1);
-
-    idl1.resetAddressing(List<label>());
-//    idl2.resetAddressing(List<label>());
-
-    Info<<"after resetAddressing:" << nl << endl;
-
-    printInfo(uidl1);
-    printInfo(idl1);
-    printInfo(idl2);
-    printInfo(idl3);
-
-    Info<< "End\n" << endl;
-
-    return 0;
-}
-
-
-// ************************************************************************* //
diff --git a/applications/test/IndirectList2/Make/files b/applications/test/IndirectList2/Make/files
deleted file mode 100644
index c6dab96e20b74e41bfec7e2be0e13e6b4d57d129..0000000000000000000000000000000000000000
--- a/applications/test/IndirectList2/Make/files
+++ /dev/null
@@ -1,3 +0,0 @@
-IndirectListTest2.C
-
-EXE = $(FOAM_USER_APPBIN)/IndirectListTest2
diff --git a/applications/test/IndirectList2/Make/options b/applications/test/IndirectList2/Make/options
deleted file mode 100644
index 6a9e9810b3d5ce6684bdaf03143933480ff45e42..0000000000000000000000000000000000000000
--- a/applications/test/IndirectList2/Make/options
+++ /dev/null
@@ -1,2 +0,0 @@
-/* EXE_INC = -I$(LIB_SRC)/cfdTools/include */
-/* EXE_LIBS = -lfiniteVolume */
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/files b/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/files
index 78e39e9df6b48603ae717147a52c6dbff0f34959..44c513a079bdb9707167566ccc85a334e91d4078 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/files
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/Make/files
@@ -2,6 +2,5 @@ itoa.C
 ensightMesh.C
 ensightParticlePositions.C
 foamToEnsight.C
-ensightWriteBinary.C
 
 EXE = $(FOAM_APPBIN)/foamToEnsight
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/cellSets.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/cellSets.H
index 2c9755ef436014b387f35237ec7bdee8f7e12b37..a4447108ab75857adfc042210e86181dd882e8b7 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/cellSets.H
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/cellSets.H
@@ -44,15 +44,6 @@ namespace Foam
 
 class cellSets
 {
-    // Private Member Functions
-
-        //- Disallow default bitwise copy construct
-        cellSets(const cellSets&);
-
-        //- Disallow default bitwise assignment
-        void operator=(const cellSets&);
-
-
 public:
 
         label nHexesWedges;
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H
new file mode 100644
index 0000000000000000000000000000000000000000..2230b75b24bb0db43f511290b337dec7000efe39
--- /dev/null
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightAsciiStream.H
@@ -0,0 +1,156 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  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::ensightAsciiStream
+
+Description
+
+SourceFiles
+    ensightAsciiStream.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef ensightAsciiStream_H
+#define ensightAsciiStream_H
+
+#include "ensightStream.H"
+#include "OFstream.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+                         Class ensightAsciiStream Declaration
+\*---------------------------------------------------------------------------*/
+
+class ensightAsciiStream
+:
+    public ensightStream
+{
+    // Private data
+
+        //- Description of data_
+        OFstream str_;
+
+
+    // Private Member Functions
+
+        //- Disallow default bitwise copy construct
+        ensightAsciiStream(const ensightAsciiStream&);
+
+        //- Disallow default bitwise assignment
+        void operator=(const ensightAsciiStream&);
+
+
+public:
+
+    // Constructors
+
+        //- Construct from components
+        ensightAsciiStream(const fileName& f, const Time& runTime)
+        :
+            ensightStream(f),
+            str_
+            (
+                f,
+                runTime.writeFormat(),
+                runTime.writeVersion(),
+                IOstream::UNCOMPRESSED
+            )
+        {
+
+            str_.setf(ios_base::scientific, ios_base::floatfield);
+            str_.precision(5);
+        }
+
+
+    //- Destructor
+    virtual ~ensightAsciiStream()
+    {}
+
+
+    // Member Functions
+
+        virtual void write(const char* c)
+        {
+            str_ << c << nl;
+        }
+
+        virtual void write(const int v)
+        {
+            str_ << setw(10) << v << nl;
+        }
+
+        virtual void write(const scalarField& sf)
+        {
+            forAll(sf, i)
+            {
+                if (mag(sf[i]) >= scalar(floatScalarVSMALL))
+                {
+                    str_ << setw(12) << sf[i] << nl;
+                }
+                else
+                {
+                    str_ << setw(12) << scalar(0) << nl;
+                }
+            }
+        }
+
+        virtual void write(const List<int>& sf)
+        {
+            forAll(sf, i)
+            {
+                str_ << setw(10) << sf[i];
+            }
+            str_<< nl;
+        }
+
+        virtual void writePartHeader(const label partI)
+        {
+            str_<< "part" << nl
+                << setw(10) << partI << nl;
+        }
+
+    // Member Operators
+
+    // Friend Functions
+
+    // Friend Operators
+
+    // IOstream Operators
+
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightBinaryStream.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightBinaryStream.H
new file mode 100644
index 0000000000000000000000000000000000000000..b4f1421e4aff778f7926a6e1f348890c8637b8f4
--- /dev/null
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightBinaryStream.H
@@ -0,0 +1,158 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  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::ensightBinaryStream
+
+Description
+
+SourceFiles
+    ensightBinaryStream.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef ensightBinaryStream_H
+#define ensightBinaryStream_H
+
+#include "ensightStream.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+                         Class ensightBinaryStream Declaration
+\*---------------------------------------------------------------------------*/
+
+class ensightBinaryStream
+:
+    public ensightStream
+{
+    // Private data
+
+        //- Description of data_
+        autoPtr<std::ofstream> str_;
+
+
+    // Private Member Functions
+
+        //- Disallow default bitwise copy construct
+        ensightBinaryStream(const ensightBinaryStream&);
+
+        //- Disallow default bitwise assignment
+        void operator=(const ensightBinaryStream&);
+
+
+public:
+
+    // Constructors
+
+        //- Construct from components
+        ensightBinaryStream(const fileName& f, const Time&)
+        :
+            ensightStream(f),
+            str_
+            (
+                new std::ofstream
+                (
+                    f.c_str(),
+                    ios_base::out | ios_base::binary | ios_base::trunc
+                )
+            )
+        {}
+
+
+    //- Destructor
+    virtual ~ensightBinaryStream()
+    {}
+
+
+    // Member Functions
+
+        virtual void write(const char* val)
+        {
+            char buffer[80] = {0};
+            strcpy(buffer, val);
+            str_().write(buffer, 80*sizeof(char));
+        }
+
+        virtual void write(const int val)
+        {
+            str_().write(reinterpret_cast<const char*>(&val), sizeof(int));
+        }
+
+        virtual void write(const scalarField& sf)
+        {
+            if (sf.size())
+            {
+                List<float> temp(sf.size());
+
+                forAll(sf, i)
+                {
+                    temp[i] = float(sf[i]);
+                }
+
+                str_().write
+                (
+                    reinterpret_cast<const char*>(temp.begin()),
+                    sf.size()*sizeof(float)
+                );
+            }
+        }
+
+        virtual void write(const List<int>& sf)
+        {
+            str_().write
+            (
+                reinterpret_cast<const char*>(sf.begin()),
+                sf.size()*sizeof(int)
+            );
+        }
+
+        virtual void writePartHeader(const label partI)
+        {
+            write("part");
+            write(partI);
+        }
+
+    // Member Operators
+
+    // Friend Functions
+
+    // Friend Operators
+
+    // IOstream Operators
+
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C
index 680d5ff89499649d64c4232c673e6fa49aab9b04..22bd164e92fe8e96bf535e0d9d12a9dbc5d5ad2f 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightField.C
@@ -29,28 +29,14 @@ License
 #include "OFstream.H"
 #include "IOmanip.H"
 #include "itoa.H"
-#include "ensightWriteBinary.H"
+#include "volPointInterpolation.H"
+#include "ensightBinaryStream.H"
+#include "ensightAsciiStream.H"
 
 using namespace Foam;
 
 // * * * * * * * * * * * * * * * Global Functions  * * * * * * * * * * * * * //
 
-void writeData(const scalarField& sf, OFstream& ensightFile)
-{
-    forAll(sf, i)
-    {
-        if (mag( sf[i] ) >= scalar(floatScalarVSMALL))
-        {
-            ensightFile << setw(12) << sf[i] << nl;
-        }
-        else
-        {
-            ensightFile << setw(12) << scalar(0) << nl;
-        }
-    }
-}
-
-
 template<class Type>
 scalarField map
 (
@@ -104,64 +90,25 @@ void writeAllData
     const Field<Type>& vf,
     const labelList& prims,
     const label nPrims,
-    OFstream& ensightFile
-)
-{
-    if (nPrims)
-    {
-        if (Pstream::master())
-        {
-            ensightFile << key << nl;
-
-            for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
-            {
-                writeData(map(vf, prims, cmpt), ensightFile);
-
-                for (int slave=1; slave<Pstream::nProcs(); slave++)
-                {
-                    IPstream fromSlave(Pstream::scheduled, slave);
-                    scalarField data(fromSlave);
-                    writeData(data, ensightFile);
-                }
-            }
-        }
-        else
-        {
-            for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
-            {
-                OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-                toMaster<< map(vf, prims, cmpt);
-            }
-        }
-    }
-}
-
-
-template<class Type>
-void writeAllDataBinary
-(
-    const char* key,
-    const Field<Type>& vf,
-    const labelList& prims,
-    const label nPrims,
-    std::ofstream& ensightFile
+    ensightStream& ensightFile
 )
 {
     if (nPrims)
     {
         if (Pstream::master())
         {
-            writeEnsDataBinary(key,ensightFile);
+            ensightFile.write(key);
 
             for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
             {
-                writeEnsDataBinary(map(vf, prims, cmpt), ensightFile);
+                scalarField masterData(map(vf, prims, cmpt));
+                ensightFile.write(masterData);
 
                 for (int slave=1; slave<Pstream::nProcs(); slave++)
                 {
                     IPstream fromSlave(Pstream::scheduled, slave);
-                    scalarField data(fromSlave);
-                    writeEnsDataBinary(data, ensightFile);
+                    scalarField slaveData(fromSlave);
+                    ensightFile.write(slaveData);
                 }
             }
         }
@@ -184,66 +131,25 @@ void writeAllFaceData
     const labelList& prims,
     const label nPrims,
     const Field<Type>& pf,
-    OFstream& ensightFile
+    ensightStream& ensightFile
 )
 {
     if (nPrims)
     {
         if (Pstream::master())
         {
-            ensightFile << key << nl;
+            ensightFile.write(key);
 
             for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
             {
-                writeData(map(pf, prims, cmpt), ensightFile);
+                ensightFile.write(map(pf, prims, cmpt));
 
                 for (int slave=1; slave<Pstream::nProcs(); slave++)
                 {
                     IPstream fromSlave(Pstream::scheduled, slave);
                     scalarField pf(fromSlave);
 
-                    writeData(pf, ensightFile);
-                }
-            }
-        }
-        else
-        {
-            for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
-            {
-                OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-                toMaster<< map(pf, prims, cmpt);
-            }
-        }
-    }
-}
-
-
-template<class Type>
-void writeAllFaceDataBinary
-(
-    const char* key,
-    const labelList& prims,
-    const label nPrims,
-    const Field<Type>& pf,
-    std::ofstream& ensightFile
-)
-{
-    if (nPrims)
-    {
-        if (Pstream::master())
-        {
-            writeEnsDataBinary(key,ensightFile);
-
-            for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
-            {
-                writeEnsDataBinary(map(pf, prims, cmpt), ensightFile);
-
-                for (int slave=1; slave<Pstream::nProcs(); slave++)
-                {
-                    IPstream fromSlave(Pstream::scheduled, slave);
-                    scalarField pf(fromSlave);
-
-                    writeEnsDataBinary(pf, ensightFile);
+                    ensightFile.write(pf);
                 }
             }
         }
@@ -267,16 +173,14 @@ bool writePatchField
     const Foam::label ensightPatchI,
     const Foam::faceSets& boundaryFaceSet,
     const Foam::ensightMesh::nFacePrimitives& nfp,
-    Foam::OFstream& ensightFile
+    ensightStream& ensightFile
 )
 {
     if (nfp.nTris || nfp.nQuads || nfp.nPolys)
     {
         if (Pstream::master())
         {
-            ensightFile
-                << "part" << nl
-                << setw(10) << ensightPatchI << nl;
+            ensightFile.writePartHeader(ensightPatchI);
         }
 
         writeAllFaceData
@@ -315,61 +219,6 @@ bool writePatchField
 }
 
 
-template<class Type>
-bool writePatchFieldBinary
-(
-    const Foam::Field<Type>& pf,
-    const Foam::label patchi,
-    const Foam::label ensightPatchI,
-    const Foam::faceSets& boundaryFaceSet,
-    const Foam::ensightMesh::nFacePrimitives& nfp,
-    std::ofstream& ensightFile
-)
-{
-    if (nfp.nTris || nfp.nQuads || nfp.nPolys)
-    {
-        if (Pstream::master())
-        {
-            writeEnsDataBinary("part",ensightFile);
-            writeEnsDataBinary(ensightPatchI,ensightFile);
-        }
-
-        writeAllFaceDataBinary
-        (
-            "tria3",
-            boundaryFaceSet.tris,
-            nfp.nTris,
-            pf,
-            ensightFile
-        );
-
-        writeAllFaceDataBinary
-        (
-            "quad4",
-            boundaryFaceSet.quads,
-            nfp.nQuads,
-            pf,
-            ensightFile
-        );
-
-        writeAllFaceDataBinary
-        (
-            "nsided",
-            boundaryFaceSet.polys,
-            nfp.nPolys,
-            pf,
-            ensightFile
-        );
-
-        return true;
-    }
-    else
-    {
-        return false;
-    }
-}
-
-
 template<class Type>
 void writePatchField
 (
@@ -380,6 +229,7 @@ void writePatchField
     const Foam::fileName& postProcPath,
     const Foam::word& prepend,
     const Foam::label timeIndex,
+    const bool binary,
     Foam::Ostream& ensightCaseFile
 )
 {
@@ -409,7 +259,7 @@ void writePatchField
 
     word timeFile = prepend + itoa(timeIndex);
 
-    OFstream *ensightFilePtr = NULL;
+    ensightStream* ensightFilePtr = NULL;
     if (Pstream::master())
     {
         if (timeIndex == 0)
@@ -426,20 +276,30 @@ void writePatchField
 
         // set the filename of the ensight file
         fileName ensightFileName(timeFile + "." + pfName);
-        ensightFilePtr = new OFstream
-        (
-            postProcPath/ensightFileName,
-            runTime.writeFormat(),
-            runTime.writeVersion(),
-            runTime.writeCompression()
-        );
+
+        if (binary)
+        {
+            ensightFilePtr = new ensightBinaryStream
+            (
+                postProcPath/ensightFileName,
+                runTime
+            );
+        }
+        else
+        {
+            ensightFilePtr = new ensightAsciiStream
+            (
+                postProcPath/ensightFileName,
+                runTime
+            );
+        }
     }
 
-    OFstream& ensightFile = *ensightFilePtr;
+    ensightStream& ensightFile = *ensightFilePtr;
 
     if (Pstream::master())
     {
-        ensightFile << pTraits<Type>::typeName << nl;
+        ensightFile.write(pTraits<Type>::typeName);
     }
 
     if (patchi >= 0)
@@ -477,17 +337,18 @@ void writePatchField
 
 
 template<class Type>
-void ensightFieldAscii
+void ensightField
 (
-    const Foam::IOobject& fieldObject,
+    const GeometricField<Type, fvPatchField, volMesh>& vf,
     const Foam::ensightMesh& eMesh,
     const Foam::fileName& postProcPath,
     const Foam::word& prepend,
     const Foam::label timeIndex,
+    const bool binary,
     Foam::Ostream& ensightCaseFile
 )
 {
-    Info<< "Converting field " << fieldObject.name() << endl;
+    Info<< "Converting field " << vf.name() << endl;
 
     word timeFile = prepend + itoa(timeIndex);
 
@@ -512,23 +373,31 @@ void ensightFieldAscii
     const labelList& hexes = meshCellSets.hexes;
     const labelList& polys = meshCellSets.polys;
 
-    OFstream *ensightFilePtr = NULL;
+    ensightStream* ensightFilePtr = NULL;
     if (Pstream::master())
     {
         // set the filename of the ensight file
-        fileName ensightFileName(timeFile + "." + fieldObject.name());
-        ensightFilePtr = new OFstream
-        (
-            postProcPath/ensightFileName,
-            runTime.writeFormat(),
-            runTime.writeVersion(),
-            IOstream::UNCOMPRESSED
-        );
-    }
+        fileName ensightFileName(timeFile + "." + vf.name());
 
-    OFstream& ensightFile = *ensightFilePtr;
+        if (binary)
+        {
+            ensightFilePtr = new ensightBinaryStream
+            (
+                postProcPath/ensightFileName,
+                runTime
+            );
+        }
+        else
+        {
+            ensightFilePtr = new ensightAsciiStream
+            (
+                postProcPath/ensightFileName,
+                runTime
+            );
+        }
+    }
 
-    GeometricField<Type, fvPatchField, volMesh> vf(fieldObject, mesh);
+    ensightStream& ensightFile = *ensightFilePtr;
 
     if (patchNames.empty())
     {
@@ -548,34 +417,26 @@ void ensightFieldAscii
                     << nl;
             }
 
-            ensightFile
-                << pTraits<Type>::typeName << nl
-                << "part" << nl
-                << setw(10) << 1 << nl;
-
-            ensightFile.setf(ios_base::scientific, ios_base::floatfield);
-            ensightFile.precision(5);
+            ensightFile.write(pTraits<Type>::typeName);
+            ensightFile.writePartHeader(1);
         }
 
         if (meshCellSets.nHexesWedges)
         {
             if (Pstream::master())
             {
-                ensightFile << "hexa8" << nl;
+                ensightFile.write("hexa8");
 
                 for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
                 {
-                    writeData
-                    (
-                        map(vf, hexes, wedges, cmpt),
-                        ensightFile
-                    );
+                    scalarField masterData(map(vf, hexes, wedges, cmpt));
+                    ensightFile.write(masterData);
 
                     for (int slave=1; slave<Pstream::nProcs(); slave++)
                     {
                         IPstream fromSlave(Pstream::scheduled, slave);
                         scalarField data(fromSlave);
-                        writeData(data, ensightFile);
+                        ensightFile.write(data);
                     }
                 }
             }
@@ -727,7 +588,6 @@ void ensightFieldAscii
             }
         }
     }
-
     if (Pstream::master())
     {
         delete ensightFilePtr;
@@ -736,59 +596,48 @@ void ensightFieldAscii
 
 
 template<class Type>
-void ensightFieldBinary
+void ensightPointField
 (
-    const Foam::IOobject& fieldObject,
+    const GeometricField<Type, pointPatchField, pointMesh>& pf,
     const Foam::ensightMesh& eMesh,
     const Foam::fileName& postProcPath,
     const Foam::word& prepend,
     const Foam::label timeIndex,
+    const bool binary,
     Foam::Ostream& ensightCaseFile
 )
 {
-    Info<< "Converting field (binary) " << fieldObject.name() << endl;
+    Info<< "Converting field " << pf.name() << endl;
 
     word timeFile = prepend + itoa(timeIndex);
 
-    const fvMesh& mesh = eMesh.mesh();
-    //const Time& runTime = mesh.time();
-
-    const cellSets& meshCellSets = eMesh.meshCellSets();
-    const List<faceSets>& boundaryFaceSets = eMesh.boundaryFaceSets();
-    const wordList& allPatchNames = eMesh.allPatchNames();
-    const wordHashSet& patchNames = eMesh.patchNames();
-    const HashTable<ensightMesh::nFacePrimitives>&
-        nPatchPrims = eMesh.nPatchPrims();
-    const List<faceSets>& faceZoneFaceSets = eMesh.faceZoneFaceSets();
-    const wordHashSet& faceZoneNames = eMesh.faceZoneNames();
-    const HashTable<ensightMesh::nFacePrimitives>&
-        nFaceZonePrims = eMesh.nFaceZonePrims();
-
-    const labelList& tets = meshCellSets.tets;
-    const labelList& pyrs = meshCellSets.pyrs;
-    const labelList& prisms = meshCellSets.prisms;
-    const labelList& wedges = meshCellSets.wedges;
-    const labelList& hexes = meshCellSets.hexes;
-    const labelList& polys = meshCellSets.polys;
-
-    std::ofstream *ensightFilePtr = NULL;
+    ensightStream* ensightFilePtr = NULL;
     if (Pstream::master())
     {
         // set the filename of the ensight file
-        fileName ensightFileName(timeFile + "." + fieldObject.name());
-        ensightFilePtr = new std::ofstream
-        (
-            (postProcPath/ensightFileName).c_str(),
-            ios_base::out | ios_base::binary | ios_base::trunc
-        );
-        // Check on file opened?
-    }
+        fileName ensightFileName(timeFile + "." + pf.name());
 
-    std::ofstream& ensightFile = *ensightFilePtr;
+        if (binary)
+        {
+            ensightFilePtr = new ensightBinaryStream
+            (
+                postProcPath/ensightFileName,
+                eMesh.mesh().time()
+            );
+        }
+        else
+        {
+            ensightFilePtr = new ensightAsciiStream
+            (
+                postProcPath/ensightFileName,
+                eMesh.mesh().time()
+            );
+        }
+    }
 
-    GeometricField<Type, fvPatchField, volMesh> vf(fieldObject, mesh);
+    ensightStream& ensightFile = *ensightFilePtr;
 
-    if (patchNames.empty())
+    if (eMesh.patchNames().empty())
     {
         eMesh.barrier();
 
@@ -800,192 +649,49 @@ void ensightFieldBinary
 
                 ensightCaseFile
                     << pTraits<Type>::typeName
-                    << " per element:            1       "
-                    << setw(15) << vf.name()
-                    << (' ' + prepend + "***." + vf.name()).c_str()
+                    << " per node:            1       "
+                    << setw(15) << pf.name()
+                    << (' ' + prepend + "***." + pf.name()).c_str()
                     << nl;
             }
 
-            writeEnsDataBinary(pTraits<Type>::typeName,ensightFile);
-            writeEnsDataBinary("part",ensightFile);
-            writeEnsDataBinary(1,ensightFile);
+            ensightFile.write(pTraits<Type>::typeName);
+            ensightFile.write("part");
+            ensightFile.write(1);
         }
 
-        if (meshCellSets.nHexesWedges)
+        if (Pstream::master())
         {
-            if (Pstream::master())
-            {
-                writeEnsDataBinary("hexa8",ensightFile);
+            ensightFile.write("coordinates");
 
-                for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
-                {
-                    writeEnsDataBinary
-                    (
-                        map(vf, hexes, wedges, cmpt),
-                        ensightFile
-                    );
+            Field<Type> uniqueFld(pf.internalField(), eMesh.uniquePointMap());
 
-                    for (int slave=1; slave<Pstream::nProcs(); slave++)
-                    {
-                        IPstream fromSlave(Pstream::scheduled, slave);
-                        scalarField data(fromSlave);
-                        writeEnsDataBinary(data, ensightFile);
-                    }
-                }
-            }
-            else
+            for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
             {
-                for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
+                ensightFile.write(uniqueFld.component(cmpt));
+
+                for (int slave=1; slave<Pstream::nProcs(); slave++)
                 {
-                    OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-                    toMaster<< map(vf, hexes, wedges, cmpt);
+                    IPstream fromSlave(Pstream::scheduled, slave);
+                    scalarField data(fromSlave);
+                    ensightFile.write(data);
                 }
             }
         }
-
-        writeAllDataBinary
-        (
-            "penta6",
-            vf,
-            prisms,
-            meshCellSets.nPrisms,
-            ensightFile
-        );
-
-        writeAllDataBinary
-        (
-            "pyramid5",
-            vf,
-            pyrs,
-            meshCellSets.nPyrs,
-            ensightFile
-        );
-
-        writeAllDataBinary
-        (
-            "tetra4",
-            vf,
-            tets,
-            meshCellSets.nTets,
-            ensightFile
-        );
-
-        writeAllDataBinary
-        (
-            "nfaced",
-            vf,
-            polys,
-            meshCellSets.nPolys,
-            ensightFile
-        );
-    }
-
-    label ensightPatchI = eMesh.patchPartOffset();
-
-    forAll(allPatchNames, patchi)
-    {
-        const word& patchName = allPatchNames[patchi];
-
-        eMesh.barrier();
-
-        if (patchNames.empty() || patchNames.found(patchName))
-        {
-            if
-            (
-                writePatchFieldBinary
-                (
-                    vf.boundaryField()[patchi],
-                    patchi,
-                    ensightPatchI,
-                    boundaryFaceSets[patchi],
-                    nPatchPrims.find(patchName)(),
-                    ensightFile
-                )
-            )
-            {
-                ensightPatchI++;
-            }
-        }
-
-    }
-
-    // write faceZones, if requested
-    if (faceZoneNames.size())
-    {
-        // Interpolates cell values to faces - needed only when exporting
-        // faceZones...
-        GeometricField<Type, fvsPatchField, surfaceMesh> sf
-        (
-            linearInterpolate(vf)
-        );
-
-        forAllConstIter(wordHashSet, faceZoneNames, iter)
+        else
         {
-            const word& faceZoneName = iter.key();
-
-            eMesh.barrier();
-
-            label zoneID = mesh.faceZones().findZoneID(faceZoneName);
-
-            const faceZone& fz = mesh.faceZones()[zoneID];
-
-            // Prepare data to write
-            label nIncluded = 0;
-            forAll(fz, i)
-            {
-                if (eMesh.faceToBeIncluded(fz[i]))
-                {
-                    ++nIncluded;
-                }
-            }
-
-            Field<Type> values(nIncluded);
-
-            // Loop on the faceZone and store the needed field values
-            label j = 0;
-            forAll(fz, i)
-            {
-                label faceI = fz[i];
-                if (mesh.isInternalFace(faceI))
-                {
-                    values[j] = sf[faceI];
-                    ++j;
-                }
-                else
-                {
-                    if (eMesh.faceToBeIncluded(faceI))
-                    {
-                        label patchI = mesh.boundaryMesh().whichPatch(faceI);
-                        const polyPatch& pp = mesh.boundaryMesh()[patchI];
-                        label patchFaceI = pp.whichFace(faceI);
-                        Type value = sf.boundaryField()[patchI][patchFaceI];
-                        values[j] = value;
-                        ++j;
-                    }
-                }
-            }
-
-            if
-            (
-                writePatchFieldBinary
-                (
-                    values,
-                    zoneID,
-                    ensightPatchI,
-                    faceZoneFaceSets[zoneID],
-                    nFaceZonePrims.find(faceZoneName)(),
-                    ensightFile
-                )
-            )
+            Field<Type> uniqueFld(pf.internalField(), eMesh.uniquePointMap());
+            for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
             {
-                ensightPatchI++;
+                OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
+                toMaster<< uniqueFld.component(cmpt);
             }
         }
     }
 
     if (Pstream::master())
     {
-        ensightFile.close();
+        delete ensightFilePtr;
     }
 }
 
@@ -999,30 +705,42 @@ void ensightField
     const Foam::word& prepend,
     const Foam::label timeIndex,
     const bool binary,
+    const bool nodeValues,
     Foam::Ostream& ensightCaseFile
 )
 {
-    if (binary)
+    // Read field
+    GeometricField<Type, fvPatchField, volMesh> vf(fieldObject, eMesh.mesh());
+
+    if (nodeValues)
     {
-        ensightFieldBinary<Type>
+        tmp<GeometricField<Type, pointPatchField, pointMesh> > pfld
         (
-            fieldObject,
+            volPointInterpolation::New(eMesh.mesh()).interpolate(vf)
+        );
+        pfld().rename(vf.name());
+
+        ensightPointField<Type>
+        (
+            pfld,
             eMesh,
             postProcPath,
             prepend,
             timeIndex,
+            binary,
             ensightCaseFile
         );
     }
     else
     {
-        ensightFieldAscii<Type>
+        ensightField<Type>
         (
-            fieldObject,
+            vf,
             eMesh,
             postProcPath,
             prepend,
             timeIndex,
+            binary,
             ensightCaseFile
         );
     }
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C
index 00c733890aa4d0c6f7740b821e55a3224c837de1..59c30e34939c78b12cfa3dc355816c85f0a1be2b 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.C
@@ -23,9 +23,9 @@ License
 
 \*---------------------------------------------------------------------------*/
 
+#include "ensightMesh.H"
 #include "argList.H"
 #include "Time.H"
-#include "ensightMesh.H"
 #include "fvMesh.H"
 #include "globalMeshData.H"
 #include "PstreamCombineReduceOps.H"
@@ -33,38 +33,31 @@ License
 #include "cellModeller.H"
 #include "IOmanip.H"
 #include "itoa.H"
-#include "ensightWriteBinary.H"
 #include "globalIndex.H"
 #include "mapDistribute.H"
 #include "stringListOps.H"
 
+#include "ensightBinaryStream.H"
+#include "ensightAsciiStream.H"
+
 #include <fstream>
 
 // * * * * * * * * * * * * * Private Functions * * * * * * * * * * * * * * //
 
-// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
-
-Foam::ensightMesh::ensightMesh
-(
-    const fvMesh& mesh,
-    const argList& args,
-    const bool binary
-)
-:
-    mesh_(mesh),
-    binary_(binary),
-    patchPartOffset_(2),
-    meshCellSets_(mesh_.nCells()),
-    boundaryFaceSets_(mesh_.boundary().size()),
-    allPatchNames_(0),
-    patchNames_(0),
-    nPatchPrims_(0),
-    faceZoneFaceSets_(mesh_.faceZones().size()),
-    faceZoneNames_(0),
-    nFaceZonePrims_(0),
-    boundaryFaceToBeIncluded_(0)
+void Foam::ensightMesh::correct()
 {
-    const cellShapeList& cellShapes = mesh.cellShapes();
+    patchPartOffset_ = 2;
+    meshCellSets_ = mesh_.nCells();
+    boundaryFaceSets_.setSize(mesh_.boundary().size());
+    allPatchNames_.clear();
+    patchNames_.clear();
+    nPatchPrims_ = 0;
+    faceZoneFaceSets_.setSize(mesh_.faceZones().size());
+    faceZoneNames_.clear();
+    nFaceZonePrims_ = 0;
+    boundaryFaceToBeIncluded_.clear();
+
+    const cellShapeList& cellShapes = mesh_.cellShapes();
 
     const cellModel& tet = *(cellModeller::lookup("tet"));
     const cellModel& pyr = *(cellModeller::lookup("pyr"));
@@ -72,7 +65,7 @@ Foam::ensightMesh::ensightMesh
     const cellModel& wedge = *(cellModeller::lookup("wedge"));
     const cellModel& hex = *(cellModeller::lookup("hex"));
 
-    if (!args.optionFound("noPatches"))
+    if (!noPatches_)
     {
         // Patches are output. Check that they're synced.
         mesh_.boundaryMesh().checkParallelSync(true);
@@ -84,11 +77,9 @@ Foam::ensightMesh::ensightMesh
           - mesh_.globalData().processorPatches().size()
         );
 
-        if (args.optionFound("patches"))
+        if (patches_)
         {
-            wordReList patterns(args.optionLookup("patches")());
-
-            if (patterns.empty())
+            if (patchPatterns_.empty())
             {
                 forAll(allPatchNames_, nameI)
                 {
@@ -101,7 +92,7 @@ Foam::ensightMesh::ensightMesh
                 forAll(allPatchNames_, nameI)
                 {
                     const word& patchName = allPatchNames_[nameI];
-                    if (findStrings(patterns, patchName))
+                    if (findStrings(patchPatterns_, patchName))
                     {
                         patchNames_.insert(patchName);
                     }
@@ -184,15 +175,23 @@ Foam::ensightMesh::ensightMesh
 
         meshCellSets_.nPolys = nPolys;
         reduce(meshCellSets_.nPolys, sumOp<label>());
+
+
+        // Determine parallel shared points
+        globalPointsPtr_ = mesh_.globalData().mergePoints
+        (
+            pointToGlobal_,
+            uniquePointMap_
+        );
     }
 
-    if (!args.optionFound("noPatches"))
+    if (!noPatches_)
     {
-        forAll(mesh.boundary(), patchi)
+        forAll(mesh_.boundary(), patchi)
         {
-            if (mesh.boundary()[patchi].size())
+            if (mesh_.boundary()[patchi].size())
             {
-                const polyPatch& p = mesh.boundaryMesh()[patchi];
+                const polyPatch& p = mesh_.boundaryMesh()[patchi];
 
                 labelList& tris = boundaryFaceSets_[patchi].tris;
                 labelList& quads = boundaryFaceSets_[patchi].quads;
@@ -238,7 +237,7 @@ Foam::ensightMesh::ensightMesh
 
         if (patchNames_.empty() || patchNames_.found(patchName))
         {
-            if (mesh.boundary()[patchi].size())
+            if (mesh_.boundary()[patchi].size())
             {
                 nfp.nTris   = boundaryFaceSets_[patchi].tris.size();
                 nfp.nQuads  = boundaryFaceSets_[patchi].quads.size();
@@ -254,17 +253,15 @@ Foam::ensightMesh::ensightMesh
     }
 
     // faceZones
-    if (args.optionFound("faceZones"))
+    if (faceZones_)
     {
-        wordReList patterns(args.optionLookup("faceZones")());
-
         const wordList faceZoneNamesAll = mesh_.faceZones().names();
 
         // Find faceZone names which match that requested at command-line
         forAll(faceZoneNamesAll, nameI)
         {
             const word& zoneName = faceZoneNamesAll[nameI];
-            if (findStrings(patterns, zoneName))
+            if (findStrings(faceZonePatterns_, zoneName))
             {
                 faceZoneNames_.insert(zoneName);
             }
@@ -300,7 +297,7 @@ Foam::ensightMesh::ensightMesh
         {
             //const word& zoneName = faceZoneNamesAll[zoneI];
 
-            const faceZone& fz = mesh.faceZones()[zoneI];
+            const faceZone& fz = mesh_.faceZones()[zoneI];
 
             if (fz.size())
             {
@@ -380,6 +377,35 @@ Foam::ensightMesh::ensightMesh
 }
 
 
+// * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
+
+Foam::ensightMesh::ensightMesh
+(
+    const fvMesh& mesh,
+    const bool noPatches,
+
+    const bool patches,
+    const wordReList& patchPatterns,
+
+    const bool faceZones,
+    const wordReList& faceZonePatterns,
+
+    const bool binary
+)
+:
+    mesh_(mesh),
+    noPatches_(noPatches),
+    patches_(patches),
+    patchPatterns_(patchPatterns),
+    faceZones_(faceZones),
+    faceZonePatterns_(faceZonePatterns),
+    binary_(binary),
+    meshCellSets_(mesh.nCells())
+{
+    correct();
+}
+
+
 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
 
 Foam::ensightMesh::~ensightMesh()
@@ -412,19 +438,6 @@ void Foam::ensightMesh::barrier()
 }
 
 
-void Foam::ensightMesh::writePoints
-(
-    const scalarField& pointsComponent,
-    OFstream& ensightGeometryFile
-) const
-{
-    forAll(pointsComponent, pointI)
-    {
-        ensightGeometryFile<< setw(12) << float(pointsComponent[pointI]) << nl;
-    }
-}
-
-
 Foam::cellShapeList Foam::ensightMesh::map
 (
     const cellShapeList& cellShapes,
@@ -489,35 +502,10 @@ Foam::cellShapeList Foam::ensightMesh::map
 void Foam::ensightMesh::writePrims
 (
     const cellShapeList& cellShapes,
-    OFstream& ensightGeometryFile
-) const
-{
-    forAll(cellShapes, i)
-    {
-        const cellShape& cellPoints = cellShapes[i];
-
-        forAll(cellPoints, pointI)
-        {
-            ensightGeometryFile
-                << setw(10)
-                << cellPoints[pointI] + 1;
-        }
-        ensightGeometryFile << nl;
-    }
-}
-
-
-void Foam::ensightMesh::writePrimsBinary
-(
-    const cellShapeList& cellShapes,
-    std::ofstream& ensightGeometryFile
+    ensightStream& ensightGeometryFile
 ) const
 {
     // Create a temp int array
-    int numElem;
-
-    numElem = cellShapes.size();
-
     if (cellShapes.size())
     {
         // All the cellShapes have the same number of elements!
@@ -536,12 +524,7 @@ void Foam::ensightMesh::writePrimsBinary
                 n++;
             }
         }
-
-        ensightGeometryFile.write
-        (
-            reinterpret_cast<char*>(temp.begin()),
-            numIntElem*sizeof(int)
-        );
+        ensightGeometryFile.write(temp);
     }
 }
 
@@ -550,13 +533,12 @@ void Foam::ensightMesh::writePolysNFaces
 (
     const labelList& polys,
     const cellList& cellFaces,
-    OFstream& ensightGeometryFile
+    ensightStream& ensightGeometryFile
 ) const
 {
     forAll(polys, i)
     {
-        ensightGeometryFile
-            << setw(10) << cellFaces[polys[i]].size() << nl;
+        ensightGeometryFile.write(cellFaces[polys[i]].size());
     }
 }
 
@@ -566,7 +548,7 @@ void Foam::ensightMesh::writePolysNPointsPerFace
     const labelList& polys,
     const cellList& cellFaces,
     const faceList& faces,
-    OFstream& ensightGeometryFile
+    ensightStream& ensightGeometryFile
 ) const
 {
     forAll(polys, i)
@@ -575,8 +557,7 @@ void Foam::ensightMesh::writePolysNPointsPerFace
 
         forAll(cf, faceI)
         {
-            ensightGeometryFile
-                << setw(10) << faces[cf[faceI]].size() << nl;
+            ensightGeometryFile.write(faces[cf[faceI]].size());
         }
     }
 }
@@ -587,7 +568,7 @@ void Foam::ensightMesh::writePolysPoints
     const labelList& polys,
     const cellList& cellFaces,
     const faceList& faces,
-    OFstream& ensightGeometryFile
+    ensightStream& ensightGeometryFile
 ) const
 {
     forAll(polys, i)
@@ -598,11 +579,12 @@ void Foam::ensightMesh::writePolysPoints
         {
             const face& f = faces[cf[faceI]];
 
+            List<int> temp(f.size());
             forAll(f, pointI)
             {
-                ensightGeometryFile << setw(10) << f[pointI] + 1;
+                temp[pointI] = f[pointI] + 1;
             }
-            ensightGeometryFile << nl;
+            ensightGeometryFile.write(temp);
         }
     }
 }
@@ -611,7 +593,7 @@ void Foam::ensightMesh::writePolysPoints
 void Foam::ensightMesh::writeAllPolys
 (
     const labelList& pointToGlobal,
-    OFstream& ensightGeometryFile
+    ensightStream& ensightGeometryFile
 ) const
 {
     if (meshCellSets_.nPolys)
@@ -626,8 +608,8 @@ void Foam::ensightMesh::writeAllPolys
 
         if (Pstream::master())
         {
-            ensightGeometryFile
-                << "nfaced" << nl << setw(10) << meshCellSets_.nPolys << nl;
+            ensightGeometryFile.write("nfaced");
+            ensightGeometryFile.write(meshCellSets_.nPolys);
         }
 
         // Number of faces for each poly cell
@@ -735,150 +717,156 @@ void Foam::ensightMesh::writeAllPolys
 }
 
 
-void Foam::ensightMesh::writePolysNFacesBinary
+void Foam::ensightMesh::writeAllPrims
 (
-    const labelList& polys,
-    const cellList& cellFaces,
-    std::ofstream& ensightGeometryFile
+    const char* key,
+    const label nPrims,
+    const cellShapeList& cellShapes,
+    ensightStream& ensightGeometryFile
 ) const
 {
-    forAll(polys, i)
+    if (nPrims)
     {
-        writeEnsDataBinary
-        (
-            cellFaces[polys[i]].size(),
-            ensightGeometryFile
-        );
-    }
-}
+        if (Pstream::master())
+        {
+            ensightGeometryFile.write(key);
+            ensightGeometryFile.write(nPrims);
 
+            writePrims(cellShapes, ensightGeometryFile);
 
-void Foam::ensightMesh::writePolysNPointsPerFaceBinary
-(
-    const labelList& polys,
-    const cellList& cellFaces,
-    const faceList& faces,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    forAll(polys, i)
-    {
-        const labelList& cf = cellFaces[polys[i]];
+            for (int slave=1; slave<Pstream::nProcs(); slave++)
+            {
+                IPstream fromSlave(Pstream::scheduled, slave);
+                cellShapeList cellShapes(fromSlave);
 
-        forAll(cf, faceI)
+                writePrims(cellShapes, ensightGeometryFile);
+            }
+        }
+        else
         {
-            writeEnsDataBinary
-            (
-                faces[cf[faceI]].size(),
-                ensightGeometryFile
-            );
+            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
+            toMaster<< cellShapes;
         }
     }
 }
 
 
-void Foam::ensightMesh::writePolysPointsBinary
+void Foam::ensightMesh::writeFacePrims
 (
-    const labelList& polys,
-    const cellList& cellFaces,
-    const faceList& faces,
-    std::ofstream& ensightGeometryFile
+    const faceList& patchFaces,
+    ensightStream& ensightGeometryFile
 ) const
 {
-    forAll(polys, i)
+    forAll(patchFaces, i)
     {
-        const labelList& cf = cellFaces[polys[i]];
+        const face& patchFace = patchFaces[i];
 
-        forAll(cf, faceI)
+        List<int> temp(patchFace.size());
+        forAll(patchFace, pointI)
         {
-            const face& f = faces[cf[faceI]];
-
-            forAll(f, pointI)
-            {
-                writeEnsDataBinary(f[pointI] + 1,ensightGeometryFile);
-            }
+            temp[pointI] = patchFace[pointI] + 1;
         }
+
+        ensightGeometryFile.write(temp);
     }
 }
 
 
-void Foam::ensightMesh::writeAllPolysBinary
+void Foam::ensightMesh::writeAllFacePrims
 (
-    const labelList& pointToGlobal,
-    std::ofstream& ensightGeometryFile
+    const char* key,
+    const labelList& prims,
+    const label nPrims,
+    const faceList& patchFaces,
+    ensightStream& ensightGeometryFile
 ) const
 {
-    if (meshCellSets_.nPolys)
+    if (nPrims)
     {
-        const cellList& cellFaces = mesh_.cells();
-        // Renumber faces to use global point numbers
-        faceList faces(mesh_.faces());
-        forAll(faces, i)
-        {
-            inplaceRenumber(pointToGlobal, faces[i]);
-        }
-
         if (Pstream::master())
         {
-            writeEnsDataBinary("nfaced",ensightGeometryFile);
-            writeEnsDataBinary(meshCellSets_.nPolys,ensightGeometryFile);
-        }
+            ensightGeometryFile.write(key);
+            ensightGeometryFile.write(nPrims);
 
-        // Number of faces for each poly cell
-        if (Pstream::master())
-        {
-            // Master
-            writePolysNFacesBinary
+            writeFacePrims
             (
-                meshCellSets_.polys,
-                cellFaces,
+                UIndirectList<face>(patchFaces, prims)(),
                 ensightGeometryFile
             );
-            // Slaves
+
             for (int slave=1; slave<Pstream::nProcs(); slave++)
             {
                 IPstream fromSlave(Pstream::scheduled, slave);
-                labelList polys(fromSlave);
-                cellList cellFaces(fromSlave);
+                faceList patchFaces(fromSlave);
 
-                writePolysNFacesBinary
-                (
-                    polys,
-                    cellFaces,
-                    ensightGeometryFile
-                );
+                writeFacePrims(patchFaces, ensightGeometryFile);
             }
         }
         else
         {
             OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< meshCellSets_.polys << cellFaces;
+            toMaster<< UIndirectList<face>(patchFaces, prims);
         }
+    }
+}
 
-        // Number of points for each face of the above list
+
+void Foam::ensightMesh::writeNSidedNPointsPerFace
+(
+    const faceList& patchFaces,
+    ensightStream& ensightGeometryFile
+) const
+{
+    forAll(patchFaces, i)
+    {
+        ensightGeometryFile.write(patchFaces[i].size());
+    }
+}
+
+
+void Foam::ensightMesh::writeNSidedPoints
+(
+    const faceList& patchFaces,
+    ensightStream& ensightGeometryFile
+) const
+{
+    writeFacePrims(patchFaces, ensightGeometryFile);
+}
+
+
+void Foam::ensightMesh::writeAllNSided
+(
+    const labelList& prims,
+    const label nPrims,
+    const faceList& patchFaces,
+    ensightStream& ensightGeometryFile
+) const
+{
+    if (nPrims)
+    {
         if (Pstream::master())
         {
-            // Master
-            writePolysNPointsPerFaceBinary
+            ensightGeometryFile.write("nsided");
+            ensightGeometryFile.write(nPrims);
+        }
+
+        // Number of points for each face
+        if (Pstream::master())
+        {
+            writeNSidedNPointsPerFace
             (
-                meshCellSets_.polys,
-                cellFaces,
-                faces,
+                UIndirectList<face>(patchFaces, prims)(),
                 ensightGeometryFile
             );
-            // Slaves
+
             for (int slave=1; slave<Pstream::nProcs(); slave++)
             {
                 IPstream fromSlave(Pstream::scheduled, slave);
-                labelList polys(fromSlave);
-                cellList cellFaces(fromSlave);
-                faceList faces(fromSlave);
+                faceList patchFaces(fromSlave);
 
-                writePolysNPointsPerFaceBinary
+                writeNSidedNPointsPerFace
                 (
-                    polys,
-                    cellFaces,
-                    faces,
+                    patchFaces,
                     ensightGeometryFile
                 );
             }
@@ -886,977 +874,130 @@ void Foam::ensightMesh::writeAllPolysBinary
         else
         {
             OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< meshCellSets_.polys << cellFaces << faces;
+            toMaster<< UIndirectList<face>(patchFaces, prims);
         }
 
-        // List of points id for each face of the above list
+        // List of points id for each face
         if (Pstream::master())
         {
-            // Master
-            writePolysPointsBinary
+            writeNSidedPoints
             (
-                meshCellSets_.polys,
-                cellFaces,
-                faces,
+                UIndirectList<face>(patchFaces, prims)(),
                 ensightGeometryFile
             );
-            // Slaves
+
             for (int slave=1; slave<Pstream::nProcs(); slave++)
             {
                 IPstream fromSlave(Pstream::scheduled, slave);
-                labelList polys(fromSlave);
-                cellList cellFaces(fromSlave);
-                faceList faces(fromSlave);
+                faceList patchFaces(fromSlave);
 
-                writePolysPointsBinary
-                (
-                    polys,
-                    cellFaces,
-                    faces,
-                    ensightGeometryFile
-                );
+                writeNSidedPoints(patchFaces, ensightGeometryFile);
             }
         }
         else
         {
             OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< meshCellSets_.polys << cellFaces << faces;
+            toMaster<< UIndirectList<face>(patchFaces, prims);
         }
     }
 }
 
 
-void Foam::ensightMesh::writeAllPrims
+void Foam::ensightMesh::writeAllInternalPoints
 (
-    const char* key,
-    const label nPrims,
-    const cellShapeList& cellShapes,
-    OFstream& ensightGeometryFile
+    const pointField& uniquePoints,
+    const label nPoints,
+    ensightStream& ensightGeometryFile
 ) const
 {
-    if (nPrims)
+    barrier();
+
+    if (Pstream::master())
     {
-        if (Pstream::master())
+        ensightGeometryFile.writePartHeader(1);
+        ensightGeometryFile.write("internalMesh");
+        ensightGeometryFile.write("coordinates");
+        ensightGeometryFile.write(nPoints);
+
+        for (direction d=0; d<vector::nComponents; d++)
         {
-            ensightGeometryFile << key << nl << setw(10) << nPrims << nl;
+            ensightGeometryFile.write(uniquePoints.component(d));
 
-            writePrims(cellShapes, ensightGeometryFile);
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                cellShapeList cellShapes(fromSlave);
-
-                writePrims(cellShapes, ensightGeometryFile);
-            }
-        }
-        else
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< cellShapes;
-        }
-    }
-}
-
-
-void Foam::ensightMesh::writeAllPrimsBinary
-(
-    const char* key,
-    const label nPrims,
-    const cellShapeList& cellShapes,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    if (nPrims)
-    {
-        if (Pstream::master())
-        {
-            writeEnsDataBinary(key,ensightGeometryFile);
-            writeEnsDataBinary(nPrims,ensightGeometryFile);
-
-            writePrimsBinary(cellShapes, ensightGeometryFile);
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                cellShapeList cellShapes(fromSlave);
-
-                writePrimsBinary(cellShapes, ensightGeometryFile);
-            }
-        }
-        else
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< cellShapes;
-        }
-    }
-}
-
-
-void Foam::ensightMesh::writeFacePrims
-(
-    const faceList& patchFaces,
-    OFstream& ensightGeometryFile
-) const
-{
-    forAll(patchFaces, i)
-    {
-        const face& patchFace = patchFaces[i];
-
-        forAll(patchFace, pointI)
-        {
-            ensightGeometryFile << setw(10) << patchFace[pointI] + 1;
-        }
-        ensightGeometryFile << nl;
-    }
-}
-
-
-void Foam::ensightMesh::writeFacePrimsBinary
-(
-    const faceList& patchFaces,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    forAll(patchFaces, i)
-    {
-        const face& patchFace = patchFaces[i];
-
-        forAll(patchFace, pointI)
-        {
-            writeEnsDataBinary(patchFace[pointI] + 1, ensightGeometryFile);
-        }
-    }
-}
-
-
-void Foam::ensightMesh::writeAllFacePrims
-(
-    const char* key,
-    const labelList& prims,
-    const label nPrims,
-    const faceList& patchFaces,
-    OFstream& ensightGeometryFile
-) const
-{
-    if (nPrims)
-    {
-        if (Pstream::master())
-        {
-            ensightGeometryFile << key << nl << setw(10) << nPrims << nl;
-
-            writeFacePrims
-            (
-                UIndirectList<face>(patchFaces, prims)(),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                faceList patchFaces(fromSlave);
-
-                writeFacePrims(patchFaces, ensightGeometryFile);
-            }
-        }
-        else
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< UIndirectList<face>(patchFaces, prims);
-        }
-    }
-}
-
-
-void Foam::ensightMesh::writeNSidedNPointsPerFace
-(
-    const faceList& patchFaces,
-    OFstream& ensightGeometryFile
-) const
-{
-    forAll(patchFaces, i)
-    {
-        ensightGeometryFile << setw(10) << patchFaces[i].size() << nl;
-    }
-}
-
-
-void Foam::ensightMesh::writeNSidedPoints
-(
-    const faceList& patchFaces,
-    OFstream& ensightGeometryFile
-) const
-{
-    writeFacePrims(patchFaces, ensightGeometryFile);
-}
-
-
-void Foam::ensightMesh::writeAllNSided
-(
-    const labelList& prims,
-    const label nPrims,
-    const faceList& patchFaces,
-    OFstream& ensightGeometryFile
-) const
-{
-    if (nPrims)
-    {
-        if (Pstream::master())
-        {
-            ensightGeometryFile
-                << "nsided" << nl << setw(10) << nPrims << nl;
-        }
-
-        // Number of points for each face
-        if (Pstream::master())
-        {
-            writeNSidedNPointsPerFace
-            (
-                UIndirectList<face>(patchFaces, prims)(),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                faceList patchFaces(fromSlave);
-
-                writeNSidedNPointsPerFace
-                (
-                    patchFaces,
-                    ensightGeometryFile
-                );
-            }
-        }
-        else
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< UIndirectList<face>(patchFaces, prims);
-        }
-
-        // List of points id for each face
-        if (Pstream::master())
-        {
-            writeNSidedPoints
-            (
-                UIndirectList<face>(patchFaces, prims)(),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                faceList patchFaces(fromSlave);
-
-                writeNSidedPoints(patchFaces, ensightGeometryFile);
-            }
-        }
-        else
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< UIndirectList<face>(patchFaces, prims);
-        }
-    }
-}
-
-
-void Foam::ensightMesh::writeNSidedPointsBinary
-(
-    const faceList& patchFaces,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    writeFacePrimsBinary(patchFaces, ensightGeometryFile);
-}
-
-
-void Foam::ensightMesh::writeNSidedNPointsPerFaceBinary
-(
-    const faceList& patchFaces,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    forAll(patchFaces, i)
-    {
-        writeEnsDataBinary(patchFaces[i].size(), ensightGeometryFile);
-    }
-}
-
-
-void Foam::ensightMesh::writeAllNSidedBinary
-(
-    const labelList& prims,
-    const label nPrims,
-    const faceList& patchFaces,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    if (nPrims)
-    {
-        if (Pstream::master())
-        {
-            writeEnsDataBinary("nsided",ensightGeometryFile);
-            writeEnsDataBinary(nPrims,ensightGeometryFile);
-        }
-
-        // Number of points for each face
-        if (Pstream::master())
-        {
-            writeNSidedNPointsPerFaceBinary
-            (
-                UIndirectList<face>(patchFaces, prims)(),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                faceList patchFaces(fromSlave);
-
-                writeNSidedNPointsPerFaceBinary
-                (
-                    patchFaces,
-                    ensightGeometryFile
-                );
-            }
-        }
-        else
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< UIndirectList<face>(patchFaces, prims);
-        }
-
-        // List of points id for each face
-        if (Pstream::master())
-        {
-            writeNSidedPointsBinary
-            (
-                UIndirectList<face>(patchFaces, prims)(),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                faceList patchFaces(fromSlave);
-
-                writeNSidedPointsBinary(patchFaces, ensightGeometryFile);
-            }
-        }
-        else
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< UIndirectList<face>(patchFaces, prims);
-        }
-    }
-}
-
-
-void Foam::ensightMesh::writeAllFacePrimsBinary
-(
-    const char* key,
-    const labelList& prims,
-    const label nPrims,
-    const faceList& patchFaces,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    if (nPrims)
-    {
-        if (Pstream::master())
-        {
-            writeEnsDataBinary(key,ensightGeometryFile);
-            writeEnsDataBinary(nPrims,ensightGeometryFile);
-
-            writeFacePrimsBinary
-            (
-                UIndirectList<face>(patchFaces, prims)(),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                faceList patchFaces(fromSlave);
-
-                writeFacePrimsBinary(patchFaces, ensightGeometryFile);
-            }
-        }
-        else
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< UIndirectList<face>(patchFaces, prims);
-        }
-    }
-}
-
-
-void Foam::ensightMesh::write
-(
-    const fileName& postProcPath,
-    const word& prepend,
-    const label timeIndex,
-    Ostream& ensightCaseFile
-) const
-{
-    // Find global point numbering
-    labelList pointToGlobal;
-    labelList uniquePointMap;
-    autoPtr<globalIndex> globalPoints = mesh_.globalData().mergePoints
-    (
-        pointToGlobal,
-        uniquePointMap
-    );
-
-    const pointField uniquePoints(mesh_.points(), uniquePointMap);
-
-    if (binary_)
-    {
-        writeBinary
-        (
-            postProcPath,
-            prepend,
-            timeIndex,
-            ensightCaseFile,
-            pointToGlobal,
-            uniquePoints,
-            globalPoints()
-        );
-    }
-    else
-    {
-        writeAscii
-        (
-            postProcPath,
-            prepend,
-            timeIndex,
-            ensightCaseFile,
-            pointToGlobal,
-            uniquePoints,
-            globalPoints()
-        );
-    }
-}
-
-void Foam::ensightMesh::writeAllInternalPoints
-(
-    const pointField& uniquePoints,
-    const label nPoints,
-    OFstream& ensightGeometryFile
-) const
-{
-    barrier();
-
-    if (Pstream::master())
-    {
-        ensightGeometryFile
-            << "part" << nl
-            << setw(10) << 1 << nl
-            << "internalMesh" << nl
-            << "coordinates" << nl
-            << setw(10) << nPoints
-            << endl;
-
-        for (direction d=0; d<vector::nComponents; d++)
-        {
-            writePoints(uniquePoints.component(d), ensightGeometryFile);
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                scalarField pointsComponent(fromSlave);
-                writePoints(pointsComponent, ensightGeometryFile);
-            }
-        }
-    }
-    else
-    {
-        for (direction d=0; d<vector::nComponents; d++)
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< uniquePoints.component(d);
-        }
-    }
-}
-
-void Foam::ensightMesh::writeAllInternalPointsBinary
-(
-    const pointField& uniquePoints,
-    const label nPoints,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    barrier();
-
-    if (Pstream::master())
-    {
-        writeEnsDataBinary("part",ensightGeometryFile);
-        writeEnsDataBinary(1,ensightGeometryFile);
-        writeEnsDataBinary("internalMesh",ensightGeometryFile);
-        writeEnsDataBinary("coordinates",ensightGeometryFile);
-        writeEnsDataBinary(nPoints,ensightGeometryFile);
-
-        for (direction d=0; d<vector::nComponents; d++)
-        {
-            writeEnsDataBinary
-            (
-                uniquePoints.component(d),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                scalarField pointsComponent(fromSlave);
-                writeEnsDataBinary(pointsComponent, ensightGeometryFile);
-            }
-        }
-    }
-    else
-    {
-        for (direction d=0; d<vector::nComponents; d++)
-        {
-            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
-            toMaster<< uniquePoints.component(d);
-        }
-    }
-}
-
-void Foam::ensightMesh::writeAllPatchPoints
-(
-    const label ensightPatchI,
-    const word& patchName,
-    const pointField& uniquePoints,
-    const label nPoints,
-    OFstream& ensightGeometryFile
-) const
-{
-    barrier();
-
-    if (Pstream::master())
-    {
-        ensightGeometryFile
-            << "part" << nl
-            << setw(10) << ensightPatchI << nl
-            << patchName << nl
-            << "coordinates" << nl
-            << setw(10) << nPoints // globalPointsPtr().size()
-            << endl;
-
-        for (direction d=0; d<vector::nComponents; d++)
-        {
-            writePoints
-            (
-                uniquePoints.component(d),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                scalarField patchPointsComponent(fromSlave);
-
-                writePoints
-                (
-                    patchPointsComponent,
-                    ensightGeometryFile
-                );
-            }
-        }
-    }
-    else
-    {
-        for (direction d=0; d<vector::nComponents; d++)
-        {
-            OPstream toMaster
-            (
-                Pstream::scheduled,
-                Pstream::masterNo()
-            );
-            toMaster<< uniquePoints.component(d);
-        }
-    }
-}
-
-void Foam::ensightMesh::writeAllPatchPointsBinary
-(
-    const label ensightPatchI,
-    const word& patchName,
-    const pointField& uniquePoints,
-    const label nPoints,
-    std::ofstream& ensightGeometryFile
-) const
-{
-    barrier();
-
-    if (Pstream::master())
-    {
-        writeEnsDataBinary("part",ensightGeometryFile);
-        writeEnsDataBinary(ensightPatchI,ensightGeometryFile);
-        //writeEnsDataBinary(patchName.c_str(),ensightGeometryFile);
-        writeEnsDataBinary(patchName.c_str(),ensightGeometryFile);
-        writeEnsDataBinary("coordinates",ensightGeometryFile);
-        writeEnsDataBinary
-        (
-            nPoints, //globalPointsPtr().size(),
-            ensightGeometryFile
-        );
-
-        for (direction d=0; d<vector::nComponents; d++)
-        {
-            //writePointsBinary
-            writeEnsDataBinary
-            (
-                uniquePoints.component(d),
-                ensightGeometryFile
-            );
-
-            for (int slave=1; slave<Pstream::nProcs(); slave++)
-            {
-                IPstream fromSlave(Pstream::scheduled, slave);
-                scalarField patchPointsComponent(fromSlave);
-
-                //writePointsBinary
-                writeEnsDataBinary
-                (
-                    patchPointsComponent,
-                    ensightGeometryFile
-                );
-            }
-        }
-    }
-    else
-    {
-        for (direction d=0; d<vector::nComponents; d++)
-        {
-            OPstream toMaster
-            (
-                Pstream::scheduled,
-                Pstream::masterNo()
-            );
-            toMaster<< uniquePoints.component(d);
-        }
-    }
-}
-
-void Foam::ensightMesh::writeAscii
-(
-    const fileName& postProcPath,
-    const word& prepend,
-    const label timeIndex,
-    Ostream& ensightCaseFile,
-    const labelList& pointToGlobal,
-    const pointField& uniquePoints,
-    const globalIndex& globalPoints
-) const
-{
-    const Time& runTime = mesh_.time();
-    //const pointField& points = mesh_.points();
-    const cellShapeList& cellShapes = mesh_.cellShapes();
-
-
-    word timeFile = prepend;
-
-    if (timeIndex == 0)
-    {
-        timeFile += "000.";
-    }
-    else if (mesh_.moving())
-    {
-        timeFile += itoa(timeIndex) + '.';
-    }
-
-    // set the filename of the ensight file
-    fileName ensightGeometryFileName = timeFile + "mesh";
-
-    OFstream *ensightGeometryFilePtr = NULL;
-    if (Pstream::master())
-    {
-        ensightGeometryFilePtr = new OFstream
-        (
-            postProcPath/ensightGeometryFileName,
-            runTime.writeFormat(),
-            runTime.writeVersion(),
-            IOstream::UNCOMPRESSED
-        );
-    }
-
-    OFstream& ensightGeometryFile = *ensightGeometryFilePtr;
-
-    if (Pstream::master())
-    {
-        // Set Format
-        ensightGeometryFile.setf
-        (
-            ios_base::scientific,
-            ios_base::floatfield
-        );
-        ensightGeometryFile.precision(5);
-
-        ensightGeometryFile
-            << "EnSight Geometry File" << nl
-            << "written by OpenFOAM-" << Foam::FOAMversion << nl
-            << "node id assign" << nl
-            << "element id assign" << nl;
-    }
-
-    if (patchNames_.empty())
-    {
-        label nPoints = globalPoints.size();
-
-        writeAllInternalPoints
-        (
-            uniquePoints,
-            nPoints,
-            ensightGeometryFile
-        );
-
-        writeAllPrims
-        (
-            "hexa8",
-            meshCellSets_.nHexesWedges,
-            map         // Rewrite cellShapes to global numbering
-            (
-                cellShapes,
-                meshCellSets_.hexes,
-                meshCellSets_.wedges,
-                pointToGlobal
-            ),
-            ensightGeometryFile
-        );
-
-        writeAllPrims
-        (
-            "penta6",
-            meshCellSets_.nPrisms,
-            map(cellShapes, meshCellSets_.prisms, pointToGlobal),
-            ensightGeometryFile
-        );
-
-        writeAllPrims
-        (
-            "pyramid5",
-            meshCellSets_.nPyrs,
-            map(cellShapes, meshCellSets_.pyrs, pointToGlobal),
-            ensightGeometryFile
-        );
-
-        writeAllPrims
-        (
-            "tetra4",
-            meshCellSets_.nTets,
-            map(cellShapes, meshCellSets_.tets, pointToGlobal),
-            ensightGeometryFile
-        );
-
-        writeAllPolys
-        (
-            pointToGlobal,
-            ensightGeometryFile
-        );
+            for (int slave=1; slave<Pstream::nProcs(); slave++)
+            {
+                IPstream fromSlave(Pstream::scheduled, slave);
+                scalarField pointsComponent(fromSlave);
+                ensightGeometryFile.write(pointsComponent);
+            }
+        }
+    }
+    else
+    {
+        for (direction d=0; d<vector::nComponents; d++)
+        {
+            OPstream toMaster(Pstream::scheduled, Pstream::masterNo());
+            toMaster<< uniquePoints.component(d);
+        }
     }
+}
 
 
-    label ensightPatchI = patchPartOffset_;
+void Foam::ensightMesh::writeAllPatchPoints
+(
+    const label ensightPatchI,
+    const word& patchName,
+    const pointField& uniquePoints,
+    const label nPoints,
+    ensightStream& ensightGeometryFile
+) const
+{
+    barrier();
 
-    forAll(allPatchNames_, patchi)
+    if (Pstream::master())
     {
-        const word& patchName = allPatchNames_[patchi];
+        ensightGeometryFile.writePartHeader(ensightPatchI);
+        ensightGeometryFile.write(patchName.c_str());
+        ensightGeometryFile.write("coordinates");
+        ensightGeometryFile.write(nPoints);
 
-        if (patchNames_.empty() || patchNames_.found(patchName))
+        for (direction d=0; d<vector::nComponents; d++)
         {
-            const nFacePrimitives& nfp = nPatchPrims_[patchName];
-
-            if (nfp.nTris || nfp.nQuads || nfp.nPolys)
+            ensightGeometryFile.write(uniquePoints.component(d));
+            for (int slave=1; slave<Pstream::nProcs(); slave++)
             {
-                const polyPatch& p = mesh_.boundaryMesh()[patchi];
-                const labelList& tris = boundaryFaceSets_[patchi].tris;
-                const labelList& quads = boundaryFaceSets_[patchi].quads;
-                const labelList& polys = boundaryFaceSets_[patchi].polys;
-
-                // Renumber the patch points/faces into unique points
-                labelList pointToGlobal;
-                labelList uniqueMeshPointLabels;
-                autoPtr<globalIndex> globalPointsPtr =
-                mesh_.globalData().mergePoints
-                (
-                    p.meshPoints(),
-                    p.meshPointMap(),
-                    pointToGlobal,
-                    uniqueMeshPointLabels
-                );
-
-                pointField uniquePoints(mesh_.points(), uniqueMeshPointLabels);
-                // Renumber the patch faces
-                faceList patchFaces(p.localFaces());
-                forAll(patchFaces, i)
-                {
-                    inplaceRenumber(pointToGlobal, patchFaces[i]);
-                }
-
-                writeAllPatchPoints
-                (
-                    ensightPatchI++,
-                    patchName,
-                    uniquePoints,
-                    globalPointsPtr().size(),
-                    ensightGeometryFile
-                );
-
-                writeAllFacePrims
-                (
-                    "tria3",
-                    tris,
-                    nfp.nTris,
-                    patchFaces,
-                    ensightGeometryFile
-                );
-
-                writeAllFacePrims
-                (
-                    "quad4",
-                    quads,
-                    nfp.nQuads,
-                    patchFaces,
-                    ensightGeometryFile
-                );
-
-                writeAllNSided
-                (
-                    polys,
-                    nfp.nPolys,
-                    patchFaces,
-                    ensightGeometryFile
-                );
+                IPstream fromSlave(Pstream::scheduled, slave);
+                scalarField patchPointsComponent(fromSlave);
+                ensightGeometryFile.write(patchPointsComponent);
             }
         }
     }
-
-    // write faceZones, if requested
-    forAllConstIter(wordHashSet, faceZoneNames_, iter)
+    else
     {
-        const word& faceZoneName = iter.key();
-
-        label faceID = mesh_.faceZones().findZoneID(faceZoneName);
-
-        const faceZone& fz = mesh_.faceZones()[faceID];
-
-        const nFacePrimitives& nfp = nFaceZonePrims_[faceZoneName];
-
-        if (nfp.nTris || nfp.nQuads || nfp.nPolys)
+        for (direction d=0; d<vector::nComponents; d++)
         {
-            const labelList& tris = faceZoneFaceSets_[faceID].tris;
-            const labelList& quads = faceZoneFaceSets_[faceID].quads;
-            const labelList& polys = faceZoneFaceSets_[faceID].polys;
-
-            // Renumber the faceZone points/faces into unique points
-            labelList pointToGlobal;
-            labelList uniqueMeshPointLabels;
-            autoPtr<globalIndex> globalPointsPtr =
-            mesh_.globalData().mergePoints
-            (
-                fz().meshPoints(),
-                fz().meshPointMap(),
-                pointToGlobal,
-                uniqueMeshPointLabels
-            );
-
-            pointField uniquePoints(mesh_.points(), uniqueMeshPointLabels);
-
-            // Find the list of master faces belonging to the faceZone,
-            // in loacal numbering
-            faceList faceZoneFaces(fz().localFaces());
-
-            // Count how many master faces belong to the faceZone. Is there
-            // a better way of doing this?
-            label nMasterFaces = 0;
-
-            forAll(fz, faceI)
-            {
-                if (faceToBeIncluded(fz[faceI]))
-                {
-                    ++nMasterFaces;
-                }
-            }
-
-            // Create the faceList for the master faces only and fill it.
-            faceList faceZoneMasterFaces(nMasterFaces);
-
-            label currentFace = 0;
-
-            forAll(fz, faceI)
-            {
-                if (faceToBeIncluded(fz[faceI]))
-                {
-                    faceZoneMasterFaces[currentFace] = faceZoneFaces[faceI];
-                    ++currentFace;
-                }
-            }
-
-            // Renumber the faceZone master faces
-            forAll(faceZoneMasterFaces, i)
-            {
-                inplaceRenumber(pointToGlobal, faceZoneMasterFaces[i]);
-            }
-
-            writeAllPatchPoints
-            (
-                ensightPatchI++,
-                faceZoneName,
-                uniquePoints,
-                globalPointsPtr().size(),
-                ensightGeometryFile
-            );
-
-            writeAllFacePrims
-            (
-                "tria3",
-                tris,
-                nfp.nTris,
-                faceZoneMasterFaces,
-                ensightGeometryFile
-            );
-
-            writeAllFacePrims
-            (
-                "quad4",
-                quads,
-                nfp.nQuads,
-                faceZoneMasterFaces,
-                ensightGeometryFile
-            );
-
-            writeAllNSided
+            OPstream toMaster
             (
-                polys,
-                nfp.nPolys,
-                faceZoneMasterFaces,
-                ensightGeometryFile
+                Pstream::scheduled,
+                Pstream::masterNo()
             );
+            toMaster<< uniquePoints.component(d);
         }
     }
-
-
-    if (Pstream::master())
-    {
-        delete ensightGeometryFilePtr;
-    }
 }
 
 
-void Foam::ensightMesh::writeBinary
+void Foam::ensightMesh::write
 (
     const fileName& postProcPath,
     const word& prepend,
     const label timeIndex,
-    Ostream& ensightCaseFile,
-    const labelList& pointToGlobal,
-    const pointField& uniquePoints,
-    const globalIndex& globalPoints
+    Ostream& ensightCaseFile
 ) const
 {
+    const Time& runTime = mesh_.time();
     const cellShapeList& cellShapes = mesh_.cellShapes();
 
+
     word timeFile = prepend;
 
     if (timeIndex == 0)
@@ -1871,43 +1012,54 @@ void Foam::ensightMesh::writeBinary
     // set the filename of the ensight file
     fileName ensightGeometryFileName = timeFile + "mesh";
 
-    std::ofstream *ensightGeometryFilePtr = NULL;
-
+    ensightStream* ensightGeometryFilePtr = NULL;
     if (Pstream::master())
     {
-        ensightGeometryFilePtr = new std::ofstream
-        (
-            (postProcPath/ensightGeometryFileName).c_str(),
-            ios_base::out | ios_base::binary | ios_base::trunc
-        );
-        // Check on file opened?
+        if (binary_)
+        {
+            ensightGeometryFilePtr = new ensightBinaryStream
+            (
+                postProcPath/ensightGeometryFileName,
+                runTime
+            );
+            ensightGeometryFilePtr->write("C binary");
+        }
+        else
+        {
+            ensightGeometryFilePtr = new ensightAsciiStream
+            (
+                postProcPath/ensightGeometryFileName,
+                runTime
+            );
+        }
     }
 
-    std::ofstream& ensightGeometryFile = *ensightGeometryFilePtr;
+    ensightStream& ensightGeometryFile = *ensightGeometryFilePtr;
 
     if (Pstream::master())
     {
-        string description = string("written by OpenFOAM-") + Foam::FOAMversion;
-        writeEnsDataBinary("C binary", ensightGeometryFile);
-        writeEnsDataBinary("EnSight Geometry File", ensightGeometryFile);
-        writeEnsDataBinary(description.c_str(), ensightGeometryFile);
-        writeEnsDataBinary("node id assign", ensightGeometryFile);
-        writeEnsDataBinary("element id assign", ensightGeometryFile);
-    }
+        string desc = string("written by OpenFOAM-") + Foam::FOAMversion;
 
+        ensightGeometryFile.write("EnSight Geometry File");
+        ensightGeometryFile.write(desc.c_str());
+        ensightGeometryFile.write("node id assign");
+        ensightGeometryFile.write("element id assign");
+    }
 
     if (patchNames_.empty())
     {
-        label nPoints = globalPoints.size();
+        label nPoints = globalPoints().size();
 
-        writeAllInternalPointsBinary
+        const pointField uniquePoints(mesh_.points(), uniquePointMap_);
+
+        writeAllInternalPoints
         (
             uniquePoints,
             nPoints,
             ensightGeometryFile
         );
 
-        writeAllPrimsBinary
+        writeAllPrims
         (
             "hexa8",
             meshCellSets_.nHexesWedges,
@@ -1916,53 +1068,52 @@ void Foam::ensightMesh::writeBinary
                 cellShapes,
                 meshCellSets_.hexes,
                 meshCellSets_.wedges,
-                pointToGlobal
+                pointToGlobal_
             ),
             ensightGeometryFile
         );
 
-        writeAllPrimsBinary
+        writeAllPrims
         (
             "penta6",
             meshCellSets_.nPrisms,
-            map(cellShapes, meshCellSets_.prisms, pointToGlobal),
+            map(cellShapes, meshCellSets_.prisms, pointToGlobal_),
             ensightGeometryFile
         );
 
-        writeAllPrimsBinary
+        writeAllPrims
         (
             "pyramid5",
             meshCellSets_.nPyrs,
-            map(cellShapes, meshCellSets_.pyrs, pointToGlobal),
+            map(cellShapes, meshCellSets_.pyrs, pointToGlobal_),
             ensightGeometryFile
         );
 
-        writeAllPrimsBinary
+        writeAllPrims
         (
             "tetra4",
             meshCellSets_.nTets,
-            map(cellShapes, meshCellSets_.tets, pointToGlobal),
+            map(cellShapes, meshCellSets_.tets, pointToGlobal_),
             ensightGeometryFile
         );
 
-        writeAllPolysBinary
+        writeAllPolys
         (
-            pointToGlobal,
+            pointToGlobal_,
             ensightGeometryFile
         );
     }
 
+
     label ensightPatchI = patchPartOffset_;
-    label iCount = 0;
 
     forAll(allPatchNames_, patchi)
     {
-        iCount ++;
         const word& patchName = allPatchNames_[patchi];
 
         if (patchNames_.empty() || patchNames_.found(patchName))
         {
-            const nFacePrimitives& nfp = nPatchPrims_.find(patchName)();
+            const nFacePrimitives& nfp = nPatchPrims_[patchName];
 
             if (nfp.nTris || nfp.nQuads || nfp.nPolys)
             {
@@ -1982,6 +1133,7 @@ void Foam::ensightMesh::writeBinary
                     pointToGlobal,
                     uniqueMeshPointLabels
                 );
+
                 pointField uniquePoints(mesh_.points(), uniqueMeshPointLabels);
                 // Renumber the patch faces
                 faceList patchFaces(p.localFaces());
@@ -1990,7 +1142,7 @@ void Foam::ensightMesh::writeBinary
                     inplaceRenumber(pointToGlobal, patchFaces[i]);
                 }
 
-                writeAllPatchPointsBinary
+                writeAllPatchPoints
                 (
                     ensightPatchI++,
                     patchName,
@@ -1999,7 +1151,7 @@ void Foam::ensightMesh::writeBinary
                     ensightGeometryFile
                 );
 
-                writeAllFacePrimsBinary
+                writeAllFacePrims
                 (
                     "tria3",
                     tris,
@@ -2008,7 +1160,7 @@ void Foam::ensightMesh::writeBinary
                     ensightGeometryFile
                 );
 
-                writeAllFacePrimsBinary
+                writeAllFacePrims
                 (
                     "quad4",
                     quads,
@@ -2017,7 +1169,7 @@ void Foam::ensightMesh::writeBinary
                     ensightGeometryFile
                 );
 
-                writeAllNSidedBinary
+                writeAllNSided
                 (
                     polys,
                     nfp.nPolys,
@@ -2090,13 +1242,12 @@ void Foam::ensightMesh::writeBinary
             }
 
             // Renumber the faceZone master faces
-
             forAll(faceZoneMasterFaces, i)
             {
                 inplaceRenumber(pointToGlobal, faceZoneMasterFaces[i]);
             }
 
-            writeAllPatchPointsBinary
+            writeAllPatchPoints
             (
                 ensightPatchI++,
                 faceZoneName,
@@ -2105,7 +1256,7 @@ void Foam::ensightMesh::writeBinary
                 ensightGeometryFile
             );
 
-            writeAllFacePrimsBinary
+            writeAllFacePrims
             (
                 "tria3",
                 tris,
@@ -2114,7 +1265,7 @@ void Foam::ensightMesh::writeBinary
                 ensightGeometryFile
             );
 
-            writeAllFacePrimsBinary
+            writeAllFacePrims
             (
                 "quad4",
                 quads,
@@ -2123,7 +1274,7 @@ void Foam::ensightMesh::writeBinary
                 ensightGeometryFile
             );
 
-            writeAllNSidedBinary
+            writeAllNSided
             (
                 polys,
                 nfp.nPolys,
@@ -2133,7 +1284,6 @@ void Foam::ensightMesh::writeBinary
         }
     }
 
-
     if (Pstream::master())
     {
         delete ensightGeometryFilePtr;
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.H
index 46442efc59992983a7d02a26750a31268a10d95c..f7db81bbc13ca4dfbe05741a21a46d1580cb169a 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.H
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightMesh.H
@@ -38,10 +38,13 @@ SourceFiles
 #include "faceSets.H"
 #include "HashTable.H"
 #include "HashSet.H"
-#include "fvMesh.H"
-#include "OFstream.H"
-#include <fstream>
 #include "PackedBoolList.H"
+#include "wordReList.H"
+#include "scalarField.H"
+#include "cellShapeList.H"
+#include "cellList.H"
+
+#include <fstream>
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -51,6 +54,7 @@ namespace Foam
 class fvMesh;
 class argList;
 class globalIndex;
+class ensightStream;
 
 /*---------------------------------------------------------------------------*\
                            Class ensightMesh Declaration
@@ -82,8 +86,19 @@ private:
         //- Reference to the OpenFOAM mesh
         const fvMesh& mesh_;
 
+        //- Suppress patches
+        const bool noPatches_;
+
+        //- Output selected patches only
+        const bool patches_;
+        const wordReList patchPatterns_;
+
+        //- Output selected faceZones
+        const bool faceZones_;
+        const wordReList faceZonePatterns_;
+
         //- Set binary file output
-        bool binary_;
+        const bool binary_;
 
         //- The ensight part id for the first patch
         label patchPartOffset_;
@@ -109,6 +124,19 @@ private:
         PackedBoolList boundaryFaceToBeIncluded_;
 
 
+        // Parallel merged points
+
+            //- Global numbering for merged points
+            autoPtr<globalIndex> globalPointsPtr_;
+
+            //- From mesh point to global merged point
+            labelList pointToGlobal_;
+
+            //- Local points that are unique
+            labelList uniquePointMap_;
+
+
+
     // Private Member Functions
 
         //- Disallow default bitwise copy construct
@@ -120,7 +148,7 @@ private:
         void writePoints
         (
             const scalarField& pointsComponent,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         cellShapeList map
@@ -141,14 +169,14 @@ private:
         void writePrims
         (
             const cellShapeList& cellShapes,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writePolysNFaces
         (
             const labelList& polys,
             const cellList& cellFaces,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writePolysNPointsPerFace
@@ -156,7 +184,7 @@ private:
             const labelList& polys,
             const cellList& cellFaces,
             const faceList& faces,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writePolysPoints
@@ -164,13 +192,13 @@ private:
             const labelList& polys,
             const cellList& cellFaces,
             const faceList& faces,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeAllPolys
         (
             const labelList& pointToGlobal,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeAllPrims
@@ -178,13 +206,13 @@ private:
             const char* key,
             const label nPrims,
             const cellShapeList& cellShapes,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeFacePrims
         (
             const faceList& patchFaces,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeAllFacePrims
@@ -193,19 +221,19 @@ private:
             const labelList& prims,
             const label nPrims,
             const faceList& patchFaces,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeNSidedNPointsPerFace
         (
             const faceList& patchFaces,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeNSidedPoints
         (
             const faceList& patchFaces,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeAllNSided
@@ -213,14 +241,14 @@ private:
             const labelList& prims,
             const label nPrims,
             const faceList& patchFaces,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeAllInternalPoints
         (
             const pointField& uniquePoints,
             const label nPoints,
-            OFstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
         void writeAllPatchPoints
@@ -229,123 +257,7 @@ private:
             const word& patchName,
             const pointField& uniquePoints,
             const label nPoints,
-            OFstream& ensightGeometryFile
-        ) const;
-
-        void writeAllInternalPointsBinary
-        (
-            const pointField& uniquePoints,
-            const label nPoints,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeAllPatchPointsBinary
-        (
-            label ensightPatchI,
-            const word& patchName,
-            const pointField& uniquePoints,
-            const label nPoints,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeAscii
-        (
-            const fileName& postProcPath,
-            const word& prepend,
-            const label timeIndex,
-            Ostream& ensightCaseFile,
-            const labelList& pointToGlobal,
-            const pointField& uniquePoints,
-            const globalIndex& globalPoints
-        ) const;
-
-        void writeBinary
-        (
-            const fileName& postProcPath,
-            const word& prepend,
-            const label timeIndex,
-            Ostream& ensightCaseFile,
-            const labelList& pointToGlobal,
-            const pointField& uniquePoints,
-            const globalIndex& globalPoints
-        ) const;
-
-        void writePrimsBinary
-        (
-            const cellShapeList& cellShapes,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeAllPrimsBinary
-        (
-            const char* key,
-            const label nPrims,
-            const cellShapeList& cellShapes,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writePolysNFacesBinary
-        (
-            const labelList& polys,
-            const cellList& cellFaces,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writePolysNPointsPerFaceBinary
-        (
-            const labelList& polys,
-            const cellList& cellFaces,
-            const faceList& faces,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writePolysPointsBinary
-        (
-            const labelList& polys,
-            const cellList& cellFaces,
-            const faceList& faces,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeAllPolysBinary
-        (
-            const labelList& pointToGlobal,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeAllFacePrimsBinary
-        (
-            const char* key,
-            const labelList& prims,
-            const label nPrims,
-            const faceList& patchFaces,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeFacePrimsBinary
-        (
-            const faceList& patchFaces,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeNSidedPointsBinary
-        (
-            const faceList& patchFaces,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeNSidedNPointsPerFaceBinary
-        (
-            const faceList& patchFaces,
-            std::ofstream& ensightGeometryFile
-        ) const;
-
-        void writeAllNSidedBinary
-        (
-            const labelList& prims,
-            const label nPrims,
-            const faceList& patchFaces,
-            std::ofstream& ensightGeometryFile
+            ensightStream& ensightGeometryFile
         ) const;
 
 public:
@@ -355,8 +267,12 @@ public:
         //- Construct from fvMesh
         ensightMesh
         (
-            const fvMesh&,
-            const argList& args,
+            const fvMesh& mesh,
+            const bool noPatches,
+            const bool patches,
+            const wordReList& patchPatterns,
+            const bool faceZones,
+            const wordReList& faceZonePatterns,
             const bool binary
         );
 
@@ -420,8 +336,35 @@ public:
                 return patchPartOffset_;
             }
 
+
+        // Parallel point merging
+
+            //- Global numbering for merged points
+            const globalIndex& globalPoints() const
+            {
+                return globalPointsPtr_();
+            }
+
+            //- From mesh point to global merged point
+            const labelList& pointToGlobal() const
+            {
+                return pointToGlobal_;
+            }
+
+            //- Local points that are unique
+            const labelList& uniquePointMap() const
+            {
+                return uniquePointMap_;
+            }
+
+
+
+
     // Other
 
+        //- Update for new mesh
+        void correct();
+
         //- When exporting faceZones, check if a given face has to be included
         //  or not (i.e. faces on processor boundaries)
         bool faceToBeIncluded(const label faceI) const;
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightStream.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightStream.H
new file mode 100644
index 0000000000000000000000000000000000000000..60be47dcdab822895eb6356e478f0a72e427aa63
--- /dev/null
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightStream.H
@@ -0,0 +1,112 @@
+/*---------------------------------------------------------------------------*\
+  =========                 |
+  \\      /  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::ensightStream
+
+Description
+    Abstract base class for writing Ensight data
+
+SourceFiles
+    ensightStream.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef ensightStream_H
+#define ensightStream_H
+
+#include "fileName.H"
+#include "scalarField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+
+/*---------------------------------------------------------------------------*\
+                         Class ensightStream Declaration
+\*---------------------------------------------------------------------------*/
+
+class ensightStream
+{
+    // Private data
+
+        const fileName name_;
+
+    // Private Member Functions
+
+        //- Disallow default bitwise copy construct
+        ensightStream(const ensightStream&);
+
+        //- Disallow default bitwise assignment
+        void operator=(const ensightStream&);
+
+
+public:
+
+    // Constructors
+
+        //- Construct from components
+        ensightStream(const fileName& f)
+        :
+            name_(f)
+        {}
+
+
+    //- Destructor
+    virtual ~ensightStream()
+    {}
+
+
+    // Member Functions
+
+        const fileName& name() const
+        {
+            return name_;
+        }
+
+        virtual void write(const char*) = 0;
+
+        virtual void write(const int) = 0;
+
+        virtual void write(const scalarField&) = 0;
+
+        virtual void write(const List<int>&) = 0;
+
+        virtual void writePartHeader(const label) = 0;
+
+
+
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightWriteBinary.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightWriteBinary.C
deleted file mode 100644
index bd3c2342fadb96575d71506ab540fd6adbed375f..0000000000000000000000000000000000000000
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightWriteBinary.C
+++ /dev/null
@@ -1,78 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-\*---------------------------------------------------------------------------*/
-
-#include "ensightWriteBinary.H"
-#include <fstream>
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-void writeEnsDataBinary
-(
-    const char* val,
-    std::ofstream& ensFile
-)
-{
-    char buffer[80] = {0};
-    strcpy(buffer, val);
-    ensFile.write(buffer, 80*sizeof(char));
-}
-
-
-void writeEnsDataBinary
-(
-    const int val,
-    std::ofstream& ensFile
-)
-{
-    ensFile.write(reinterpret_cast<const char*>(&val), sizeof(int));
-}
-
-
-void writeEnsDataBinary
-(
-    const scalarField& sf,
-    std::ofstream& ensightFile
-)
-{
-    if (sf.size())
-    {
-        List<float> temp(sf.size());
-
-        forAll(sf, i)
-        {
-            temp[i] = float(sf[i]);
-        }
-
-        ensightFile.write
-        (
-            reinterpret_cast<char*>(temp.begin()),
-            sf.size()*sizeof(float)
-        );
-    }
-}
-
-
-// ************************************************************************* //
-
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightWriteBinary.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightWriteBinary.H
deleted file mode 100644
index e29a823e15927489e6b799fafb25d2e54b04f2b1..0000000000000000000000000000000000000000
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/ensightWriteBinary.H
+++ /dev/null
@@ -1,67 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software: you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by
-    the Free Software Foundation, either version 3 of the License, or
-    (at your option) any later version.
-
-    OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
-    ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-    FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
-    for more details.
-
-    You should have received a copy of the GNU General Public License
-    along with OpenFOAM.  If not, see <http://www.gnu.org/licenses/>.
-
-InApplication
-    foamToEnsight
-
-Description
-    Collection of functions for binary write in EnSight files
-
-SourceFiles
-    ensightWriteBinary.C
-
-\*---------------------------------------------------------------------------*/
-
-#ifndef ensightWriteBinary_H
-#define ensightWriteBinary_H
-
-#include "ensightMesh.H"
-
-using namespace Foam;
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-void writeEnsDataBinary
-(
-    const char* val,
-    std::ofstream& ensFile
-);
-
-void writeEnsDataBinary
-(
-    const int val,
-    std::ofstream& ensFile
-);
-
-
-void writeEnsDataBinary
-(
-    const scalarField& sf,
-    std::ofstream& ensightFile
-);
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-#endif
-
-// ************************************************************************* //
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/faceSets.H b/applications/utilities/postProcessing/dataConversion/foamToEnsight/faceSets.H
index edf25fa34df1242f2f5495b1619c4087989997cd..f5d396b86eb0d78a992b2a39f2a90feb89bdd8fb 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/faceSets.H
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/faceSets.H
@@ -44,15 +44,6 @@ namespace Foam
 
 class faceSets
 {
-    // Private Member Functions
-
-        //- Disallow default bitwise copy construct
-        faceSets(const faceSets&);
-
-        //- Disallow default bitwise assignment
-        void operator=(const faceSets&);
-
-
 public:
 
         label nTris;
diff --git a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C
index dff5d8b8c8e7902a787ba2fcfd857e9944e65a5a..ba2bfccf9af6ab31ff67bfe0bd3e54136c709791 100644
--- a/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C
+++ b/applications/utilities/postProcessing/dataConversion/foamToEnsight/foamToEnsight.C
@@ -104,6 +104,11 @@ int main(int argc, char *argv[])
         "write in ASCII format instead of 'C Binary'"
     );
     argList::addBoolOption
+    (
+        "nodeValues",
+        "write values in nodes"
+    );
+    argList::addBoolOption
     (
         "noPatches",
         "suppress writing any patches"
@@ -126,6 +131,7 @@ int main(int argc, char *argv[])
 
     // Check options
     const bool binary = !args.optionFound("ascii");
+    const bool nodeValues = args.optionFound("nodeValues");
 
 #   include "createTime.H"
 
@@ -191,7 +197,29 @@ int main(int argc, char *argv[])
     OFstream& ensightCaseFile = *ensightCaseFilePtr;
 
     // Construct the EnSight mesh
-    ensightMesh eMesh(mesh, args, binary);
+    const bool selectedPatches = args.optionFound("patches");
+    wordReList patchPatterns;
+    if (selectedPatches)
+    {
+        patchPatterns = wordReList(args.optionLookup("patches")());
+    }
+    const bool selectedZones = args.optionFound("faceZones");
+    wordReList zonePatterns;
+    if (selectedZones)
+    {
+        zonePatterns = wordReList(args.optionLookup("faceZones")());
+    }
+
+    ensightMesh eMesh
+    (
+        mesh,
+        args.optionFound("noPatches"),
+        selectedPatches,
+        patchPatterns,
+        selectedZones,
+        zonePatterns,
+        binary
+    );
 
     // Set Time to the last time before looking for the lagrangian objects
     runTime.setTime(Times.last(), Times.size()-1);
@@ -313,6 +341,11 @@ int main(int argc, char *argv[])
 
         polyMesh::readUpdateState meshState = mesh.readUpdate();
 
+        if (meshState != polyMesh::UNCHANGED)
+        {
+            eMesh.correct();
+        }
+
         if (timeIndex == 0 || (meshState != polyMesh::UNCHANGED))
         {
             eMesh.write
@@ -371,6 +404,7 @@ int main(int argc, char *argv[])
                         prepend,
                         timeIndex,
                         binary,
+                        nodeValues,
                         ensightCaseFile
                     );
                 }
@@ -384,6 +418,7 @@ int main(int argc, char *argv[])
                         prepend,
                         timeIndex,
                         binary,
+                        nodeValues,
                         ensightCaseFile
                     );
                 }
@@ -397,6 +432,7 @@ int main(int argc, char *argv[])
                         prepend,
                         timeIndex,
                         binary,
+                        nodeValues,
                         ensightCaseFile
                     );
                 }
@@ -410,6 +446,7 @@ int main(int argc, char *argv[])
                         prepend,
                         timeIndex,
                         binary,
+                        nodeValues,
                         ensightCaseFile
                     );
                 }
@@ -423,6 +460,7 @@ int main(int argc, char *argv[])
                         prepend,
                         timeIndex,
                         binary,
+                        nodeValues,
                         ensightCaseFile
                     );
                 }
diff --git a/bin/tools/CleanFunctions b/bin/tools/CleanFunctions
index e40da98d01b4ccb19a02f3ada5521d7cc7c81d14..3256ff4ba65588b553f94fd256d05eb6764ba83d 100644
--- a/bin/tools/CleanFunctions
+++ b/bin/tools/CleanFunctions
@@ -76,6 +76,11 @@ cleanCase()
            sets/streamLines \
            > /dev/null 2>&1
 
+    if [ -e constant/polyMesh/blockMeshDict.m4 ]
+    then
+        rm -f constant/polyMesh/blockMeshDict > /dev/null 2>&1
+    fi
+
     for f in `find . -name "*Dict"`
     do
         sed -e /arguments/d $f > temp.$$
diff --git a/doc/changes/splitCyclic.txt b/doc/changes/splitCyclic.txt
index 814dfe0850cd3c4afe0857cbf24c7d1a34f687cc..3d0ffb71cf5e414f24f51731ce7a96ca404ef425 100644
--- a/doc/changes/splitCyclic.txt
+++ b/doc/changes/splitCyclic.txt
@@ -20,7 +20,8 @@ The disadvantages:
 - a patch-wise loop now might need to store data to go to the neighbour half
 since it is no longer handled in a single patch.
 - decomposed cyclics now require overlapping communications so will
-only work in non-blocking mode. Hence the underlying message passing library
+only work in 'nonBlocking' mode or 'blocking' (=buffered) mode but not
+in 'scheduled' mode. The underlying message passing library
 will require overlapping communications with message tags.
 - it is quite a code-change and there might be some oversights.
 - once converted (see foamUpgradeCyclics below) cases are not backwards
@@ -103,19 +104,14 @@ type 'processorCyclic'.
 
 
 - processor patches use overlapping communication using a different message
-tag. This maps straight through into the MPI message tag.
-See processorCyclicPolyPatch::tag(). This needs to be calculated the
-same on both sides so is calculated as
-        Pstream::nProcs()*max(myProcNo, neighbProcNo)
-      + min(myProcNo, neighbProcNo)
-which is
-- unique
-- commutative
-- does not interfere with the default tag (= 1)
+tag. This maps straight through into the MPI message tag. Each processor
+'interface' (processorPolyPatch, processorFvPatch, etc.) has a 'tag()'
+to use for communication.
 
 
 - when constructing a GeometricField from a dictionary it will explicitly
 check for non-existing entries for cyclic patches and exit with an error message
-warning to run foamUpgradeCyclics.
+warning to run foamUpgradeCyclics. (1.7.x will check if you are trying
+to run a case which has split cyclics)
 
 
diff --git a/src/OpenFOAM/Make/files b/src/OpenFOAM/Make/files
index d9548b67b10db88609ca0f132f6652b569fff356..94bc86f2efeacf8cfc767223e141b8b27c02f058 100644
--- a/src/OpenFOAM/Make/files
+++ b/src/OpenFOAM/Make/files
@@ -296,6 +296,7 @@ primitiveShapes = meshes/primitiveShapes
 $(primitiveShapes)/line/line.C
 $(primitiveShapes)/plane/plane.C
 $(primitiveShapes)/triangle/intersection.C
+$(primitiveShapes)/objectHit/pointIndexHitIOList.C
 
 meshShapes = meshes/meshShapes
 $(meshShapes)/edge/edge.C
diff --git a/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H b/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H
index 0d41f70c151c0b5e3722e070794e938a32af6f66..ec65a14a1bfb4f4994026069c549676f809fb105 100644
--- a/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H
+++ b/src/OpenFOAM/containers/Lists/IndirectList/IndirectList.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -25,7 +25,11 @@ Class
     Foam::IndirectList
 
 Description
-    A List with indirect addressing
+    A List with indirect addressing.
+
+SeeAlso
+    Foam::UIndirectList for a version without any allocation for the
+    addressing.
 
 SourceFiles
     IndirectListI.H
@@ -35,7 +39,7 @@ SourceFiles
 #ifndef IndirectList_H
 #define IndirectList_H
 
-#include "List.H"
+#include "UIndirectList.H"
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
@@ -43,81 +47,109 @@ namespace Foam
 {
 
 /*---------------------------------------------------------------------------*\
-                        Class IndirectList Declaration
+                   Class IndirectListAddressing Declaration
 \*---------------------------------------------------------------------------*/
 
-template<class T>
-class IndirectList
+//- A helper class for storing addresses.
+class IndirectListAddressing
 {
     // Private data
 
-        UList<T>& completeList_;
+        //- Storage for the list addressing
         List<label> addressing_;
 
 
-public:
+    // Private Member Functions
+
+        //- Disallow default bitwise copy construct
+        IndirectListAddressing(const IndirectListAddressing&);
+
+        //- Disallow default bitwise assignment
+        void operator=(const IndirectListAddressing&);
+
+
+protected:
 
     // Constructors
 
-        //- Construct given the complete list and the addressing array
-        inline IndirectList(const UList<T>&, const UList<label>&);
+        //- Construct by copying the addressing array
+        explicit inline IndirectListAddressing(const UList<label>& addr);
 
-        //- Construct given the complete list and by transferring addressing
-        inline IndirectList(const UList<T>&, const Xfer<List<label> >&);
+        //- Construct by transferring addressing array
+        explicit inline IndirectListAddressing(const Xfer<List<label> >& addr);
 
 
     // Member Functions
 
         // Access
 
-            //- Return the number of elements in the list
-            inline label size() const;
+            //- Return the list addressing
+            inline const List<label>& addressing() const;
 
-            //- Return true if the list is empty (ie, size() is zero).
-            inline bool empty() const;
+        // Edit
 
-            //- Return the first element of the list.
-            inline T& first();
+            //- Reset addressing
+            inline void resetAddressing(const UList<label>&);
+            inline void resetAddressing(const Xfer<List<label> >&);
 
-            //- Return first element of the list.
-            inline const T& first() const;
+};
 
-            //- Return the last element of the list.
-            inline T& last();
 
-            //- Return the last element of the list.
-            inline const T& last() const;
+/*---------------------------------------------------------------------------*\
+                        Class IndirectList Declaration
+\*---------------------------------------------------------------------------*/
 
-            //- Return the complete list
-            inline const UList<T>& completeList() const;
+template<class T>
+class IndirectList
+:
+    private IndirectListAddressing,
+    public  UIndirectList<T>
+{
+    // Private Member Functions
 
-            //- Return the list addressing
-            inline const List<label>& addressing() const;
+        //- Disable default assignment operator
+        void operator=(const IndirectList<T>&);
 
+        //- Disable assignment from UIndirectList
+        void operator=(const UIndirectList<T>&);
 
-        // Edit
 
-            //- Reset addressing
-            inline void resetAddressing(const UList<label>&);
-            inline void resetAddressing(const Xfer<List<label> >&);
+public:
+
+    // Constructors
 
+        //- Construct given the complete list and the addressing array
+        inline IndirectList(const UList<T>&, const UList<label>&);
 
-        // Member Operators
+        //- Construct given the complete list and by transferring addressing
+        inline IndirectList(const UList<T>&, const Xfer<List<label> >&);
 
-            //- Return the addressed elements as a List
-            inline List<T> operator()() const;
+        //- Copy constructor
+        inline IndirectList(const IndirectList<T>&);
 
-            //- Return non-const access to an element
-            inline T& operator[](const label);
+        //- Construct from UIndirectList
+        explicit inline IndirectList(const UIndirectList<T>&);
 
-            //- Return const access to an element
-            inline const T& operator[](const label) const;
 
-            //- Assignment from UList of addressed elements
-            inline void operator=(const UList<T>&);
+    // Member Functions
+
+
+        // Access
+
+            //- Return the list addressing
+            using UIndirectList<T>::addressing;
+
+
+        // Edit
+
+            //- Reset addressing
+            using IndirectListAddressing::resetAddressing;
+
+
+        // Member Operators
 
-            //- Assignment of all entries to the given value
-            inline void operator=(const T&);
+            //- Assignment operator
+            using UIndirectList<T>::operator=;
 };
 
 
diff --git a/src/OpenFOAM/containers/Lists/IndirectList/IndirectListI.H b/src/OpenFOAM/containers/Lists/IndirectList/IndirectListI.H
index dfcc20d537165ac6c5a29e7a5f54fe3c9e519131..0303ba2d5eb9164eef9e428fdc8ddb39e33d05c8 100644
--- a/src/OpenFOAM/containers/Lists/IndirectList/IndirectListI.H
+++ b/src/OpenFOAM/containers/Lists/IndirectList/IndirectListI.H
@@ -2,7 +2,7 @@
   =========                 |
   \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
    \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2010 OpenCFD Ltd.
+    \\  /    A nd           | Copyright (C) 2010-2010 OpenCFD Ltd.
      \\/     M anipulation  |
 -------------------------------------------------------------------------------
 License
@@ -25,90 +25,97 @@ License
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-template<class T>
-inline Foam::IndirectList<T>::IndirectList
+
+inline Foam::IndirectListAddressing::IndirectListAddressing
 (
-    const UList<T>& completeList,
     const UList<label>& addr
 )
 :
-    completeList_(const_cast<UList<T>&>(completeList)),
     addressing_(addr)
 {}
 
 
-template<class T>
-inline Foam::IndirectList<T>::IndirectList
+inline Foam::IndirectListAddressing::IndirectListAddressing
 (
-    const UList<T>& completeList,
     const Xfer<List<label> >& addr
 )
 :
-    completeList_(const_cast<UList<T>&>(completeList)),
     addressing_(addr)
 {}
 
 
-// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
-
-template<class T>
-inline Foam::label Foam::IndirectList<T>::size() const
-{
-    return addressing_.size();
-}
-
-
 template<class T>
-inline bool Foam::IndirectList<T>::empty() const
-{
-    return addressing_.empty();
-}
-
-
-template<class T>
-inline T& Foam::IndirectList<T>::first()
-{
-    return completeList_[addressing_.first()];
-}
+inline Foam::IndirectList<T>::IndirectList
+(
+    const UList<T>& completeList,
+    const UList<label>& addr
+)
+:
+    IndirectListAddressing(addr),
+    UIndirectList<T>
+    (
+        completeList,
+        IndirectListAddressing::addressing()
+    )
+{}
 
 
 template<class T>
-inline const T& Foam::IndirectList<T>::first() const
-{
-    return completeList_[addressing_.first()];
-}
+inline Foam::IndirectList<T>::IndirectList
+(
+    const UList<T>& completeList,
+    const Xfer<List<label> >& addr
+)
+:
+    IndirectListAddressing(addr),
+    UIndirectList<T>
+    (
+        completeList,
+        IndirectListAddressing::addressing()
+    )
+{}
 
 
 template<class T>
-inline T& Foam::IndirectList<T>::last()
-{
-    return completeList_[addressing_.last()];
-}
+inline Foam::IndirectList<T>::IndirectList
+(
+    const IndirectList<T>& lst
+)
+:
+    IndirectListAddressing(lst.addressing()),
+    UIndirectList<T>
+    (
+        lst.completeList(),
+        IndirectListAddressing::addressing()
+    )
+{}
 
 
 template<class T>
-inline const T& Foam::IndirectList<T>::last() const
-{
-    return completeList_[addressing_.last()];
-}
-
+inline Foam::IndirectList<T>::IndirectList
+(
+    const UIndirectList<T>& lst
+)
+:
+    IndirectListAddressing(lst.addressing()),
+    UIndirectList<T>
+    (
+        lst.completeList(),
+        IndirectListAddressing::addressing()
+    )
+{}
 
-template<class T>
-inline const Foam::UList<T>& Foam::IndirectList<T>::completeList() const
-{
-    return completeList_;
-}
 
+// * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
-template<class T>
-inline const Foam::List<Foam::label>& Foam::IndirectList<T>::addressing() const
+inline const Foam::List<Foam::label>&
+Foam::IndirectListAddressing::addressing() const
 {
     return addressing_;
 }
 
 
-template<class T>
-inline void Foam::IndirectList<T>::resetAddressing
+inline void Foam::IndirectListAddressing::resetAddressing
 (
     const UList<label>& addr
 )
@@ -117,8 +124,7 @@ inline void Foam::IndirectList<T>::resetAddressing
 }
 
 
-template<class T>
-inline void Foam::IndirectList<T>::resetAddressing
+inline void Foam::IndirectListAddressing::resetAddressing
 (
     const Xfer<List<label> >& addr
 )
@@ -127,63 +133,4 @@ inline void Foam::IndirectList<T>::resetAddressing
 }
 
 
-// * * * * * * * * * * * * * * * Member Operators  * * * * * * * * * * * * * //
-
-template<class T>
-inline Foam::List<T> Foam::IndirectList<T>::operator()() const
-{
-    List<T> result(size());
-
-    forAll(*this, i)
-    {
-        result[i] = operator[](i);
-    }
-
-    return result;
-}
-
-
-template<class T>
-inline T& Foam::IndirectList<T>::operator[](const label i)
-{
-    return completeList_[addressing_[i]];
-}
-
-
-template<class T>
-inline const T& Foam::IndirectList<T>::operator[](const label i) const
-{
-    return completeList_[addressing_[i]];
-}
-
-
-template<class T>
-inline void Foam::IndirectList<T>::operator=(const UList<T>& ae)
-{
-    if (addressing_.size() != ae.size())
-    {
-        FatalErrorIn("IndirectList<T>::operator=(const UList<T>&)")
-            << "Addressing and list of addressed elements "
-               "have different sizes: "
-            << addressing_.size() << " " << ae.size()
-            << abort(FatalError);
-    }
-
-    forAll(addressing_, i)
-    {
-        completeList_[addressing_[i]] = ae[i];
-    }
-}
-
-
-template<class T>
-inline void Foam::IndirectList<T>::operator=(const T& t)
-{
-    forAll(addressing_, i)
-    {
-        completeList_[addressing_[i]] = t;
-    }
-}
-
-
 // ************************************************************************* //
diff --git a/src/OpenFOAM/containers/Lists/List/List.C b/src/OpenFOAM/containers/Lists/List/List.C
index 934fc085f4d5236ea102a79eff2cd6f0d797b9a1..ae4a36a805856686cd3d42816d674bbb98154621 100644
--- a/src/OpenFOAM/containers/Lists/List/List.C
+++ b/src/OpenFOAM/containers/Lists/List/List.C
@@ -266,24 +266,6 @@ Foam::List<T>::List(const SLList<T>& lst)
 }
 
 
-// Construct as copy of IndirectList<T>
-template<class T>
-Foam::List<T>::List(const IndirectList<T>& lst)
-:
-    UList<T>(NULL, lst.size())
-{
-    if (this->size_)
-    {
-        this->v_ = new T[this->size_];
-
-        forAll(*this, i)
-        {
-            this->operator[](i) = lst[i];
-        }
-    }
-}
-
-
 // Construct as copy of UIndirectList<T>
 template<class T>
 Foam::List<T>::List(const UIndirectList<T>& lst)
@@ -517,25 +499,6 @@ void Foam::List<T>::operator=(const SLList<T>& lst)
 }
 
 
-// Assignment operator. Takes linear time.
-template<class T>
-void Foam::List<T>::operator=(const IndirectList<T>& lst)
-{
-    if (lst.size() != this->size_)
-    {
-        if (this->v_) delete[] this->v_;
-        this->v_ = 0;
-        this->size_ = lst.size();
-        if (this->size_) this->v_ = new T[this->size_];
-    }
-
-    forAll(*this, i)
-    {
-        this->operator[](i) = lst[i];
-    }
-}
-
-
 // Assignment operator. Takes linear time.
 template<class T>
 void Foam::List<T>::operator=(const UIndirectList<T>& lst)
diff --git a/src/OpenFOAM/containers/Lists/List/List.H b/src/OpenFOAM/containers/Lists/List/List.H
index 2999e0886ed5826b974c121b9ce2f8c53ad6f6b6..d51a1f9eefcfeb47d113e2ab8966745dcd579edf 100644
--- a/src/OpenFOAM/containers/Lists/List/List.H
+++ b/src/OpenFOAM/containers/Lists/List/List.H
@@ -131,9 +131,6 @@ public:
         //- Construct as copy of SLList<T>
         explicit List(const SLList<T>&);
 
-        //- Construct as copy of IndirectList<T>
-        explicit List(const IndirectList<T>&);
-
         //- Construct as copy of UIndirectList<T>
         explicit List(const UIndirectList<T>&);
 
@@ -219,9 +216,6 @@ public:
         //- Assignment from SLList operator. Takes linear time.
         void operator=(const SLList<T>&);
 
-        //- Assignment from IndirectList operator. Takes linear time.
-        void operator=(const IndirectList<T>&);
-
         //- Assignment from UIndirectList operator. Takes linear time.
         void operator=(const UIndirectList<T>&);
 
diff --git a/src/OpenFOAM/meshes/meshShapes/face/face.H b/src/OpenFOAM/meshes/meshShapes/face/face.H
index 81ce90d8a9d537d2021ab3393bfb50235094f93c..dd5fc4a832b4265e0cd9aa0dd5842c224c13ba22 100644
--- a/src/OpenFOAM/meshes/meshShapes/face/face.H
+++ b/src/OpenFOAM/meshes/meshShapes/face/face.H
@@ -126,6 +126,14 @@ class face
 
 public:
 
+    //- Return types for classify
+    enum proxType
+    {
+        NONE,
+        POINT,  // Close to point
+        EDGE    // Close to edge
+    };
+
     // Static data members
 
         static const char* const typeName;
@@ -249,6 +257,20 @@ public:
             const pointField& meshPoints
         ) const;
 
+        //- Return nearest point to face and classify it:
+        //  + near point (nearType=POINT, nearLabel=0, 1, 2)
+        //  + near edge (nearType=EDGE, nearLabel=0, 1, 2)
+        //    Note: edges are counted from starting vertex so
+        //    e.g. edge n is from f[n] to f[0], where the face has n + 1
+        //    points
+        pointHit nearestPointClassify
+        (
+            const point& p,
+            const pointField& meshPoints,
+            label& nearType,
+            label& nearLabel
+        ) const;
+
         //- Return contact sphere diameter
         scalar contactSphereDiameter
         (
diff --git a/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C b/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C
index d4184e766aa6a3dd225942da99c4d1e964330e83..f9f02eb61293307a29975ff878f75ffaef138ec0 100644
--- a/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C
+++ b/src/OpenFOAM/meshes/meshShapes/face/faceIntersection.C
@@ -181,6 +181,22 @@ Foam::pointHit Foam::face::nearestPoint
     const point& p,
     const pointField& meshPoints
 ) const
+{
+    // Dummy labels
+    label nearType = -1;
+    label nearLabel = -1;
+
+    return nearestPointClassify(p, meshPoints, nearType, nearLabel);
+}
+
+
+Foam::pointHit Foam::face::nearestPointClassify
+(
+    const point& p,
+    const pointField& meshPoints,
+    label& nearType,
+    label& nearLabel
+) const
 {
     const face& f = *this;
     point ctr = centre(meshPoints);
@@ -188,6 +204,9 @@ Foam::pointHit Foam::face::nearestPoint
     // Initialize to miss, distance=GREAT
     pointHit nearest(p);
 
+    nearType = -1;
+    nearLabel = -1;
+
     label nPoints = f.size();
 
     point nextPoint = ctr;
@@ -196,8 +215,10 @@ Foam::pointHit Foam::face::nearestPoint
     {
         nextPoint = meshPoints[f[fcIndex(pI)]];
 
+        label tmpNearType = -1;
+        label tmpNearLabel = -1;
+
         // Note: for best accuracy, centre point always comes last
-        //
         triPointRef tri
         (
             meshPoints[f[pI]],
@@ -205,12 +226,42 @@ Foam::pointHit Foam::face::nearestPoint
             ctr
         );
 
-        pointHit curHit = tri.nearestPoint(p);
+        pointHit curHit = tri.nearestPointClassify
+        (
+            p,
+            tmpNearType,
+            tmpNearLabel
+        );
 
         if (Foam::mag(curHit.distance()) < Foam::mag(nearest.distance()))
         {
             nearest.setDistance(curHit.distance());
 
+            // Assume at first that the near type is NONE on the
+            // triangle (i.e. on the face of the triangle) then it is
+            // therefore also for the face.
+
+            nearType = NONE;
+
+            if (tmpNearType == triPointRef::EDGE && tmpNearLabel == 0)
+            {
+                // If the triangle edge label is 0, then this is also
+                // an edge of the face, if not, it is on the face
+
+                nearType = EDGE;
+
+                nearLabel = pI;
+            }
+            else if (tmpNearType == triPointRef::POINT && tmpNearLabel < 2)
+            {
+                // If the triangle point label is 0 or 1, then this is
+                // also a point of the face, if not, it is on the face
+
+                nearType = POINT;
+
+                nearLabel = pI + tmpNearLabel;
+            }
+
             if (curHit.hit())
             {
                 nearest.setHit();
diff --git a/src/meshTools/octree/PointIndexHit.H b/src/OpenFOAM/meshes/primitiveShapes/objectHit/PointIndexHit.H
similarity index 100%
rename from src/meshTools/octree/PointIndexHit.H
rename to src/OpenFOAM/meshes/primitiveShapes/objectHit/PointIndexHit.H
diff --git a/src/meshTools/octree/pointHitSort.H b/src/OpenFOAM/meshes/primitiveShapes/objectHit/pointHitSort.H
similarity index 100%
rename from src/meshTools/octree/pointHitSort.H
rename to src/OpenFOAM/meshes/primitiveShapes/objectHit/pointHitSort.H
diff --git a/src/meshTools/octree/pointIndexHit.H b/src/OpenFOAM/meshes/primitiveShapes/objectHit/pointIndexHit.H
similarity index 100%
rename from src/meshTools/octree/pointIndexHit.H
rename to src/OpenFOAM/meshes/primitiveShapes/objectHit/pointIndexHit.H
diff --git a/src/meshTools/octree/pointIndexHitIOList.C b/src/OpenFOAM/meshes/primitiveShapes/objectHit/pointIndexHitIOList.C
similarity index 100%
rename from src/meshTools/octree/pointIndexHitIOList.C
rename to src/OpenFOAM/meshes/primitiveShapes/objectHit/pointIndexHitIOList.C
diff --git a/src/meshTools/octree/pointIndexHitIOList.H b/src/OpenFOAM/meshes/primitiveShapes/objectHit/pointIndexHitIOList.H
similarity index 100%
rename from src/meshTools/octree/pointIndexHitIOList.H
rename to src/OpenFOAM/meshes/primitiveShapes/objectHit/pointIndexHitIOList.H
diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H
index 64d9318306fa0322ac3626fccf89bc5f46cc8be6..abb5d7d8e426ea94438536986ff92d9c731e3be0 100644
--- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H
+++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangle.H
@@ -79,21 +79,6 @@ class triangle
 
         PointRef a_, b_, c_;
 
-    // Private Member Functions
-
-        //- Fast distance to triangle calculation. From
-        //  "Distance Between Point and Trangle in 3D"
-        //  David Eberly, Magic Software Inc. Aug. 2002.
-        //  Works on function Q giving distance to point and tries to
-        //  minimize this.
-        static pointHit nearestPoint
-        (
-            const Point& baseVertex,
-            const vector& E0,
-            const vector& E1,
-            const point& P
-        );
-
 
 public:
 
@@ -202,24 +187,27 @@ public:
                 const scalar tol = 0.0
             ) const;
 
-            //- Return nearest point to p on triangle
-            inline pointHit nearestPoint
+            //- Find the nearest point to p on the triangle and classify it:
+            //  + near point (nearType=POINT, nearLabel=0, 1, 2)
+            //  + near edge (nearType=EDGE, nearLabel=0, 1, 2)
+            //    Note: edges are counted from starting
+            //    vertex so e.g. edge 2 is from f[2] to f[0]
+            pointHit nearestPointClassify
             (
-                const point& p
+                const point& p,
+                label& nearType,
+                label& nearLabel
             ) const;
 
-            //- Classify point in triangle plane w.r.t. triangle edges.
-            //  - inside (true returned)/outside (false returned)
-            //  - near point (nearType=POINT, nearLabel=0, 1, 2)
-            //  - near edge (nearType=EDGE, nearLabel=0, 1, 2)
-            //    Note: edges are counted from starting
-            //    vertex so e.g. edge 2 is from f[2] to f[0]
-            //  tol is fraction to account for truncation error. Is only used
-            //  when comparing normalized (0..1) numbers.
+            //- Return nearest point to p on triangle
+            inline pointHit nearestPoint(const point& p) const;
+
+            //- Classify nearest point to p in triangle plane
+            //  w.r.t. triangle edges and points.  Returns inside
+            //  (true)/outside (false).
             bool classify
             (
                 const point& p,
-                const scalar tol,
                 label& nearType,
                 label& nearLabel
             ) const;
diff --git a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H
index 10267a923f720824e5f50a7606f31ae62089fb07..7840d8ee7b4762c7e69c08b5238cb536a486a5a4 100644
--- a/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H
+++ b/src/OpenFOAM/meshes/primitiveShapes/triangle/triangleI.H
@@ -32,158 +32,6 @@ License
 namespace Foam
 {
 
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
-
-template<class Point, class PointRef>
-pointHit triangle<Point, PointRef>::nearestPoint
-(
-    const Point& baseVertex,
-    const vector& E0,
-    const vector& E1,
-    const point& P
-)
-{
-    // Distance vector
-    const vector D(baseVertex - P);
-
-    // Some geometrical factors
-    const scalar a = E0 & E0;
-    const scalar b = E0 & E1;
-    const scalar c = E1 & E1;
-
-    // Precalculate distance factors
-    const scalar d = E0 & D;
-    const scalar e = E1 & D;
-    const scalar f = D & D;
-
-    // Do classification
-    const scalar det = a*c - b*b;
-    scalar s = b*e - c*d;
-    scalar t = b*d - a*e;
-
-    bool inside = false;
-
-    if (s+t < det)
-    {
-        if (s < 0)
-        {
-            if (t < 0)
-            {
-                // Region 4
-                if (e > 0)
-                {
-                    // min on edge t = 0
-                    t = 0;
-                    s = (d >= 0 ? 0 : (-d >= a ? 1 : -d/a));
-                }
-                else
-                {
-                    // min on edge s=0
-                    s = 0;
-                    t = (e >= 0 ? 0 : (-e >= c ? 1 : -e/c));
-                }
-            }
-            else
-            {
-                // Region 3. Min on edge s = 0
-                s = 0;
-                t = (e >= 0 ? 0 : (-e >= c ? 1 : -e/c));
-            }
-        }
-        else if (t < 0)
-        {
-            // Region 5
-            t = 0;
-            s = (d >= 0 ? 0 : (-d >= a ? 1 : -d/a));
-        }
-        else
-        {
-            // Region 0
-            const scalar invDet = 1/det;
-            s *= invDet;
-            t *= invDet;
-
-            inside = true;
-        }
-    }
-    else
-    {
-        if (s < 0)
-        {
-            // Region 2
-            const scalar tmp0 = b + d;
-            const scalar tmp1 = c + e;
-            if (tmp1 > tmp0)
-            {
-                // min on edge s+t=1
-                const scalar numer = tmp1 - tmp0;
-                const scalar denom = a-2*b+c;
-                s = (numer >= denom ? 1 : numer/denom);
-                t = 1 - s;
-            }
-            else
-            {
-                // min on edge s=0
-                s = 0;
-                t = (tmp1 <= 0 ? 1 : (e >= 0 ? 0 : - e/c));
-            }
-        }
-        else if (t < 0)
-        {
-            // Region 6
-            const scalar tmp0 = b + d;
-            const scalar tmp1 = c + e;
-            if (tmp1 > tmp0)
-            {
-                // min on edge s+t=1
-                const scalar numer = tmp1 - tmp0;
-                const scalar denom = a-2*b+c;
-                s = (numer >= denom ? 1 : numer/denom);
-                t = 1 - s;
-            }
-            else
-            {
-                // min on edge t=0
-                t = 0;
-                s = (tmp1 <= 0 ? 1 : (d >= 0 ? 0 : - d/a));
-            }
-        }
-        else
-        {
-            // Region 1
-            const scalar numer = c+e-(b+d);
-            if (numer <= 0)
-            {
-                s = 0;
-            }
-            else
-            {
-                const scalar denom = a-2*b+c;
-                s = (numer >= denom ? 1 : numer/denom);
-            }
-        }
-
-        t = 1 - s;
-    }
-
-    // Calculate distance.
-    // Note: Foam::mag used since truncation error causes negative distances
-    // with points very close to one of the triangle vertices.
-    // (Up to -2.77556e-14 seen). Could use +SMALL but that not large enough.
-
-    return pointHit
-    (
-        inside,
-        baseVertex + s*E0 + t*E1,
-        Foam::sqrt
-        (
-            Foam::mag(a*s*s + 2*b*s*t + c*t*t + 2*d*s + 2*e*t + f)
-        ),
-        !inside
-    );
-}
-
-
 // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
 
 template<class Point, class PointRef>
@@ -247,7 +95,7 @@ inline Point triangle<Point, PointRef>::centre() const
 template<class Point, class PointRef>
 inline scalar triangle<Point, PointRef>::mag() const
 {
-    return ::Foam::mag(normal());
+    return Foam::mag(normal());
 }
 
 
@@ -536,7 +384,7 @@ inline pointHit triangle<Point, PointRef>::ray
         inter.setMiss(eligible);
 
         // The miss point is the nearest point on the triangle
-        inter.setPoint(nearestPoint(a_, E0, E1, p).rawPoint());
+        inter.setPoint(nearestPoint(p).rawPoint());
 
         // The distance to the miss is the distance between the
         // original point and plane of intersection
@@ -634,177 +482,143 @@ inline pointHit triangle<Point, PointRef>::intersection
 
 
 template<class Point, class PointRef>
-inline pointHit triangle<Point, PointRef>::nearestPoint
-(
-    const point& p
-) const
-{
-    // Express triangle in terms of baseVertex (point a_) and
-    // two edge vectors
-    vector E0 = b_ - a_;
-    vector E1 = c_ - a_;
-
-    return nearestPoint(a_, E0, E1, p);
-}
-
-
-template<class Point, class PointRef>
-inline bool triangle<Point, PointRef>::classify
+pointHit triangle<Point, PointRef>::nearestPointClassify
 (
     const point& p,
-    const scalar tol,
     label& nearType,
     label& nearLabel
 ) const
 {
-    const vector E0 = b_ - a_;
-    const vector E1 = c_ - a_;
-    const vector n = 0.5*(E0 ^ E1);
-
-    // Get largest component of normal
-    scalar magX = Foam::mag(n.x());
-    scalar magY = Foam::mag(n.y());
-    scalar magZ = Foam::mag(n.z());
-
-    label i0 = -1;
-    if ((magX >= magY) && (magX >= magZ))
-    {
-        i0 = 0;
-    }
-    else if ((magY >= magX) && (magY >= magZ))
-    {
-        i0 = 1;
-    }
-    else
-    {
-        i0 = 2;
-    }
+    // Adapted from:
+    // Real-time collision detection, Christer Ericson, 2005, 136-142
 
-    // Get other components
-    label i1 = (i0 + 1) % 3;
-    label i2 = (i1 + 1) % 3;
+    // Check if P in vertex region outside A
+    vector ab = b_ - a_;
+    vector ac = c_ - a_;
+    vector ap = p - a_;
 
+    scalar d1 = ab & ap;
+    scalar d2 = ac & ap;
 
-    scalar u1 = E0[i1];
-    scalar v1 = E0[i2];
+    if (d1 <= 0.0 && d2 <= 0.0)
+    {
+        // barycentric coordinates (1, 0, 0)
 
-    scalar u2 = E1[i1];
-    scalar v2 = E1[i2];
+        nearType = POINT;
+        nearLabel = 0;
+        return pointHit(false, a_, Foam::mag(a_ - p), true);
+    }
 
-    scalar det = v2*u1 - u2*v1;
+    // Check if P in vertex region outside B
+    vector bp = p - b_;
+    scalar d3 = ab & bp;
+    scalar d4 = ac & bp;
 
-    scalar u0 = p[i1] - a_[i1];
-    scalar v0 = p[i2] - a_[i2];
+    if (d3 >= 0.0 && d4 <= d3)
+    {
+        // barycentric coordinates (0, 1, 0)
 
-    scalar alpha = 0;
-    scalar beta = 0;
+        nearType = POINT;
+        nearLabel = 1;
+        return pointHit(false, b_, Foam::mag(b_ - p), true);
+    }
 
-    bool hit = false;
+    // Check if P in edge region of AB, if so return projection of P onto AB
+    scalar vc = d1*d4 - d3*d2;
 
-    if (Foam::mag(u1) < ROOTVSMALL)
+    if (vc <= 0.0 && d1 >= 0.0 && d3 <= 0.0)
     {
-        beta = u0/u2;
-
-        alpha = (v0 - beta*v2)/v1;
+        // barycentric coordinates (1-v, v, 0)
+        scalar v = d1/(d1 - d3);
 
-        hit = ((alpha >= 0) && ((alpha + beta) <= 1));
+        point nearPt =  a_ + v*ab;
+        nearType = EDGE;
+        nearLabel = 0;
+        return pointHit(false, nearPt, Foam::mag(nearPt - p), true);
     }
-    else
-    {
-        beta = (v0*u1 - u0*v1)/det;
 
-        alpha = (u0 - beta*u2)/u1;
+    // Check if P in vertex region outside C
+    vector cp = p - c_;
+    scalar d5 = ab & cp;
+    scalar d6 = ac & cp;
 
-        hit = ((alpha >= 0) && ((alpha + beta) <= 1));
-    }
+    if (d6 >= 0.0 && d5 <= d6)
+    {
+        // barycentric coordinates (0, 0, 1)
 
-    //
-    // Now alpha, beta are the coordinates in the triangle local coordinate
-    // system E0, E1
-    //
+        nearType = POINT;
+        nearLabel = 2;
+        return pointHit(false, c_, Foam::mag(c_ - p), true);
+    }
 
-    //Pout<< "alpha:" << alpha << endl;
-    //Pout<< "beta:" << beta << endl;
-    //Pout<< "hit:" << hit << endl;
-    //Pout<< "tol:" << tol << endl;
+    // Check if P in edge region of AC, if so return projection of P onto AC
+    scalar vb = d5*d2 - d1*d6;
 
-    if (hit)
+    if (vb <= 0.0 && d2 >= 0.0 && d6 <= 0.0)
     {
-        // alpha,beta might get negative due to precision errors
-        alpha = max(0.0, min(1.0, alpha));
-        beta = max(0.0, min(1.0, beta));
+        // barycentric coordinates (1-w, 0, w)
+        scalar w = d2/(d2 - d6);
+
+        point nearPt = a_ + w*ac;
+        nearType = EDGE;
+        nearLabel = 2;
+        return pointHit(false, nearPt, Foam::mag(nearPt - p), true);
     }
 
-    nearType = NONE;
-    nearLabel = -1;
+    // Check if P in edge region of BC, if so return projection of P onto BC
+    scalar va = d3*d6 - d5*d4;
 
-    if (Foam::mag(alpha+beta-1) <= tol)
+    if (va <= 0.0 && (d4 - d3) >= 0.0 && (d5 - d6) >= 0.0)
     {
-        // On edge between vert 1-2 (=edge 1)
+        // barycentric coordinates (0, 1-w, w)
+        scalar w = (d4 - d3)/((d4 - d3) + (d5 - d6));
 
-        if (Foam::mag(alpha) <= tol)
-        {
-            nearType = POINT;
-            nearLabel = 2;
-        }
-        else if (Foam::mag(beta) <= tol)
-        {
-            nearType = POINT;
-            nearLabel = 1;
-        }
-        else if ((alpha >= 0) && (alpha <= 1) && (beta >= 0) && (beta <= 1))
-        {
-            nearType = EDGE;
-            nearLabel = 1;
-        }
+        point nearPt = b_ + w*(c_ - b_);
+        nearType = EDGE;
+        nearLabel = 1;
+        return pointHit(false, nearPt, Foam::mag(nearPt - p), true);
     }
-    else if (Foam::mag(alpha) <= tol)
-    {
-        // On edge between vert 2-0 (=edge 2)
 
-        if (Foam::mag(beta) <= tol)
-        {
-            nearType = POINT;
-            nearLabel = 0;
-        }
-        else if (Foam::mag(beta-1) <= tol)
-        {
-            nearType = POINT;
-            nearLabel = 2;
-        }
-        else if ((beta >= 0) && (beta <= 1))
-        {
-            nearType = EDGE;
-            nearLabel = 2;
-        }
-    }
-    else if (Foam::mag(beta) <= tol)
-    {
-        // On edge between vert 0-1 (= edge 0)
+    // P inside face region. Compute Q through its barycentric
+    // coordinates (u, v, w)
+    scalar denom = 1.0/(va + vb + vc);
+    scalar v = vb * denom;
+    scalar w = vc * denom;
 
-        if (Foam::mag(alpha) <= tol)
-        {
-            nearType = POINT;
-            nearLabel = 0;
-        }
-        else if (Foam::mag(alpha-1) <= tol)
-        {
-            nearType = POINT;
-            nearLabel = 1;
-        }
-        else if ((alpha >= 0) && (alpha <= 1))
-        {
-            nearType = EDGE;
-            nearLabel = 0;
-        }
-    }
+    // = u*a + v*b + w*c, u = va*denom = 1.0 - v - w
 
-    return hit;
+    point nearPt = a_ + ab*v + ac*w;
+    nearType = NONE,
+    nearLabel = -1;
+    return pointHit(true, nearPt, Foam::mag(nearPt - p), false);
 }
 
 
+template<class Point, class PointRef>
+inline pointHit triangle<Point, PointRef>::nearestPoint
+(
+    const point& p
+) const
+{
+    // Dummy labels
+    label nearType = -1;
+    label nearLabel = -1;
+
+    return nearestPointClassify(p, nearType, nearLabel);
+}
 
 
+template<class Point, class PointRef>
+inline bool triangle<Point, PointRef>::classify
+(
+    const point& p,
+    label& nearType,
+    label& nearLabel
+) const
+{
+    return nearestPointClassify(p, nearType, nearLabel).hit();
+}
+
 
 // * * * * * * * * * * * * * * * Ostream Operator  * * * * * * * * * * * * * //
 
diff --git a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
index 716c5b12355da55d364cf67daaf22df42dc24c7d..17fa6f71fb093b1b6fcc72eaed4c93577cf95c2e 100644
--- a/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
+++ b/src/finiteVolume/fields/fvPatchFields/derived/directMappedVelocityFluxFixedValue/directMappedVelocityFluxFixedValueFvPatchField.C
@@ -112,13 +112,6 @@ directMappedVelocityFluxFixedValueFvPatchField
             << " in file " << dimensionedInternalField().objectPath()
             << exit(FatalError);
     }
-
-    // Force calculation of schedule (uses parallel comms)
-    const directMappedPolyPatch& mpp = refCast<const directMappedPolyPatch>
-    (
-        this->patch().patch()
-    );
-    (void)mpp.map().schedule();
 }
 
 
diff --git a/src/finiteVolume/fvMesh/singleCellFvMesh/singleCellFvMesh.C b/src/finiteVolume/fvMesh/singleCellFvMesh/singleCellFvMesh.C
index 4955f49007d6236fc0a8a7dfccd1f781c8dc3f39..8eaf3559f582002812642e58e3d0c789218ced0b 100644
--- a/src/finiteVolume/fvMesh/singleCellFvMesh/singleCellFvMesh.C
+++ b/src/finiteVolume/fvMesh/singleCellFvMesh/singleCellFvMesh.C
@@ -42,24 +42,26 @@ void Foam::singleCellFvMesh::agglomerateMesh
     const polyBoundaryMesh& oldPatches = mesh.boundaryMesh();
 
     // Check agglomeration within patch face range and continuous
-    labelList nAgglom(oldPatches.size());
+    labelList nAgglom(oldPatches.size(), 0);
 
     forAll(oldPatches, patchI)
     {
         const polyPatch& pp = oldPatches[patchI];
-
-        nAgglom[patchI] = max(agglom[patchI])+1;
-
-        forAll(pp, i)
+        if (pp.size() > 0)
         {
-            if (agglom[patchI][i] < 0  || agglom[patchI][i] >= pp.size())
+            nAgglom[patchI] = max(agglom[patchI])+1;
+
+            forAll(pp, i)
             {
-                FatalErrorIn
-                (
-                    "singleCellFvMesh::agglomerateMesh(..)"
-                )   << "agglomeration on patch " << patchI
-                    << " is out of range 0.." << pp.size()-1
-                    << exit(FatalError);
+                if (agglom[patchI][i] < 0  || agglom[patchI][i] >= pp.size())
+                {
+                    FatalErrorIn
+                    (
+                        "singleCellFvMesh::agglomerateMesh(..)"
+                    )   << "agglomeration on patch " << patchI
+                        << " is out of range 0.." << pp.size()-1
+                        << exit(FatalError);
+                }
             }
         }
     }
@@ -155,6 +157,8 @@ void Foam::singleCellFvMesh::agglomerateMesh
 
     forAll(oldPatches, patchI)
     {
+        patchStarts[patchI] = coarseI;
+
         const polyPatch& pp = oldPatches[patchI];
 
         if (pp.size() > 0)
@@ -170,8 +174,6 @@ void Foam::singleCellFvMesh::agglomerateMesh
             // From agglomeration to compact patch face
             labelList agglomToFace(nAgglom[patchI], -1);
 
-            patchStarts[patchI] = coarseI;
-
             forAll(pp, i)
             {
                 label myAgglom = agglom[patchI][i];
@@ -223,9 +225,9 @@ void Foam::singleCellFvMesh::agglomerateMesh
                     );
                 }
             }
-
-            patchSizes[patchI] = coarseI-patchStarts[patchI];
         }
+
+        patchSizes[patchI] = coarseI-patchStarts[patchI];
     }
 
     //Pout<< "patchStarts:" << patchStarts << endl;
diff --git a/src/meshTools/Make/files b/src/meshTools/Make/files
index 14e561fcbab7221adc85de4628a2beb592841680..2c9f81195d082b75e3b08a62ede15f2a8ec37d85 100644
--- a/src/meshTools/Make/files
+++ b/src/meshTools/Make/files
@@ -44,7 +44,6 @@ octree/octreeDataFace.C
 octree/treeBoundBox.C
 octree/treeNodeName.C
 octree/treeLeafName.C
-octree/pointIndexHitIOList.C
 
 indexedOctree/indexedOctreeName.C
 indexedOctree/treeDataCell.C
diff --git a/src/meshTools/indexedOctree/indexedOctree.C b/src/meshTools/indexedOctree/indexedOctree.C
index 2f1e13648bca18f1bc684e5ea74e6ac74429b33a..9971bd97b4020119e2c7323ec817abe174573ff4 100644
--- a/src/meshTools/indexedOctree/indexedOctree.C
+++ b/src/meshTools/indexedOctree/indexedOctree.C
@@ -2056,6 +2056,180 @@ void Foam::indexedOctree<Type>::findBox
 }
 
 
+template <class Type>
+template <class CompareOp>
+void Foam::indexedOctree<Type>::findNear
+(
+    const scalar nearDist,
+    const bool okOrder,
+    const indexedOctree<Type>& tree1,
+    const labelBits index1,
+    const treeBoundBox& bb1,
+    const indexedOctree<Type>& tree2,
+    const labelBits index2,
+    const treeBoundBox& bb2,
+    CompareOp& cop
+)
+{
+    const vector nearSpan(nearDist, nearDist, nearDist);
+
+    if (tree1.isNode(index1))
+    {
+        const node& nod1 = tree1.nodes()[tree1.getNode(index1)];
+        const treeBoundBox searchBox
+        (
+            bb1.min()-nearSpan,
+            bb1.max()+nearSpan
+        );
+
+        if (tree2.isNode(index2))
+        {
+            if (bb2.overlaps(searchBox))
+            {
+                const node& nod2 = tree2.nodes()[tree2.getNode(index2)];
+
+                for (direction i2 = 0; i2 < nod2.subNodes_.size(); i2++)
+                {
+                    labelBits subIndex2 = nod2.subNodes_[i2];
+                    const treeBoundBox subBb2
+                    (
+                        tree2.isNode(subIndex2)
+                      ? tree2.nodes()[tree2.getNode(subIndex2)].bb_
+                      : bb2.subBbox(i2)
+                    );
+
+                    findNear
+                    (
+                        nearDist,
+                        !okOrder,
+                        tree2,
+                        subIndex2,
+                        subBb2,
+                        tree1,
+                        index1,
+                        bb1,
+                        cop
+                    );
+                }
+            }
+        }
+        else if (tree2.isContent(index2))
+        {
+            // index2 is leaf, index1 not yet.
+            for (direction i1 = 0; i1 < nod1.subNodes_.size(); i1++)
+            {
+                labelBits subIndex1 = nod1.subNodes_[i1];
+                const treeBoundBox subBb1
+                (
+                    tree1.isNode(subIndex1)
+                  ? tree1.nodes()[tree1.getNode(subIndex1)].bb_
+                  : bb1.subBbox(i1)
+                );
+
+                findNear
+                (
+                    nearDist,
+                    !okOrder,
+                    tree2,
+                    index2,
+                    bb2,
+                    tree1,
+                    subIndex1,
+                    subBb1,
+                    cop
+                );
+            }
+        }
+    }
+    else if (tree1.isContent(index1))
+    {
+        const treeBoundBox searchBox
+        (
+            bb1.min()-nearSpan,
+            bb1.max()+nearSpan
+        );
+
+        if (tree2.isNode(index2))
+        {
+            const node& nod2 =
+                tree2.nodes()[tree2.getNode(index2)];
+
+            if (bb2.overlaps(searchBox))
+            {
+                for (direction i2 = 0; i2 < nod2.subNodes_.size(); i2++)
+                {
+                    labelBits subIndex2 = nod2.subNodes_[i2];
+                    const treeBoundBox subBb2
+                    (
+                        tree2.isNode(subIndex2)
+                      ? tree2.nodes()[tree2.getNode(subIndex2)].bb_
+                      : bb2.subBbox(i2)
+                    );
+
+                    findNear
+                    (
+                        nearDist,
+                        !okOrder,
+                        tree2,
+                        subIndex2,
+                        subBb2,
+                        tree1,
+                        index1,
+                        bb1,
+                        cop
+                    );
+                }
+            }
+        }
+        else if (tree2.isContent(index2))
+        {
+            // Both are leaves. Check n^2.
+
+            const labelList& indices1 =
+                tree1.contents()[tree1.getContent(index1)];
+            const labelList& indices2 =
+                tree2.contents()[tree2.getContent(index2)];
+
+            forAll(indices1, i)
+            {
+                label shape1 = indices1[i];
+
+                forAll(indices2, j)
+                {
+                    label shape2 = indices2[j];
+
+                    if ((&tree1 != &tree2) || (shape1 != shape2))
+                    {
+                        if (okOrder)
+                        {
+                            cop
+                            (
+                                nearDist,
+                                tree1.shapes(),
+                                shape1,
+                                tree2.shapes(),
+                                shape2
+                            );
+                        }
+                        else
+                        {
+                            cop
+                            (
+                                nearDist,
+                                tree2.shapes(),
+                                shape2,
+                                tree1.shapes(),
+                                shape1
+                            );
+                        }
+                    }
+                }
+            }
+        }
+    }
+}
+
+
 // Number of elements in node.
 template <class Type>
 Foam::label Foam::indexedOctree<Type>::countElements
@@ -2620,6 +2794,30 @@ Foam::indexedOctree<Type>::getVolumeType
 }
 
 
+template <class Type>
+template <class CompareOp>
+void Foam::indexedOctree<Type>::findNear
+(
+    const scalar nearDist,
+    const indexedOctree<Type>& tree2,
+    CompareOp& cop
+) const
+{
+    findNear
+    (
+        nearDist,
+        true,
+        *this,
+        nodePlusOctant(0, 0),
+        bb(),
+        tree2,
+        nodePlusOctant(0, 0),
+        tree2.bb(),
+        cop
+    );
+}
+
+
 // Print contents of nodeI
 template <class Type>
 void Foam::indexedOctree<Type>::print
diff --git a/src/meshTools/indexedOctree/indexedOctree.H b/src/meshTools/indexedOctree/indexedOctree.H
index d82603ab4f40ddb98008d900455bf0a34dbf2f2d..980cb346f8ae57800be5a60b5c38fdcd4d7ea31c 100644
--- a/src/meshTools/indexedOctree/indexedOctree.H
+++ b/src/meshTools/indexedOctree/indexedOctree.H
@@ -336,6 +336,22 @@ private:
                 labelHashSet& elements
             ) const;
 
+
+            template <class CompareOp>
+            static void findNear
+            (
+                const scalar nearDist,
+                const bool okOrder,
+                const indexedOctree<Type>& tree1,
+                const labelBits index1,
+                const treeBoundBox& bb1,
+                const indexedOctree<Type>& tree2,
+                const labelBits index2,
+                const treeBoundBox& bb2,
+                CompareOp& cop
+            );
+
+
         // Other
 
             //- Count number of elements on this and sublevels
@@ -581,6 +597,16 @@ public:
                 const point& sample
             );
 
+            //- Find near pairs and apply CompareOp to them.
+            //  tree2 can be *this or different tree.
+            template <class CompareOp>
+            void findNear
+            (
+                const scalar nearDist,
+                const indexedOctree<Type>& tree2,
+                CompareOp& cop
+            ) const;
+
 
         // Write
 
diff --git a/src/meshTools/indexedOctree/treeDataTriSurface.C b/src/meshTools/indexedOctree/treeDataTriSurface.C
index e0f6d1a9df32cd37591245158e4fbce0620d0878..f380167174481939ae61a056bae233485239d815 100644
--- a/src/meshTools/indexedOctree/treeDataTriSurface.C
+++ b/src/meshTools/indexedOctree/treeDataTriSurface.C
@@ -35,145 +35,145 @@ defineTypeNameAndDebug(Foam::treeDataTriSurface, 0);
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
-// Fast distance to triangle calculation. From
-// "Distance Between Point and Trangle in 3D"
-// David Eberly, Magic Software Inc. Aug. 2003.
-// Works on function Q giving distance to point and tries to minimize this.
-Foam::scalar Foam::treeDataTriSurface::nearestCoords
-(
-    const point& base,
-    const point& E0,
-    const point& E1,
-    const scalar a,
-    const scalar b,
-    const scalar c,
-    const point& P,
-    scalar& s,
-    scalar& t
-)
-{
-    // distance vector
-    const vector D(base - P);
-
-    // Precalculate distance factors.
-    const scalar d = E0 & D;
-    const scalar e = E1 & D;
-
-    // Do classification
-    const scalar det = a*c - b*b;
-
-    s = b*e - c*d;
-    t = b*d - a*e;
-
-    if (s+t < det)
-    {
-        if (s < 0)
-        {
-            if (t < 0)
-            {
-                //region 4
-                if (e > 0)
-                {
-                    //min on edge t = 0
-                    t = 0;
-                    s = (d >= 0 ? 0 : (-d >= a ? 1 : -d/a));
-                }
-                else
-                {
-                    //min on edge s=0
-                    s = 0;
-                    t = (e >= 0 ? 0 : (-e >= c ? 1 : -e/c));
-                }
-            }
-            else
-            {
-                //region 3. Min on edge s = 0
-                s = 0;
-                t = (e >= 0 ? 0 : (-e >= c ? 1 : -e/c));
-            }
-        }
-        else if (t < 0)
-        {
-            //region 5
-            t = 0;
-            s = (d >= 0 ? 0 : (-d >= a ? 1 : -d/a));
-        }
-        else
-        {
-            //region 0
-            const scalar invDet = 1/det;
-            s *= invDet;
-            t *= invDet;
-        }
-    }
-    else
-    {
-        if (s < 0)
-        {
-            //region 2
-            const scalar tmp0 = b + d;
-            const scalar tmp1 = c + e;
-            if (tmp1 > tmp0)
-            {
-                //min on edge s+t=1
-                const scalar numer = tmp1 - tmp0;
-                const scalar denom = a-2*b+c;
-                s = (numer >= denom ? 1 : numer/denom);
-                t = 1 - s;
-            }
-            else
-            {
-                //min on edge s=0
-                s = 0;
-                t = (tmp1 <= 0 ? 1 : (e >= 0 ? 0 : - e/c));
-            }
-        }
-        else if (t < 0)
-        {
-            //region 6
-            const scalar tmp0 = b + d;
-            const scalar tmp1 = c + e;
-            if (tmp1 > tmp0)
-            {
-                //min on edge s+t=1
-                const scalar numer = tmp1 - tmp0;
-                const scalar denom = a-2*b+c;
-                s = (numer >= denom ? 1 : numer/denom);
-                t = 1 - s;
-            }
-            else
-            {
-                //min on edge t=0
-                t = 0;
-                s = (tmp1 <= 0 ? 1 : (d >= 0 ? 0 : - d/a));
-            }
-        }
-        else
-        {
-            //region 1
-            const scalar numer = c+e-(b+d);
-            if (numer <= 0)
-            {
-                s = 0;
-            }
-            else
-            {
-                const scalar denom = a-2*b+c;
-                s = (numer >= denom ? 1 : numer/denom);
-            }
-        }
-        t = 1 - s;
-    }
-
-
-    // Calculate distance.
-    // Note: abs should not be needed but truncation error causes problems
-    // with points very close to one of the triangle vertices.
-    // (seen up to -9e-15). Alternatively add some small value.
-
-    const scalar f = D & D;
-    return Foam::mag(a*s*s + 2*b*s*t + c*t*t + 2*d*s + 2*e*t + f);
-}
+// // Fast distance to triangle calculation. From
+// // "Distance Between Point and Triangle in 3D"
+// // David Eberly, Magic Software Inc. Aug. 2003.
+// // Works on function Q giving distance to point and tries to minimize this.
+// Foam::scalar Foam::treeDataTriSurface::nearestCoords
+// (
+//     const point& base,
+//     const point& E0,
+//     const point& E1,
+//     const scalar a,
+//     const scalar b,
+//     const scalar c,
+//     const point& P,
+//     scalar& s,
+//     scalar& t
+// )
+// {
+//     // distance vector
+//     const vector D(base - P);
+
+//     // Precalculate distance factors.
+//     const scalar d = E0 & D;
+//     const scalar e = E1 & D;
+
+//     // Do classification
+//     const scalar det = a*c - b*b;
+
+//     s = b*e - c*d;
+//     t = b*d - a*e;
+
+//     if (s+t < det)
+//     {
+//         if (s < 0)
+//         {
+//             if (t < 0)
+//             {
+//                 //region 4
+//                 if (e > 0)
+//                 {
+//                     //min on edge t = 0
+//                     t = 0;
+//                     s = (d >= 0 ? 0 : (-d >= a ? 1 : -d/a));
+//                 }
+//                 else
+//                 {
+//                     //min on edge s=0
+//                     s = 0;
+//                     t = (e >= 0 ? 0 : (-e >= c ? 1 : -e/c));
+//                 }
+//             }
+//             else
+//             {
+//                 //region 3. Min on edge s = 0
+//                 s = 0;
+//                 t = (e >= 0 ? 0 : (-e >= c ? 1 : -e/c));
+//             }
+//         }
+//         else if (t < 0)
+//         {
+//             //region 5
+//             t = 0;
+//             s = (d >= 0 ? 0 : (-d >= a ? 1 : -d/a));
+//         }
+//         else
+//         {
+//             //region 0
+//             const scalar invDet = 1/det;
+//             s *= invDet;
+//             t *= invDet;
+//         }
+//     }
+//     else
+//     {
+//         if (s < 0)
+//         {
+//             //region 2
+//             const scalar tmp0 = b + d;
+//             const scalar tmp1 = c + e;
+//             if (tmp1 > tmp0)
+//             {
+//                 //min on edge s+t=1
+//                 const scalar numer = tmp1 - tmp0;
+//                 const scalar denom = a-2*b+c;
+//                 s = (numer >= denom ? 1 : numer/denom);
+//                 t = 1 - s;
+//             }
+//             else
+//             {
+//                 //min on edge s=0
+//                 s = 0;
+//                 t = (tmp1 <= 0 ? 1 : (e >= 0 ? 0 : - e/c));
+//             }
+//         }
+//         else if (t < 0)
+//         {
+//             //region 6
+//             const scalar tmp0 = b + d;
+//             const scalar tmp1 = c + e;
+//             if (tmp1 > tmp0)
+//             {
+//                 //min on edge s+t=1
+//                 const scalar numer = tmp1 - tmp0;
+//                 const scalar denom = a-2*b+c;
+//                 s = (numer >= denom ? 1 : numer/denom);
+//                 t = 1 - s;
+//             }
+//             else
+//             {
+//                 //min on edge t=0
+//                 t = 0;
+//                 s = (tmp1 <= 0 ? 1 : (d >= 0 ? 0 : - d/a));
+//             }
+//         }
+//         else
+//         {
+//             //region 1
+//             const scalar numer = c+e-(b+d);
+//             if (numer <= 0)
+//             {
+//                 s = 0;
+//             }
+//             else
+//             {
+//                 const scalar denom = a-2*b+c;
+//                 s = (numer >= denom ? 1 : numer/denom);
+//             }
+//         }
+//         t = 1 - s;
+//     }
+
+
+//     // Calculate distance.
+//     // Note: abs should not be needed but truncation error causes problems
+//     // with points very close to one of the triangle vertices.
+//     // (seen up to -9e-15). Alternatively add some small value.
+
+//     const scalar f = D & D;
+//     return Foam::mag(a*s*s + 2*b*s*t + c*t*t + 2*d*s + 2*e*t + f);
+// }
 
 
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
@@ -234,9 +234,7 @@ Foam::label Foam::treeDataTriSurface::getVolumeType
     (
         surface_,
         sample,
-        pHit.index(),
-        pHit.hitPoint(),
-        indexedOctree<treeDataTriSurface>::perturbTol()
+        pHit.index()
     );
 
     if (t == triSurfaceTools::UNKNOWN)
@@ -353,39 +351,43 @@ void Foam::treeDataTriSurface::findNearest
         //    )
         //)
         {
-            // Get spanning vectors of triangle
-            vector base(p1);
-            vector E0(p0 - p1);
-            vector E1(p2 - p1);
-
-            scalar a(E0& E0);
-            scalar b(E0& E1);
-            scalar c(E1& E1);
-
-            // Get nearest point in s,t coordinates (s is along E0, t is along
-            // E1)
-            scalar s;
-            scalar t;
-
-            scalar distSqr = nearestCoords
-            (
-                base,
-                E0,
-                E1,
-                a,
-                b,
-                c,
-                sample,
-
-                s,
-                t
-            );
+            // // Get spanning vectors of triangle
+            // vector base(p1);
+            // vector E0(p0 - p1);
+            // vector E1(p2 - p1);
+
+            // scalar a(E0& E0);
+            // scalar b(E0& E1);
+            // scalar c(E1& E1);
+
+            // // Get nearest point in s,t coordinates (s is along E0, t
+            // // is along E1)
+            // scalar s;
+            // scalar t;
+
+            // scalar distSqr = nearestCoords
+            // (
+            //     base,
+            //     E0,
+            //     E1,
+            //     a,
+            //     b,
+            //     c,
+            //     sample,
+
+            //     s,
+            //     t
+            // );
+
+            pointHit pHit = triPointRef(p0, p1, p2).nearestPoint(sample);
+
+            scalar distSqr = sqr(pHit.distance());
 
             if (distSqr < nearestDistSqr)
             {
                 nearestDistSqr = distSqr;
                 minIndex = index;
-                nearestPoint = base + s*E0 + t*E1;
+                nearestPoint = pHit.rawPoint();
             }
         }
     }
diff --git a/src/meshTools/indexedOctree/treeDataTriSurface.H b/src/meshTools/indexedOctree/treeDataTriSurface.H
index f602783afefe17913cd2484dd631f587245fd80a..dc959f78ff69ec71bb0f201d5fe9366f9afcc5a1 100644
--- a/src/meshTools/indexedOctree/treeDataTriSurface.H
+++ b/src/meshTools/indexedOctree/treeDataTriSurface.H
@@ -60,20 +60,20 @@ class treeDataTriSurface
 
     // Private Member Functions
 
-        //- fast triangle nearest point calculation. Returns point in E0, E1
-        //  coordinate system:  base + s*E0 + t*E1
-        static scalar nearestCoords
-        (
-            const point& base,
-            const point& E0,
-            const point& E1,
-            const scalar a,
-            const scalar b,
-            const scalar c,
-            const point& P,
-            scalar& s,
-            scalar& t
-        );
+        // //- fast triangle nearest point calculation. Returns point in E0, E1
+        // //  coordinate system:  base + s*E0 + t*E1
+        // static scalar nearestCoords
+        // (
+        //     const point& base,
+        //     const point& E0,
+        //     const point& E1,
+        //     const scalar a,
+        //     const scalar b,
+        //     const scalar c,
+        //     const point& P,
+        //     scalar& s,
+        //     scalar& t
+        // );
 
 public:
 
diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C
index 110f9dcd66161da1e9a66a3be1c711f718106bdb..c8955f747091e3b79bd7bbb8d0a30d8be4753b6f 100644
--- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C
+++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/edgeIntersections.C
@@ -430,10 +430,7 @@ bool Foam::edgeIntersections::offsetPerturb
 
         point ctr = tri.centre();
 
-        // Get measure for tolerance.
-        scalar tolDim = 0.001*mag(tri.a() - ctr);
-
-        tri.classify(pHit.hitPoint(), tolDim, nearType, nearLabel);
+        tri.classify(pHit.hitPoint(), nearType, nearLabel);
 
         if (nearType == triPointRef::POINT || nearType == triPointRef::EDGE)
         {
diff --git a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C
index 6602fbcf430385f0018ae9368381c946571cdd1f..58c206aa75069667f64c5f55a738f452599084b8 100644
--- a/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C
+++ b/src/meshTools/triSurface/booleanOps/surfaceIntersection/surfaceIntersection.C
@@ -315,7 +315,7 @@ void Foam::surfaceIntersection::classifyHit
         surf2Pts[f2[0]],
         surf2Pts[f2[1]],
         surf2Pts[f2[2]]
-    ).classify(pHit.hitPoint(), tolDim, nearType, nearLabel);
+    ).classify(pHit.hitPoint(), nearType, nearLabel);
 
     // Classify points on edge of surface1
     label edgeEnd =
diff --git a/src/meshTools/triSurface/octreeData/octreeDataTriSurface.C b/src/meshTools/triSurface/octreeData/octreeDataTriSurface.C
index c80991819ea2244fc4c1a1159f5a2e1836db30a8..55e60a3111cd5bd5c698a592edd70b5753ae603e 100644
--- a/src/meshTools/triSurface/octreeData/octreeDataTriSurface.C
+++ b/src/meshTools/triSurface/octreeData/octreeDataTriSurface.C
@@ -43,7 +43,7 @@ Foam::scalar Foam::octreeDataTriSurface::tol(1E-6);
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
 // Fast distance to triangle calculation. From
-// "Distance Between Point and Trangle in 3D"
+// "Distance Between Point and Triangle in 3D"
 // David Eberly, Magic Software Inc. Aug. 2003.
 // Works on function Q giving distance to point and tries to minimize this.
 void Foam::octreeDataTriSurface::nearestCoords
diff --git a/src/meshTools/triSurface/orientedSurface/orientedSurface.C b/src/meshTools/triSurface/orientedSurface/orientedSurface.C
index 6462df4cb31ec2e08f197c5ddf1de6b6284597c3..38a7afd4b8ed5ad7524dcdc223a303695d672c2f 100644
--- a/src/meshTools/triSurface/orientedSurface/orientedSurface.C
+++ b/src/meshTools/triSurface/orientedSurface/orientedSurface.C
@@ -234,9 +234,7 @@ void Foam::orientedSurface::propagateOrientation
     (
         s,
         samplePoint,
-        nearestFaceI,
-        nearestPt,
-        10*SMALL
+        nearestFaceI
     );
 
     if (side == triSurfaceTools::UNKNOWN)
diff --git a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C
index 5a0cc0362340e7a36b5149a3ec721d09882653e2..af30b3bcc8954ad5e86916ff97d9d62e04c113cf 100644
--- a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C
+++ b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.C
@@ -2121,12 +2121,13 @@ Foam::vector Foam::triSurfaceTools::surfaceNormal
 
     label nearType;
     label nearLabel;
+
     triPointRef
     (
         points[f[0]],
         points[f[1]],
         points[f[2]]
-    ).classify(nearestPt, 1E-6, nearType, nearLabel);
+    ).classify(nearestPt, nearType, nearLabel);
 
     if (nearType == triPointRef::NONE)
     {
@@ -2199,28 +2200,61 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
 (
     const triSurface& surf,
     const point& sample,
-    const label nearestFaceI,   // nearest face
-    const point& nearestPoint,  // nearest point on nearest face
-    const scalar tol
+    const label nearestFaceI
 )
 {
     const labelledTri& f = surf[nearestFaceI];
     const pointField& points = surf.points();
 
-    // Find where point is on triangle. Note tolerance needed. Is relative
-    // one (used in comparing normalized [0..1] triangle coordinates).
+    // Find where point is on triangle.
     label nearType, nearLabel;
-    triPointRef
+
+    pointHit pHit = triPointRef
     (
         points[f[0]],
         points[f[1]],
         points[f[2]]
-    ).classify(nearestPoint, tol, nearType, nearLabel);
+    ).nearestPointClassify(sample, nearType, nearLabel);
+
+    const point& nearestPoint(pHit.rawPoint());
 
     if (nearType == triPointRef::NONE)
     {
+        vector sampleNearestVec = (sample - nearestPoint);
+
         // Nearest to face interior. Use faceNormal to determine side
-        scalar c = (sample - nearestPoint) & surf.faceNormals()[nearestFaceI];
+        scalar c = sampleNearestVec & surf.faceNormals()[nearestFaceI];
+
+        // // If the sample is essentially on the face, do not check for
+        // // it being perpendicular.
+
+        // scalar magSampleNearestVec = mag(sampleNearestVec);
+
+        // if (magSampleNearestVec > SMALL)
+        // {
+        //     c /= magSampleNearestVec*mag(surf.faceNormals()[nearestFaceI]);
+
+        //     if (mag(c) < 0.99)
+        //     {
+        //         FatalErrorIn("triSurfaceTools::surfaceSide")
+        //             << "nearestPoint identified as being on triangle face "
+        //             << "but vector from nearestPoint to sample is not "
+        //             << "perpendicular to the normal." << nl
+        //             << "sample: " << sample << nl
+        //             << "nearestPoint: " << nearestPoint << nl
+        //             << "sample - nearestPoint: "
+        //             << sample - nearestPoint << nl
+        //             << "normal: " << surf.faceNormals()[nearestFaceI] << nl
+        //             << "mag(sample - nearestPoint): "
+        //             << mag(sample - nearestPoint) << nl
+        //             << "normalised dot product: " << c << nl
+        //             << "triangle vertices: " << nl
+        //             << "    " << points[f[0]] << nl
+        //             << "    " << points[f[1]] << nl
+        //             << "    " << points[f[2]] << nl
+        //             << abort(FatalError);
+        //     }
+        // }
 
         if (c > 0)
         {
@@ -2239,13 +2273,13 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
         // Get the edge. Assume order of faceEdges same as face vertices.
         label edgeI = surf.faceEdges()[nearestFaceI][nearLabel];
 
-        //if (debug)
-        //{
+        // if (debug)
+        // {
         //    // Check order of faceEdges same as face vertices.
         //    const edge& e = surf.edges()[edgeI];
         //    const labelList& meshPoints = surf.meshPoints();
         //    const edge meshEdge(meshPoints[e[0]], meshPoints[e[1]]);
-        //
+
         //    if
         //    (
         //        meshEdge
@@ -2259,7 +2293,7 @@ Foam::triSurfaceTools::sideType Foam::triSurfaceTools::surfaceSide
         //            << " in face " << f
         //            << abort(FatalError);
         //    }
-        //}
+        // }
 
         return edgeSide(surf, sample, nearestPoint, edgeI);
     }
@@ -2717,7 +2751,14 @@ void Foam::triSurfaceTools::calcInterpolationWeights
 
             triPointRef tri(f.tri(points));
 
-            pointHit nearest = tri.nearestPoint(samplePt);
+            label nearType, nearLabel;
+
+            pointHit nearest = tri.nearestPointClassify
+            (
+                samplePt,
+                nearType,
+                nearLabel
+            );
 
             if (nearest.hit())
             {
@@ -2741,14 +2782,6 @@ void Foam::triSurfaceTools::calcInterpolationWeights
                 minDistance = nearest.distance();
 
                 // Outside triangle. Store nearest.
-                label nearType, nearLabel;
-                tri.classify
-                (
-                    nearest.rawPoint(),
-                    1E-6,               // relative tolerance
-                    nearType,
-                    nearLabel
-                );
 
                 if (nearType == triPointRef::POINT)
                 {
@@ -2779,12 +2812,12 @@ void Foam::triSurfaceTools::calcInterpolationWeights
                         max
                         (
                             0,
-                            mag(nearest.rawPoint()-p0)/mag(p1-p0)
+                            mag(nearest.rawPoint() - p0)/mag(p1 - p0)
                         )
                     );
 
                     // Interpolate
-                    weights[0] = 1-s;
+                    weights[0] = 1 - s;
                     weights[1] = s;
                     weights[2] = -GREAT;
 
@@ -2830,7 +2863,6 @@ Foam::surfaceLocation Foam::triSurfaceTools::classify
     triPointRef(s[triI].tri(s.points())).classify
     (
         trianglePoint,
-        1E-6,
         elemType,
         index
     );
diff --git a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.H b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.H
index 62d66d031f02e5eb9e8723c8ef0f42b7d7bd0b87..744a12217d372adab1f4a6915d7c8fb3e7bfed29 100644
--- a/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.H
+++ b/src/meshTools/triSurface/triSurfaceTools/triSurfaceTools.H
@@ -458,9 +458,7 @@ public:
         (
             const triSurface& surf,
             const point& sample,
-            const label nearestFaceI,   // nearest face
-            const point& nearestPt,     // nearest point on nearest face
-            const scalar tol            // tolerance for nearness test.
+            const label nearestFaceI
         );
 
     // Triangulation of faces
diff --git a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C
index ce90b7a55d86eab9c606ed8710a27ae9ee6a704b..56b05c88caf9b1f39c3ebf21f79258629363ce7f 100644
--- a/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C
+++ b/src/postProcessing/functionObjects/field/streamLine/streamLineParticle.C
@@ -168,7 +168,6 @@ bool Foam::streamLineParticle::move(streamLineParticle::trackData& td)
         td.keepParticle
     && !td.switchProcessor
     && lifeTime_ > 0
-    && tEnd > ROOTVSMALL
     )
     {
         // TBD: implement subcycling so step through cells in more than
@@ -191,6 +190,12 @@ bool Foam::streamLineParticle::move(streamLineParticle::trackData& td)
 
         tEnd -= dt;
         stepFraction() = 1.0 - tEnd/deltaT;
+
+        if (tEnd <= ROOTVSMALL)
+        {
+            // Force removal
+            lifeTime_ = 0;
+        }
     }
 
     if (!td.keepParticle || lifeTime_ == 0)
diff --git a/src/sampling/sampledSurface/distanceSurface/distanceSurface.C b/src/sampling/sampledSurface/distanceSurface/distanceSurface.C
index b777edbdb3c1a0d99713ed601ba0f664e9e313d3..4a4c9219d690dcb106b3b409f6994f535d5d65f1 100644
--- a/src/sampling/sampledSurface/distanceSurface/distanceSurface.C
+++ b/src/sampling/sampledSurface/distanceSurface/distanceSurface.C
@@ -89,20 +89,29 @@ void Foam::distanceSurface::createGeometry()
 
         if (signed_)
         {
-            vectorField normal;
-            surfPtr_().getNormal(nearest, normal);
+            List<searchableSurface::volumeType> volType;
 
-            forAll(nearest, i)
+            surfPtr_().getVolumeType(cc, volType);
+
+            forAll(volType, i)
             {
-                vector d(cc[i]-nearest[i].hitPoint());
+                searchableSurface::volumeType vT = volType[i];
 
-                if ((d&normal[i]) > 0)
+                if (vT == searchableSurface::OUTSIDE)
                 {
-                    fld[i] = Foam::mag(d);
+                    fld[i] = Foam::mag(cc[i] - nearest[i].hitPoint());
+                }
+                else if (vT == searchableSurface::INSIDE)
+                {
+                    fld[i] = -Foam::mag(cc[i] - nearest[i].hitPoint());
                 }
                 else
                 {
-                    fld[i] = -Foam::mag(d);
+                    FatalErrorIn
+                    (
+                        "void Foam::distanceSurface::createGeometry()"
+                    )   << "getVolumeType failure, neither INSIDE or OUTSIDE"
+                        << exit(FatalError);
                 }
             }
         }
@@ -132,20 +141,30 @@ void Foam::distanceSurface::createGeometry()
 
             if (signed_)
             {
-                vectorField normal;
-                surfPtr_().getNormal(nearest, normal);
+                List<searchableSurface::volumeType> volType;
 
-                forAll(nearest, i)
+                surfPtr_().getVolumeType(cc, volType);
+
+                forAll(volType, i)
                 {
-                    vector d(cc[i]-nearest[i].hitPoint());
+                    searchableSurface::volumeType vT = volType[i];
 
-                    if ((d&normal[i]) > 0)
+                    if (vT == searchableSurface::OUTSIDE)
                     {
-                        fld[i] = Foam::mag(d);
+                        fld[i] = Foam::mag(cc[i] - nearest[i].hitPoint());
+                    }
+                    else if (vT == searchableSurface::INSIDE)
+                    {
+                        fld[i] = -Foam::mag(cc[i] - nearest[i].hitPoint());
                     }
                     else
                     {
-                        fld[i] = -Foam::mag(d);
+                        FatalErrorIn
+                        (
+                            "void Foam::distanceSurface::createGeometry()"
+                        )   << "getVolumeType failure, "
+                            << "neither INSIDE or OUTSIDE"
+                            << exit(FatalError);
                     }
                 }
             }
@@ -179,20 +198,31 @@ void Foam::distanceSurface::createGeometry()
 
         if (signed_)
         {
-            vectorField normal;
-            surfPtr_().getNormal(nearest, normal);
+            List<searchableSurface::volumeType> volType;
 
-            forAll(nearest, i)
+            surfPtr_().getVolumeType(pts, volType);
+
+            forAll(volType, i)
             {
-                vector d(pts[i]-nearest[i].hitPoint());
+                searchableSurface::volumeType vT = volType[i];
 
-                if ((d&normal[i]) > 0)
+                if (vT == searchableSurface::OUTSIDE)
+                {
+                    pointDistance_[i] =
+                        Foam::mag(pts[i] - nearest[i].hitPoint());
+                }
+                else if (vT == searchableSurface::INSIDE)
                 {
-                    pointDistance_[i] = Foam::mag(d);
+                    pointDistance_[i] =
+                        -Foam::mag(pts[i] - nearest[i].hitPoint());
                 }
                 else
                 {
-                    pointDistance_[i] = -Foam::mag(d);
+                    FatalErrorIn
+                    (
+                        "void Foam::distanceSurface::createGeometry()"
+                    )   << "getVolumeType failure, neither INSIDE or OUTSIDE"
+                        << exit(FatalError);
                 }
             }
         }
diff --git a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/blockMeshDict b/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/blockMeshDict
deleted file mode 100644
index 0922303da33f01fd52960b00160c0dc787f5d9d4..0000000000000000000000000000000000000000
--- a/tutorials/compressible/rhoPimpleFoam/ras/angledDuct/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,123 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// block definition for a porosity with an angled inlet/outlet
-// the porosity is not aligned with the main axes
-//
-                             
-convertToMeters 0.001;
-
-vertices
-(
-    // inlet region
-    ( -150  0  -25 )  // pt 0 (in1b) 
-    ( -150 35.35533906  -25 ) // pt 1 (in2b) 
-    ( -150  0  25 )  // pt 2 (in1f) 
-    ( -150 35.35533906  25 ) // pt 3 (in2f) 
-
-    // join inlet->outlet
-    (  0 0  -25 )    // pt 4 (join1b) 
-    ( -35.35533906   35.35533906  -25 ) // pt 5 (join2b) 
-    (  0 0  25 )    // pt 6 (join1f) 
-    ( -35.35533906   35.35533906  25 ) // pt 7 (join2f) 
-
-    // porosity ends ->outlet
-    ( 70.71067812 70.71067812  -25 )  // pt 8 (poro1b) 
-    ( 35.35533906 106.06601718  -25 )  // pt 9 (poro2b) 
-    ( 70.71067812 70.71067812  25 )  // pt 10 (poro1f) 
-    ( 35.35533906 106.06601718  25 )  // pt 11 (poro2f) 
-
-    // outlet
-    ( 141.42135624 141.42135624 -25 ) // pt 12 (out1b) 
-    ( 106.06601718 176.7766953 -25 ) // pt 13 (out2b) 
-    ( 141.42135624 141.42135624 25 ) // pt 14 (out1f) 
-    ( 106.06601718 176.7766953 25 ) // pt 15 (out2f) 
-);
-
-blocks
-(
-    // inlet block
-    hex (0 4 5 1 2 6 7 3)
-    inlet ( 15 20 20 ) simpleGrading (1 1 1)
-
-    // porosity block
-    hex (4 8 9 5 6 10 11 7)
-    porosity ( 20 20 20 ) simpleGrading (1 1 1)
-
-    // outlet block
-    hex (8 12 13 9 10 14 15 11)
-    outlet ( 20 20 20 )  simpleGrading (1 1 1)
-);
-
-edges
-(
-);
-
-patches
-(
-    // is there no way of defining all my 'defaultFaces' to be 'wall'?
-    wall front
-    (
-    // inlet block
-    (2 6 7 3)
-    // outlet block
-    (10 14 15 11)
-    )
-
-    wall back
-    (
-    // inlet block
-    (1 5 4 0)
-    // outlet block
-    (9 13 12 8)
-    )
-
-    wall wall
-    (
-    // inlet block
-    (2 0 4 6)
-    (7 5 1 3)
-    // outlet block
-    (10 8 12 14)
-    (15 13 9 11)
-    )
-
-    wall porosityWall
-    (
-    // porosity block
-    (6 10 11 7)
-    // porosity block
-    (5 9 8 4)
-    // porosity block
-    (6 4 8 10)
-    (11 9 5 7)
-    )
-
-    patch inlet
-    (
-    (3 1 0 2)
-    )
-
-    patch outlet
-    (
-    (15 13 12 14)
-    )
-);
-
-mergePatchPairs
-(
-);
-
-// ************************************************************************* //
diff --git a/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/constant/polyMesh/blockMeshDict b/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/constant/polyMesh/blockMeshDict
deleted file mode 100644
index 5a0740c3491935ebc792cf2f64ef413a56a7c89a..0000000000000000000000000000000000000000
--- a/tutorials/compressible/rhoPorousMRFPimpleFoam/mixerVessel2D/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,834 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General macros to create 2D/extruded-2D meshes
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-convertToMeters 0.1;
-
-// Hub radius
-
-
-// Impeller-tip radius
-
-
-// Baffle-tip radius
-
-
-// Tank radius
-
-
-// MRF region radius
-
-
-// Thickness of 2D slab
-
-
-// Base z
-
-
-// Top z
-
-
-// Number of cells radially between hub and impeller tip
-
-
-// Number of cells radially in each of the two regions between
-// impeller and baffle tips
-
-
-// Number of cells radially between baffle tip and tank
-
-
-// Number of cells azimuthally in each of the 8 blocks
-
-
-// Number of cells in the thickness of the slab
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-vertices
-(
-    (0.2 0 0) // Vertex r0b = 0 
-    (0.2 0 0) // Vertex r0sb = 1 
-    (0.141421356364228 -0.141421356110391 0) // Vertex r1b = 2 
-    (3.58979347393082e-10 -0.2 0) // Vertex r2b = 3 
-    (3.58979347393082e-10 -0.2 0) // Vertex r2sb = 4 
-    (-0.141421355856554 -0.141421356618065 0) // Vertex r3b = 5 
-    (-0.2 7.17958694786164e-10 0) // Vertex r4b = 6 
-    (-0.2 7.17958694786164e-10 0) // Vertex r4sb = 7 
-    (-0.141421355856554 0.141421356618065 0) // Vertex r5b = 8 
-    (3.58979347393082e-10 0.2 0) // Vertex r6b = 9 
-    (3.58979347393082e-10 0.2 0) // Vertex r6sb = 10 
-    (0.141421356364228 0.141421356110391 0) // Vertex r7b = 11 
-
-    (0.5 0 0) // Vertex rb0b = 12 
-    (0.353553390910569 -0.353553390275978 0) // Vertex rb1b = 13 
-    (8.97448368482705e-10 -0.5 0) // Vertex rb2b = 14 
-    (-0.353553389641386 -0.353553391545162 0) // Vertex rb3b = 15 
-    (-0.5 1.79489673696541e-09 0) // Vertex rb4b = 16 
-    (-0.353553389641386 0.353553391545162 0) // Vertex rb5b = 17 
-    (8.97448368482705e-10 0.5 0) // Vertex rb6b = 18 
-    (0.353553390910569 0.353553390275978 0) // Vertex rb7b = 19 
-
-    (0.6 0 0) // Vertex ri0b = 20 
-    (0.424264069092683 -0.424264068331174 0) // Vertex ri1b = 21 
-    (1.07693804217925e-09 -0.6 0) // Vertex ri2b = 22 
-    (-0.424264067569663 -0.424264069854194 0) // Vertex ri3b = 23 
-    (-0.6 2.15387608435849e-09 0) // Vertex ri4b = 24 
-    (-0.424264067569663 0.424264069854194 0) // Vertex ri5b = 25 
-    (1.07693804217925e-09 0.6 0) // Vertex ri6b = 26 
-    (0.424264069092683 0.424264068331174 0) // Vertex ri7b = 27 
-
-    (0.7 0 0) // Vertex Rb0b = 28 
-    (0.494974747274797 -0.494974746386369 0) // Vertex Rb1b = 29 
-    (1.25642771587579e-09 -0.7 0) // Vertex Rb2b = 30 
-    (-0.49497474549794 -0.494974748163226 0) // Vertex Rb3b = 31 
-    (-0.7 2.51285543175157e-09 0) // Vertex Rb4b = 32 
-    (-0.49497474549794 0.494974748163226 0) // Vertex Rb5b = 33 
-    (1.25642771587579e-09 0.7 0) // Vertex Rb6b = 34 
-    (0.494974747274797 0.494974746386369 0) // Vertex Rb7b = 35 
-
-    (1 0 0) // Vertex R0b = 36 
-    (0.707106781821139 -0.707106780551956 0) // Vertex R1b = 37 
-    (0.707106781821139 -0.707106780551956 0) // Vertex R1sb = 38 
-    (1.79489673696541e-09 -1 0) // Vertex R2b = 39 
-    (-0.707106779282772 -0.707106783090323 0) // Vertex R3b = 40 
-    (-0.707106779282772 -0.707106783090323 0) // Vertex R3sb = 41 
-    (-1 3.58979347393082e-09 0) // Vertex R4b = 42 
-    (-0.707106779282772 0.707106783090323 0) // Vertex R5b = 43 
-    (-0.707106779282772 0.707106783090323 0) // Vertex R5sb = 44 
-    (1.79489673696541e-09 1 0) // Vertex R6b = 45 
-    (0.707106781821139 0.707106780551956 0) // Vertex R7b = 46 
-    (0.707106781821139 0.707106780551956 0) // Vertex R7sb = 47 
-
-    (0.2 0 0.1) // Vertex r0t = 48 
-    (0.2 0 0.1) // Vertex r0st = 49 
-    (0.141421356364228 -0.141421356110391 0.1) // Vertex r1t = 50 
-    (3.58979347393082e-10 -0.2 0.1) // Vertex r2t = 51 
-    (3.58979347393082e-10 -0.2 0.1) // Vertex r2st = 52 
-    (-0.141421355856554 -0.141421356618065 0.1) // Vertex r3t = 53 
-    (-0.2 7.17958694786164e-10 0.1) // Vertex r4t = 54 
-    (-0.2 7.17958694786164e-10 0.1) // Vertex r4st = 55 
-    (-0.141421355856554 0.141421356618065 0.1) // Vertex r5t = 56 
-    (3.58979347393082e-10 0.2 0.1) // Vertex r6t = 57 
-    (3.58979347393082e-10 0.2 0.1) // Vertex r6st = 58 
-    (0.141421356364228 0.141421356110391 0.1) // Vertex r7t = 59 
-
-    (0.5 0 0.1) // Vertex rb0t = 60 
-    (0.353553390910569 -0.353553390275978 0.1) // Vertex rb1t = 61 
-    (8.97448368482705e-10 -0.5 0.1) // Vertex rb2t = 62 
-    (-0.353553389641386 -0.353553391545162 0.1) // Vertex rb3t = 63 
-    (-0.5 1.79489673696541e-09 0.1) // Vertex rb4t = 64 
-    (-0.353553389641386 0.353553391545162 0.1) // Vertex rb5t = 65 
-    (8.97448368482705e-10 0.5 0.1) // Vertex rb6t = 66 
-    (0.353553390910569 0.353553390275978 0.1) // Vertex rb7t = 67 
-
-    (0.6 0 0.1) // Vertex ri0t = 68 
-    (0.424264069092683 -0.424264068331174 0.1) // Vertex ri1t = 69 
-    (1.07693804217925e-09 -0.6 0.1) // Vertex ri2t = 70 
-    (-0.424264067569663 -0.424264069854194 0.1) // Vertex ri3t = 71 
-    (-0.6 2.15387608435849e-09 0.1) // Vertex ri4t = 72 
-    (-0.424264067569663 0.424264069854194 0.1) // Vertex ri5t = 73 
-    (1.07693804217925e-09 0.6 0.1) // Vertex ri6t = 74 
-    (0.424264069092683 0.424264068331174 0.1) // Vertex ri7t = 75 
-
-    (0.7 0 0.1) // Vertex Rb0t = 76 
-    (0.494974747274797 -0.494974746386369 0.1) // Vertex Rb1t = 77 
-    (1.25642771587579e-09 -0.7 0.1) // Vertex Rb2t = 78 
-    (-0.49497474549794 -0.494974748163226 0.1) // Vertex Rb3t = 79 
-    (-0.7 2.51285543175157e-09 0.1) // Vertex Rb4t = 80 
-    (-0.49497474549794 0.494974748163226 0.1) // Vertex Rb5t = 81 
-    (1.25642771587579e-09 0.7 0.1) // Vertex Rb6t = 82 
-    (0.494974747274797 0.494974746386369 0.1) // Vertex Rb7t = 83 
-
-    (1 0 0.1) // Vertex R0t = 84 
-    (0.707106781821139 -0.707106780551956 0.1) // Vertex R1t = 85 
-    (0.707106781821139 -0.707106780551956 0.1) // Vertex R1st = 86 
-    (1.79489673696541e-09 -1 0.1) // Vertex R2t = 87 
-    (-0.707106779282772 -0.707106783090323 0.1) // Vertex R3t = 88 
-    (-0.707106779282772 -0.707106783090323 0.1) // Vertex R3st = 89 
-    (-1 3.58979347393082e-09 0.1) // Vertex R4t = 90 
-    (-0.707106779282772 0.707106783090323 0.1) // Vertex R5t = 91 
-    (-0.707106779282772 0.707106783090323 0.1) // Vertex R5st = 92 
-    (1.79489673696541e-09 1 0.1) // Vertex R6t = 93 
-    (0.707106781821139 0.707106780551956 0.1) // Vertex R7t = 94 
-    (0.707106781821139 0.707106780551956 0.1) // Vertex R7st = 95 
-);
-
-blocks
-(
-    // block0
-    hex (0 2 13 12 48 50 61 60)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (2 4 14 13 50 52 62 61)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (3 5 15 14 51 53 63 62)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (5 7 16 15 53 55 64 63)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (6 8 17 16 54 56 65 64)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (8 10 18 17 56 58 66 65)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (9 11 19 18 57 59 67 66)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (11 1 12 19 59 49 60 67)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (12 13 21 20 60 61 69 68)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (13 14 22 21 61 62 70 69)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (14 15 23 22 62 63 71 70)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (15 16 24 23 63 64 72 71)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (16 17 25 24 64 65 73 72)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (17 18 26 25 65 66 74 73)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (18 19 27 26 66 67 75 74)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (19 12 20 27 67 60 68 75)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (20 21 29 28 68 69 77 76)
-    stator
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (21 22 30 29 69 70 78 77)
-    stator
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (22 23 31 30 70 71 79 78)
-    stator
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (23 24 32 31 71 72 80 79)
-    stator
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (24 25 33 32 72 73 81 80)
-    stator
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (25 26 34 33 73 74 82 81)
-    stator
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (26 27 35 34 74 75 83 82)
-    stator
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (27 20 28 35 75 68 76 83)
-    stator
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (28 29 38 36 76 77 86 84)
-    stator
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (29 30 39 37 77 78 87 85)
-    stator
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (30 31 41 39 78 79 89 87)
-    stator
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (31 32 42 40 79 80 90 88)
-    stator
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (32 33 44 42 80 81 92 90)
-    stator
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (33 34 45 43 81 82 93 91)
-    stator
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (34 35 47 45 82 83 95 93)
-    stator
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (35 28 36 46 83 76 84 94)
-    stator
-    (12 12 1)
-    simpleGrading (1 1 1)
-);
-
-edges
-(
-    arc 0 2 (0.184775906536601 -0.0765366863901046 0)
-    arc 2 4 (0.0765366867217582 -0.184775906399226 0)
-    arc 3 5 (-0.0765366860584508 -0.184775906673977 0)
-    arc 5 7 (-0.18477590626185 -0.0765366870534118 0)
-    arc 6 8 (-0.18477590626185 0.0765366870534118 0)
-    arc 8 10 (-0.0765366860584508 0.184775906673977 0)
-    arc 9 11 (0.0765366867217582 0.184775906399226 0)
-    arc 11 1 (0.184775906536601 0.0765366863901046 0)
-
-    arc 12 13 (0.461939766341503 -0.191341715975262 0)
-    arc 13 14 (0.191341716804395 -0.461939765998065 0)
-    arc 14 15 (-0.191341715146127 -0.461939766684942 0)
-    arc 15 16 (-0.461939765654626 -0.19134171763353 0)
-    arc 16 17 (-0.461939765654626 0.19134171763353 0)
-    arc 17 18 (-0.191341715146127 0.461939766684942 0)
-    arc 18 19 (0.191341716804395 0.461939765998065 0)
-    arc 19 12 (0.461939766341503 0.191341715975262 0)
-
-    arc 20 21 (0.554327719609804 -0.229610059170314 0)
-    arc 21 22 (0.229610060165275 -0.554327719197677 0)
-    arc 22 23 (-0.229610058175352 -0.55432772002193 0)
-    arc 23 24 (-0.554327718785551 -0.229610061160235 0)
-    arc 24 25 (-0.554327718785551 0.229610061160235 0)
-    arc 25 26 (-0.229610058175352 0.55432772002193 0)
-    arc 26 27 (0.229610060165275 0.554327719197677 0)
-    arc 27 20 (0.554327719609804 0.229610059170314 0)
-
-    arc 28 29 (0.646715672878104 -0.267878402365366 0)
-    arc 29 30 (0.267878403526154 -0.64671567239729 0)
-    arc 30 31 (-0.267878401204578 -0.646715673358918 0)
-    arc 31 32 (-0.646715671916476 -0.267878404686941 0)
-    arc 32 33 (-0.646715671916476 0.267878404686941 0)
-    arc 33 34 (-0.267878401204578 0.646715673358918 0)
-    arc 34 35 (0.267878403526154 0.64671567239729 0)
-    arc 35 28 (0.646715672878104 0.267878402365366 0)
-
-    arc 36 38 (0.923879532683006 -0.382683431950523 0)
-    arc 37 39 (0.382683433608791 -0.923879531996129 0)
-    arc 39 41 (-0.382683430292254 -0.923879533369883 0)
-    arc 40 42 (-0.923879531309252 -0.382683435267059 0)
-    arc 42 44 (-0.923879531309252 0.382683435267059 0)
-    arc 43 45 (-0.382683430292254 0.923879533369883 0)
-    arc 45 47 (0.382683433608791 0.923879531996129 0)
-    arc 46 36 (0.923879532683006 0.382683431950523 0)
-
-    arc 48 50 (0.184775906536601 -0.0765366863901046 0.1)
-    arc 50 52 (0.0765366867217582 -0.184775906399226 0.1)
-    arc 51 53 (-0.0765366860584508 -0.184775906673977 0.1)
-    arc 53 55 (-0.18477590626185 -0.0765366870534118 0.1)
-    arc 54 56 (-0.18477590626185 0.0765366870534118 0.1)
-    arc 56 58 (-0.0765366860584508 0.184775906673977 0.1)
-    arc 57 59 (0.0765366867217582 0.184775906399226 0.1)
-    arc 59 49 (0.184775906536601 0.0765366863901046 0.1)
-
-    arc 60 61 (0.461939766341503 -0.191341715975262 0.1)
-    arc 61 62 (0.191341716804395 -0.461939765998065 0.1)
-    arc 62 63 (-0.191341715146127 -0.461939766684942 0.1)
-    arc 63 64 (-0.461939765654626 -0.19134171763353 0.1)
-    arc 64 65 (-0.461939765654626 0.19134171763353 0.1)
-    arc 65 66 (-0.191341715146127 0.461939766684942 0.1)
-    arc 66 67 (0.191341716804395 0.461939765998065 0.1)
-    arc 67 60 (0.461939766341503 0.191341715975262 0.1)
-
-    arc 68 69 (0.554327719609804 -0.229610059170314 0.1)
-    arc 69 70 (0.229610060165275 -0.554327719197677 0.1)
-    arc 70 71 (-0.229610058175352 -0.55432772002193 0.1)
-    arc 71 72 (-0.554327718785551 -0.229610061160235 0.1)
-    arc 72 73 (-0.554327718785551 0.229610061160235 0.1)
-    arc 73 74 (-0.229610058175352 0.55432772002193 0.1)
-    arc 74 75 (0.229610060165275 0.554327719197677 0.1)
-    arc 75 68 (0.554327719609804 0.229610059170314 0.1)
-
-    arc 76 77 (0.646715672878104 -0.267878402365366 0.1)
-    arc 77 78 (0.267878403526154 -0.64671567239729 0.1)
-    arc 78 79 (-0.267878401204578 -0.646715673358918 0.1)
-    arc 79 80 (-0.646715671916476 -0.267878404686941 0.1)
-    arc 80 81 (-0.646715671916476 0.267878404686941 0.1)
-    arc 81 82 (-0.267878401204578 0.646715673358918 0.1)
-    arc 82 83 (0.267878403526154 0.64671567239729 0.1)
-    arc 83 76 (0.646715672878104 0.267878402365366 0.1)
-
-    arc 84 86 (0.923879532683006 -0.382683431950523 0.1)
-    arc 85 87 (0.382683433608791 -0.923879531996129 0.1)
-    arc 87 89 (-0.382683430292254 -0.923879533369883 0.1)
-    arc 88 90 (-0.923879531309252 -0.382683435267059 0.1)
-    arc 90 92 (-0.923879531309252 0.382683435267059 0.1)
-    arc 91 93 (-0.382683430292254 0.923879533369883 0.1)
-    arc 93 95 (0.382683433608791 0.923879531996129 0.1)
-    arc 94 84 (0.923879532683006 0.382683431950523 0.1)
-);
-
-patches
-(
-    wall rotor
-    (
-        (0 2 50 48)
-        (2 4 52 50)
-        (3 5 53 51)
-        (5 7 55 53)
-        (6 8 56 54)
-        (8 10 58 56)
-        (9 11 59 57)
-        (11 1 49 59)
-
-        (0 12 60 48)
-        (1 12 60 49)
-
-        (3 14 62 51)
-        (4 14 62 52)
-
-        (6 16 64 54)
-        (7 16 64 55)
-
-        (9 18 66 57)
-        (10 18 66 58)
-    )
-
-    wall stator
-    (
-        (36 38 86 84)
-        (37 39 87 85)
-        (39 41 89 87)
-        (40 42 90 88)
-        (42 44 92 90)
-        (43 45 93 91)
-        (45 47 95 93)
-        (46 36 84 94)
-
-        (37 29 77 85)
-        (38 29 77 86)
-
-        (40 31 79 88)
-        (41 31 79 89)
-
-        (43 33 81 91)
-        (44 33 81 92)
-
-        (46 35 83 94)
-        (47 35 83 95)
-    )
-
-    empty front
-    (
-        (48 50 61 60)
-        (50 52 62 61)
-        (51 53 63 62)
-        (53 55 64 63)
-        (54 56 65 64)
-        (56 58 66 65)
-        (57 59 67 66)
-        (59 49 60 67)
-        (60 61 69 68)
-        (61 62 70 69)
-        (62 63 71 70)
-        (63 64 72 71)
-        (64 65 73 72)
-        (65 66 74 73)
-        (66 67 75 74)
-        (67 60 68 75)
-        (68 69 77 76)
-        (69 70 78 77)
-        (70 71 79 78)
-        (71 72 80 79)
-        (72 73 81 80)
-        (73 74 82 81)
-        (74 75 83 82)
-        (75 68 76 83)
-        (76 77 86 84)
-        (77 78 87 85)
-        (78 79 89 87)
-        (79 80 90 88)
-        (80 81 92 90)
-        (81 82 93 91)
-        (82 83 95 93)
-        (83 76 84 94)
-    )
-
-    empty back
-    (
-        (0 12 13 2)
-        (2 13 14 4)
-        (3 14 15 5)
-        (5 15 16 7)
-        (6 16 17 8)
-        (8 17 18 10)
-        (9 18 19 11)
-        (11 19 12 1)
-        (12 20 21 13)
-        (13 21 22 14)
-        (14 22 23 15)
-        (15 23 24 16)
-        (16 24 25 17)
-        (17 25 26 18)
-        (18 26 27 19)
-        (19 27 20 12)
-        (20 28 29 21)
-        (21 29 30 22)
-        (22 30 31 23)
-        (23 31 32 24)
-        (24 32 33 25)
-        (25 33 34 26)
-        (26 34 35 27)
-        (27 35 28 20)
-        (28 36 38 29)
-        (29 37 39 30)
-        (30 39 41 31)
-        (31 40 42 32)
-        (32 42 44 33)
-        (33 43 45 34)
-        (34 45 47 35)
-        (35 46 36 28)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict b/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict
deleted file mode 100644
index 0922303da33f01fd52960b00160c0dc787f5d9d4..0000000000000000000000000000000000000000
--- a/tutorials/compressible/rhoPorousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,123 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// block definition for a porosity with an angled inlet/outlet
-// the porosity is not aligned with the main axes
-//
-                             
-convertToMeters 0.001;
-
-vertices
-(
-    // inlet region
-    ( -150  0  -25 )  // pt 0 (in1b) 
-    ( -150 35.35533906  -25 ) // pt 1 (in2b) 
-    ( -150  0  25 )  // pt 2 (in1f) 
-    ( -150 35.35533906  25 ) // pt 3 (in2f) 
-
-    // join inlet->outlet
-    (  0 0  -25 )    // pt 4 (join1b) 
-    ( -35.35533906   35.35533906  -25 ) // pt 5 (join2b) 
-    (  0 0  25 )    // pt 6 (join1f) 
-    ( -35.35533906   35.35533906  25 ) // pt 7 (join2f) 
-
-    // porosity ends ->outlet
-    ( 70.71067812 70.71067812  -25 )  // pt 8 (poro1b) 
-    ( 35.35533906 106.06601718  -25 )  // pt 9 (poro2b) 
-    ( 70.71067812 70.71067812  25 )  // pt 10 (poro1f) 
-    ( 35.35533906 106.06601718  25 )  // pt 11 (poro2f) 
-
-    // outlet
-    ( 141.42135624 141.42135624 -25 ) // pt 12 (out1b) 
-    ( 106.06601718 176.7766953 -25 ) // pt 13 (out2b) 
-    ( 141.42135624 141.42135624 25 ) // pt 14 (out1f) 
-    ( 106.06601718 176.7766953 25 ) // pt 15 (out2f) 
-);
-
-blocks
-(
-    // inlet block
-    hex (0 4 5 1 2 6 7 3)
-    inlet ( 15 20 20 ) simpleGrading (1 1 1)
-
-    // porosity block
-    hex (4 8 9 5 6 10 11 7)
-    porosity ( 20 20 20 ) simpleGrading (1 1 1)
-
-    // outlet block
-    hex (8 12 13 9 10 14 15 11)
-    outlet ( 20 20 20 )  simpleGrading (1 1 1)
-);
-
-edges
-(
-);
-
-patches
-(
-    // is there no way of defining all my 'defaultFaces' to be 'wall'?
-    wall front
-    (
-    // inlet block
-    (2 6 7 3)
-    // outlet block
-    (10 14 15 11)
-    )
-
-    wall back
-    (
-    // inlet block
-    (1 5 4 0)
-    // outlet block
-    (9 13 12 8)
-    )
-
-    wall wall
-    (
-    // inlet block
-    (2 0 4 6)
-    (7 5 1 3)
-    // outlet block
-    (10 8 12 14)
-    (15 13 9 11)
-    )
-
-    wall porosityWall
-    (
-    // porosity block
-    (6 10 11 7)
-    // porosity block
-    (5 9 8 4)
-    // porosity block
-    (6 4 8 10)
-    (11 9 5 7)
-    )
-
-    patch inlet
-    (
-    (3 1 0 2)
-    )
-
-    patch outlet
-    (
-    (15 13 12 14)
-    )
-);
-
-mergePatchPairs
-(
-);
-
-// ************************************************************************* //
diff --git a/tutorials/incompressible/MRFSimpleFoam/mixerVessel2D/constant/polyMesh/blockMeshDict b/tutorials/incompressible/MRFSimpleFoam/mixerVessel2D/constant/polyMesh/blockMeshDict
deleted file mode 100644
index 97fcef9e025a8177b94cf7d48a67d153062932fc..0000000000000000000000000000000000000000
--- a/tutorials/incompressible/MRFSimpleFoam/mixerVessel2D/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,818 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General macros to create 2D/extruded-2D meshes
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-convertToMeters 0.1;
-
-// Hub radius
-
-
-// Impeller-tip radius
-
-
-// Baffle-tip radius
-
-
-// Tank radius
-
-
-// MRF region radius
-
-
-// Thickness of 2D slab
-
-
-// Base z
-
-
-// Top z
-
-
-// Number of cells radially between hub and impeller tip
-
-
-// Number of cells radially in each of the two regions between
-// impeller and baffle tips
-
-
-// Number of cells radially between baffle tip and tank
-
-
-// Number of cells azimuthally in each of the 8 blocks
-
-
-// Number of cells in the thickness of the slab
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-vertices
-(
-    (0.2 0 0) // Vertex r0b = 0 
-    (0.2 0 0) // Vertex r0sb = 1 
-    (0.141421356364228 -0.141421356110391 0) // Vertex r1b = 2 
-    (3.58979347393082e-10 -0.2 0) // Vertex r2b = 3 
-    (3.58979347393082e-10 -0.2 0) // Vertex r2sb = 4 
-    (-0.141421355856554 -0.141421356618065 0) // Vertex r3b = 5 
-    (-0.2 7.17958694786164e-10 0) // Vertex r4b = 6 
-    (-0.2 7.17958694786164e-10 0) // Vertex r4sb = 7 
-    (-0.141421355856554 0.141421356618065 0) // Vertex r5b = 8 
-    (3.58979347393082e-10 0.2 0) // Vertex r6b = 9 
-    (3.58979347393082e-10 0.2 0) // Vertex r6sb = 10 
-    (0.141421356364228 0.141421356110391 0) // Vertex r7b = 11 
-
-    (0.5 0 0) // Vertex rb0b = 12 
-    (0.353553390910569 -0.353553390275978 0) // Vertex rb1b = 13 
-    (8.97448368482705e-10 -0.5 0) // Vertex rb2b = 14 
-    (-0.353553389641386 -0.353553391545162 0) // Vertex rb3b = 15 
-    (-0.5 1.79489673696541e-09 0) // Vertex rb4b = 16 
-    (-0.353553389641386 0.353553391545162 0) // Vertex rb5b = 17 
-    (8.97448368482705e-10 0.5 0) // Vertex rb6b = 18 
-    (0.353553390910569 0.353553390275978 0) // Vertex rb7b = 19 
-
-    (0.6 0 0) // Vertex ri0b = 20 
-    (0.424264069092683 -0.424264068331174 0) // Vertex ri1b = 21 
-    (1.07693804217925e-09 -0.6 0) // Vertex ri2b = 22 
-    (-0.424264067569663 -0.424264069854194 0) // Vertex ri3b = 23 
-    (-0.6 2.15387608435849e-09 0) // Vertex ri4b = 24 
-    (-0.424264067569663 0.424264069854194 0) // Vertex ri5b = 25 
-    (1.07693804217925e-09 0.6 0) // Vertex ri6b = 26 
-    (0.424264069092683 0.424264068331174 0) // Vertex ri7b = 27 
-
-    (0.7 0 0) // Vertex Rb0b = 28 
-    (0.494974747274797 -0.494974746386369 0) // Vertex Rb1b = 29 
-    (1.25642771587579e-09 -0.7 0) // Vertex Rb2b = 30 
-    (-0.49497474549794 -0.494974748163226 0) // Vertex Rb3b = 31 
-    (-0.7 2.51285543175157e-09 0) // Vertex Rb4b = 32 
-    (-0.49497474549794 0.494974748163226 0) // Vertex Rb5b = 33 
-    (1.25642771587579e-09 0.7 0) // Vertex Rb6b = 34 
-    (0.494974747274797 0.494974746386369 0) // Vertex Rb7b = 35 
-
-    (1 0 0) // Vertex R0b = 36 
-    (0.707106781821139 -0.707106780551956 0) // Vertex R1b = 37 
-    (0.707106781821139 -0.707106780551956 0) // Vertex R1sb = 38 
-    (1.79489673696541e-09 -1 0) // Vertex R2b = 39 
-    (-0.707106779282772 -0.707106783090323 0) // Vertex R3b = 40 
-    (-0.707106779282772 -0.707106783090323 0) // Vertex R3sb = 41 
-    (-1 3.58979347393082e-09 0) // Vertex R4b = 42 
-    (-0.707106779282772 0.707106783090323 0) // Vertex R5b = 43 
-    (-0.707106779282772 0.707106783090323 0) // Vertex R5sb = 44 
-    (1.79489673696541e-09 1 0) // Vertex R6b = 45 
-    (0.707106781821139 0.707106780551956 0) // Vertex R7b = 46 
-    (0.707106781821139 0.707106780551956 0) // Vertex R7sb = 47 
-
-    (0.2 0 0.1) // Vertex r0t = 48 
-    (0.2 0 0.1) // Vertex r0st = 49 
-    (0.141421356364228 -0.141421356110391 0.1) // Vertex r1t = 50 
-    (3.58979347393082e-10 -0.2 0.1) // Vertex r2t = 51 
-    (3.58979347393082e-10 -0.2 0.1) // Vertex r2st = 52 
-    (-0.141421355856554 -0.141421356618065 0.1) // Vertex r3t = 53 
-    (-0.2 7.17958694786164e-10 0.1) // Vertex r4t = 54 
-    (-0.2 7.17958694786164e-10 0.1) // Vertex r4st = 55 
-    (-0.141421355856554 0.141421356618065 0.1) // Vertex r5t = 56 
-    (3.58979347393082e-10 0.2 0.1) // Vertex r6t = 57 
-    (3.58979347393082e-10 0.2 0.1) // Vertex r6st = 58 
-    (0.141421356364228 0.141421356110391 0.1) // Vertex r7t = 59 
-
-    (0.5 0 0.1) // Vertex rb0t = 60 
-    (0.353553390910569 -0.353553390275978 0.1) // Vertex rb1t = 61 
-    (8.97448368482705e-10 -0.5 0.1) // Vertex rb2t = 62 
-    (-0.353553389641386 -0.353553391545162 0.1) // Vertex rb3t = 63 
-    (-0.5 1.79489673696541e-09 0.1) // Vertex rb4t = 64 
-    (-0.353553389641386 0.353553391545162 0.1) // Vertex rb5t = 65 
-    (8.97448368482705e-10 0.5 0.1) // Vertex rb6t = 66 
-    (0.353553390910569 0.353553390275978 0.1) // Vertex rb7t = 67 
-
-    (0.6 0 0.1) // Vertex ri0t = 68 
-    (0.424264069092683 -0.424264068331174 0.1) // Vertex ri1t = 69 
-    (1.07693804217925e-09 -0.6 0.1) // Vertex ri2t = 70 
-    (-0.424264067569663 -0.424264069854194 0.1) // Vertex ri3t = 71 
-    (-0.6 2.15387608435849e-09 0.1) // Vertex ri4t = 72 
-    (-0.424264067569663 0.424264069854194 0.1) // Vertex ri5t = 73 
-    (1.07693804217925e-09 0.6 0.1) // Vertex ri6t = 74 
-    (0.424264069092683 0.424264068331174 0.1) // Vertex ri7t = 75 
-
-    (0.7 0 0.1) // Vertex Rb0t = 76 
-    (0.494974747274797 -0.494974746386369 0.1) // Vertex Rb1t = 77 
-    (1.25642771587579e-09 -0.7 0.1) // Vertex Rb2t = 78 
-    (-0.49497474549794 -0.494974748163226 0.1) // Vertex Rb3t = 79 
-    (-0.7 2.51285543175157e-09 0.1) // Vertex Rb4t = 80 
-    (-0.49497474549794 0.494974748163226 0.1) // Vertex Rb5t = 81 
-    (1.25642771587579e-09 0.7 0.1) // Vertex Rb6t = 82 
-    (0.494974747274797 0.494974746386369 0.1) // Vertex Rb7t = 83 
-
-    (1 0 0.1) // Vertex R0t = 84 
-    (0.707106781821139 -0.707106780551956 0.1) // Vertex R1t = 85 
-    (0.707106781821139 -0.707106780551956 0.1) // Vertex R1st = 86 
-    (1.79489673696541e-09 -1 0.1) // Vertex R2t = 87 
-    (-0.707106779282772 -0.707106783090323 0.1) // Vertex R3t = 88 
-    (-0.707106779282772 -0.707106783090323 0.1) // Vertex R3st = 89 
-    (-1 3.58979347393082e-09 0.1) // Vertex R4t = 90 
-    (-0.707106779282772 0.707106783090323 0.1) // Vertex R5t = 91 
-    (-0.707106779282772 0.707106783090323 0.1) // Vertex R5st = 92 
-    (1.79489673696541e-09 1 0.1) // Vertex R6t = 93 
-    (0.707106781821139 0.707106780551956 0.1) // Vertex R7t = 94 
-    (0.707106781821139 0.707106780551956 0.1) // Vertex R7st = 95 
-);
-
-blocks
-(
-    // block0
-    hex (0 2 13 12 48 50 61 60)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (2 4 14 13 50 52 62 61)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (3 5 15 14 51 53 63 62)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (5 7 16 15 53 55 64 63)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (6 8 17 16 54 56 65 64)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (8 10 18 17 56 58 66 65)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (9 11 19 18 57 59 67 66)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (11 1 12 19 59 49 60 67)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (12 13 21 20 60 61 69 68)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (13 14 22 21 61 62 70 69)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (14 15 23 22 62 63 71 70)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (15 16 24 23 63 64 72 71)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (16 17 25 24 64 65 73 72)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (17 18 26 25 65 66 74 73)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (18 19 27 26 66 67 75 74)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (19 12 20 27 67 60 68 75)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (20 21 29 28 68 69 77 76)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (21 22 30 29 69 70 78 77)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (22 23 31 30 70 71 79 78)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (23 24 32 31 71 72 80 79)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (24 25 33 32 72 73 81 80)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (25 26 34 33 73 74 82 81)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (26 27 35 34 74 75 83 82)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (27 20 28 35 75 68 76 83)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (28 29 38 36 76 77 86 84)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (29 30 39 37 77 78 87 85)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (30 31 41 39 78 79 89 87)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (31 32 42 40 79 80 90 88)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (32 33 44 42 80 81 92 90)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (33 34 45 43 81 82 93 91)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (34 35 47 45 82 83 95 93)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (35 28 36 46 83 76 84 94)
-    (12 12 1)
-    simpleGrading (1 1 1)
-);
-
-edges
-(
-    arc 0 2 (0.184775906536601 -0.0765366863901046 0)
-    arc 2 4 (0.0765366867217582 -0.184775906399226 0)
-    arc 3 5 (-0.0765366860584508 -0.184775906673977 0)
-    arc 5 7 (-0.18477590626185 -0.0765366870534118 0)
-    arc 6 8 (-0.18477590626185 0.0765366870534118 0)
-    arc 8 10 (-0.0765366860584508 0.184775906673977 0)
-    arc 9 11 (0.0765366867217582 0.184775906399226 0)
-    arc 11 1 (0.184775906536601 0.0765366863901046 0)
-
-    arc 12 13 (0.461939766341503 -0.191341715975262 0)
-    arc 13 14 (0.191341716804395 -0.461939765998065 0)
-    arc 14 15 (-0.191341715146127 -0.461939766684942 0)
-    arc 15 16 (-0.461939765654626 -0.19134171763353 0)
-    arc 16 17 (-0.461939765654626 0.19134171763353 0)
-    arc 17 18 (-0.191341715146127 0.461939766684942 0)
-    arc 18 19 (0.191341716804395 0.461939765998065 0)
-    arc 19 12 (0.461939766341503 0.191341715975262 0)
-
-    arc 20 21 (0.554327719609804 -0.229610059170314 0)
-    arc 21 22 (0.229610060165275 -0.554327719197677 0)
-    arc 22 23 (-0.229610058175352 -0.55432772002193 0)
-    arc 23 24 (-0.554327718785551 -0.229610061160235 0)
-    arc 24 25 (-0.554327718785551 0.229610061160235 0)
-    arc 25 26 (-0.229610058175352 0.55432772002193 0)
-    arc 26 27 (0.229610060165275 0.554327719197677 0)
-    arc 27 20 (0.554327719609804 0.229610059170314 0)
-
-    arc 28 29 (0.646715672878104 -0.267878402365366 0)
-    arc 29 30 (0.267878403526154 -0.64671567239729 0)
-    arc 30 31 (-0.267878401204578 -0.646715673358918 0)
-    arc 31 32 (-0.646715671916476 -0.267878404686941 0)
-    arc 32 33 (-0.646715671916476 0.267878404686941 0)
-    arc 33 34 (-0.267878401204578 0.646715673358918 0)
-    arc 34 35 (0.267878403526154 0.64671567239729 0)
-    arc 35 28 (0.646715672878104 0.267878402365366 0)
-
-    arc 36 38 (0.923879532683006 -0.382683431950523 0)
-    arc 37 39 (0.382683433608791 -0.923879531996129 0)
-    arc 39 41 (-0.382683430292254 -0.923879533369883 0)
-    arc 40 42 (-0.923879531309252 -0.382683435267059 0)
-    arc 42 44 (-0.923879531309252 0.382683435267059 0)
-    arc 43 45 (-0.382683430292254 0.923879533369883 0)
-    arc 45 47 (0.382683433608791 0.923879531996129 0)
-    arc 46 36 (0.923879532683006 0.382683431950523 0)
-
-    arc 48 50 (0.184775906536601 -0.0765366863901046 0.1)
-    arc 50 52 (0.0765366867217582 -0.184775906399226 0.1)
-    arc 51 53 (-0.0765366860584508 -0.184775906673977 0.1)
-    arc 53 55 (-0.18477590626185 -0.0765366870534118 0.1)
-    arc 54 56 (-0.18477590626185 0.0765366870534118 0.1)
-    arc 56 58 (-0.0765366860584508 0.184775906673977 0.1)
-    arc 57 59 (0.0765366867217582 0.184775906399226 0.1)
-    arc 59 49 (0.184775906536601 0.0765366863901046 0.1)
-
-    arc 60 61 (0.461939766341503 -0.191341715975262 0.1)
-    arc 61 62 (0.191341716804395 -0.461939765998065 0.1)
-    arc 62 63 (-0.191341715146127 -0.461939766684942 0.1)
-    arc 63 64 (-0.461939765654626 -0.19134171763353 0.1)
-    arc 64 65 (-0.461939765654626 0.19134171763353 0.1)
-    arc 65 66 (-0.191341715146127 0.461939766684942 0.1)
-    arc 66 67 (0.191341716804395 0.461939765998065 0.1)
-    arc 67 60 (0.461939766341503 0.191341715975262 0.1)
-
-    arc 68 69 (0.554327719609804 -0.229610059170314 0.1)
-    arc 69 70 (0.229610060165275 -0.554327719197677 0.1)
-    arc 70 71 (-0.229610058175352 -0.55432772002193 0.1)
-    arc 71 72 (-0.554327718785551 -0.229610061160235 0.1)
-    arc 72 73 (-0.554327718785551 0.229610061160235 0.1)
-    arc 73 74 (-0.229610058175352 0.55432772002193 0.1)
-    arc 74 75 (0.229610060165275 0.554327719197677 0.1)
-    arc 75 68 (0.554327719609804 0.229610059170314 0.1)
-
-    arc 76 77 (0.646715672878104 -0.267878402365366 0.1)
-    arc 77 78 (0.267878403526154 -0.64671567239729 0.1)
-    arc 78 79 (-0.267878401204578 -0.646715673358918 0.1)
-    arc 79 80 (-0.646715671916476 -0.267878404686941 0.1)
-    arc 80 81 (-0.646715671916476 0.267878404686941 0.1)
-    arc 81 82 (-0.267878401204578 0.646715673358918 0.1)
-    arc 82 83 (0.267878403526154 0.64671567239729 0.1)
-    arc 83 76 (0.646715672878104 0.267878402365366 0.1)
-
-    arc 84 86 (0.923879532683006 -0.382683431950523 0.1)
-    arc 85 87 (0.382683433608791 -0.923879531996129 0.1)
-    arc 87 89 (-0.382683430292254 -0.923879533369883 0.1)
-    arc 88 90 (-0.923879531309252 -0.382683435267059 0.1)
-    arc 90 92 (-0.923879531309252 0.382683435267059 0.1)
-    arc 91 93 (-0.382683430292254 0.923879533369883 0.1)
-    arc 93 95 (0.382683433608791 0.923879531996129 0.1)
-    arc 94 84 (0.923879532683006 0.382683431950523 0.1)
-);
-
-patches
-(
-    wall rotor
-    (
-        (0 2 50 48)
-        (2 4 52 50)
-        (3 5 53 51)
-        (5 7 55 53)
-        (6 8 56 54)
-        (8 10 58 56)
-        (9 11 59 57)
-        (11 1 49 59)
-
-        (0 12 60 48)
-        (1 12 60 49)
-
-        (3 14 62 51)
-        (4 14 62 52)
-
-        (6 16 64 54)
-        (7 16 64 55)
-
-        (9 18 66 57)
-        (10 18 66 58)
-    )
-
-    wall stator
-    (
-        (36 38 86 84)
-        (37 39 87 85)
-        (39 41 89 87)
-        (40 42 90 88)
-        (42 44 92 90)
-        (43 45 93 91)
-        (45 47 95 93)
-        (46 36 84 94)
-
-        (37 29 77 85)
-        (38 29 77 86)
-
-        (40 31 79 88)
-        (41 31 79 89)
-
-        (43 33 81 91)
-        (44 33 81 92)
-
-        (46 35 83 94)
-        (47 35 83 95)
-    )
-
-    empty front
-    (
-        (48 50 61 60)
-        (50 52 62 61)
-        (51 53 63 62)
-        (53 55 64 63)
-        (54 56 65 64)
-        (56 58 66 65)
-        (57 59 67 66)
-        (59 49 60 67)
-        (60 61 69 68)
-        (61 62 70 69)
-        (62 63 71 70)
-        (63 64 72 71)
-        (64 65 73 72)
-        (65 66 74 73)
-        (66 67 75 74)
-        (67 60 68 75)
-        (68 69 77 76)
-        (69 70 78 77)
-        (70 71 79 78)
-        (71 72 80 79)
-        (72 73 81 80)
-        (73 74 82 81)
-        (74 75 83 82)
-        (75 68 76 83)
-        (76 77 86 84)
-        (77 78 87 85)
-        (78 79 89 87)
-        (79 80 90 88)
-        (80 81 92 90)
-        (81 82 93 91)
-        (82 83 95 93)
-        (83 76 84 94)
-    )
-
-    empty back
-    (
-        (0 12 13 2)
-        (2 13 14 4)
-        (3 14 15 5)
-        (5 15 16 7)
-        (6 16 17 8)
-        (8 17 18 10)
-        (9 18 19 11)
-        (11 19 12 1)
-        (12 20 21 13)
-        (13 21 22 14)
-        (14 22 23 15)
-        (15 23 24 16)
-        (16 24 25 17)
-        (17 25 26 18)
-        (18 26 27 19)
-        (19 27 20 12)
-        (20 28 29 21)
-        (21 29 30 22)
-        (22 30 31 23)
-        (23 31 32 24)
-        (24 32 33 25)
-        (25 33 34 26)
-        (26 34 35 27)
-        (27 35 28 20)
-        (28 36 38 29)
-        (29 37 39 30)
-        (30 39 41 31)
-        (31 40 42 32)
-        (32 42 44 33)
-        (33 43 45 34)
-        (34 45 47 35)
-        (35 46 36 28)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict
deleted file mode 100644
index 0922303da33f01fd52960b00160c0dc787f5d9d4..0000000000000000000000000000000000000000
--- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,123 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// block definition for a porosity with an angled inlet/outlet
-// the porosity is not aligned with the main axes
-//
-                             
-convertToMeters 0.001;
-
-vertices
-(
-    // inlet region
-    ( -150  0  -25 )  // pt 0 (in1b) 
-    ( -150 35.35533906  -25 ) // pt 1 (in2b) 
-    ( -150  0  25 )  // pt 2 (in1f) 
-    ( -150 35.35533906  25 ) // pt 3 (in2f) 
-
-    // join inlet->outlet
-    (  0 0  -25 )    // pt 4 (join1b) 
-    ( -35.35533906   35.35533906  -25 ) // pt 5 (join2b) 
-    (  0 0  25 )    // pt 6 (join1f) 
-    ( -35.35533906   35.35533906  25 ) // pt 7 (join2f) 
-
-    // porosity ends ->outlet
-    ( 70.71067812 70.71067812  -25 )  // pt 8 (poro1b) 
-    ( 35.35533906 106.06601718  -25 )  // pt 9 (poro2b) 
-    ( 70.71067812 70.71067812  25 )  // pt 10 (poro1f) 
-    ( 35.35533906 106.06601718  25 )  // pt 11 (poro2f) 
-
-    // outlet
-    ( 141.42135624 141.42135624 -25 ) // pt 12 (out1b) 
-    ( 106.06601718 176.7766953 -25 ) // pt 13 (out2b) 
-    ( 141.42135624 141.42135624 25 ) // pt 14 (out1f) 
-    ( 106.06601718 176.7766953 25 ) // pt 15 (out2f) 
-);
-
-blocks
-(
-    // inlet block
-    hex (0 4 5 1 2 6 7 3)
-    inlet ( 15 20 20 ) simpleGrading (1 1 1)
-
-    // porosity block
-    hex (4 8 9 5 6 10 11 7)
-    porosity ( 20 20 20 ) simpleGrading (1 1 1)
-
-    // outlet block
-    hex (8 12 13 9 10 14 15 11)
-    outlet ( 20 20 20 )  simpleGrading (1 1 1)
-);
-
-edges
-(
-);
-
-patches
-(
-    // is there no way of defining all my 'defaultFaces' to be 'wall'?
-    wall front
-    (
-    // inlet block
-    (2 6 7 3)
-    // outlet block
-    (10 14 15 11)
-    )
-
-    wall back
-    (
-    // inlet block
-    (1 5 4 0)
-    // outlet block
-    (9 13 12 8)
-    )
-
-    wall wall
-    (
-    // inlet block
-    (2 0 4 6)
-    (7 5 1 3)
-    // outlet block
-    (10 8 12 14)
-    (15 13 9 11)
-    )
-
-    wall porosityWall
-    (
-    // porosity block
-    (6 10 11 7)
-    // porosity block
-    (5 9 8 4)
-    // porosity block
-    (6 4 8 10)
-    (11 9 5 7)
-    )
-
-    patch inlet
-    (
-    (3 1 0 2)
-    )
-
-    patch outlet
-    (
-    (15 13 12 14)
-    )
-);
-
-mergePatchPairs
-(
-);
-
-// ************************************************************************* //
diff --git a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4 b/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4
deleted file mode 100644
index fb67da75dadc3bff07ef6a1043acfd66b2c49011..0000000000000000000000000000000000000000
--- a/tutorials/incompressible/porousSimpleFoam/angledDuctImplicit/constant/polyMesh/blockMeshDict.m4
+++ /dev/null
@@ -1,165 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    `format'      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// block definition for a porosity with an angled inlet/outlet
-// the porosity is not aligned with the main axes
-//
-dnl> -----------------------------------------------------------------
-dnl> <STANDARD DEFINTIONS>
-dnl>
-changecom(//)changequote([,]) dnl>
-define(calc, [esyscmd(perl -e 'print ($1)')]) dnl>
-define(VCOUNT, 0)  dnl>
-define(vlabel, [[// ]pt VCOUNT ($1) define($1, VCOUNT)define([VCOUNT], incr(VCOUNT))])  dnl>
-dnl>
-define(hex2D, hex ($1b $2b $3b $4b $1f $2f $3f $4f)) dnl>
-define(quad2D, ($1f $1b $2b $2f))  dnl>
-define(frontQuad, ($1f $2f $3f $4f)) dnl>
-define(backQuad, ($4b $3b $2b $1b)) dnl>
-dnl>
-dnl> </STANDARD DEFINTIONS>
-dnl> -----------------------------------------------------------------
-dnl>
-define(ncells, 20) dnl>
-define(ninlet, 15) dnl>
-define(nporo, 20) dnl>
-define(noutlet, 20) dnl>
-dnl>
-define(x0,0) dnl>
-define(y0,0) dnl>
-define(y0,0) dnl>
-define(Cos,0.7071067812) dnl>   == cos(45)
-define(Sin,0.7071067812) dnl>   == sin(45)
-dnl>
-define(width,50) dnl>
-define(zBack,calc(-width/2)) dnl>
-define(zFront,calc(width/2)) dnl>
-define(leninlet,150)dnl>
-define(lenporo,100)dnl>
-define(lenoutlet,100)dnl>
-dnl>
-define(xhyp,calc(Sin*width)) dnl>
-define(yhyp,calc(Cos*width)) dnl>
-define(xinlet,leninlet)dnl>
-define(xporo,calc(Cos*lenporo)) dnl>
-define(yporo,calc(Sin*lenporo)) dnl>
-define(xoutlet,calc(xporo + Cos*lenoutlet)) dnl>
-define(youtlet,calc(yporo + Sin*lenoutlet)) dnl>
-dnl>
-
-convertToMeters 0.001;
-
-vertices
-(
-    // inlet region
-    ( -xinlet  y0  zBack )  vlabel(in1b)
-    ( -xinlet yhyp  zBack ) vlabel(in2b)
-    ( -xinlet  y0  zFront )  vlabel(in1f)
-    ( -xinlet yhyp  zFront ) vlabel(in2f)
-
-    // join inlet->outlet
-    (  x0 y0  zBack )    vlabel(join1b)
-    ( -xhyp   yhyp  zBack ) vlabel(join2b)
-    (  x0 y0  zFront )    vlabel(join1f)
-    ( -xhyp   yhyp  zFront ) vlabel(join2f)
-
-    // porosity ends ->outlet
-    ( xporo yporo  zBack )  vlabel(poro1b)
-    ( calc(xporo - xhyp) calc(yporo + yhyp)  zBack )  vlabel(poro2b)
-    ( xporo yporo  zFront )  vlabel(poro1f)
-    ( calc(xporo - xhyp) calc(yporo + yhyp)  zFront )  vlabel(poro2f)
-
-    // outlet
-    ( xoutlet youtlet zBack ) vlabel(out1b)
-    ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zBack ) vlabel(out2b)
-    ( xoutlet youtlet zFront ) vlabel(out1f)
-    ( calc(xoutlet - xhyp) calc(youtlet + yhyp) zFront ) vlabel(out2f)
-);
-
-blocks
-(
-    // inlet block
-    hex2D(in1, join1, join2, in2)
-    inlet ( ninlet ncells ncells ) simpleGrading (1 1 1)
-
-    // porosity block
-    hex2D(join1, poro1, poro2, join2)
-    porosity ( nporo ncells ncells ) simpleGrading (1 1 1)
-
-    // outlet block
-    hex2D(poro1, out1, out2, poro2)
-    outlet ( noutlet ncells ncells )  simpleGrading (1 1 1)
-);
-
-edges
-(
-);
-
-patches
-(
-    // is there no way of defining all my 'defaultFaces' to be 'wall'?
-    wall front
-    (
-    // inlet block
-    frontQuad(in1, join1, join2, in2)
-    // outlet block
-    frontQuad(poro1, out1, out2, poro2)
-    )
-
-    wall back
-    (
-    // inlet block
-    backQuad(in1, join1, join2, in2)
-    // outlet block
-    backQuad(poro1, out1, out2, poro2)
-    )
-
-    wall wall
-    (
-    // inlet block
-    quad2D(in1, join1)
-    quad2D(join2, in2)
-    // outlet block
-    quad2D(poro1, out1)
-    quad2D(out2, poro2)
-    )
-
-    wall porosityWall
-    (
-    // porosity block
-    frontQuad(join1, poro1, poro2, join2)
-    // porosity block
-    backQuad(join1, poro1, poro2, join2)
-    // porosity block
-    quad2D(join1, poro1)
-    quad2D(poro2, join2)
-    )
-
-    patch inlet
-    (
-    quad2D(in2, in1)
-    )
-
-    patch outlet
-    (
-    quad2D(out2, out1)
-    )
-);
-
-mergePatchPairs
-(
-);
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict b/tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict
deleted file mode 100644
index c9ad25278e42edd1507710cde0663289cf726734..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/MRFInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,818 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General macros to create 2D/extruded-2D meshes
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-convertToMeters 0.1;
-
-// Hub radius
-
-
-// Impeller-tip radius
-
-
-// Baffle-tip radius
-
-
-// Tank radius
-
-
-// MRF region radius
-
-
-// Thickness of 2D slab
-
-
-// Base z
-
-
-// Top z
-
-
-// Number of cells radially between hub and impeller tip
-
-
-// Number of cells radially in each of the two regions between
-// impeller and baffle tips
-
-
-// Number of cells radially between baffle tip and tank
-
-
-// Number of cells azimuthally in each of the 8 blocks
-
-
-// Number of cells in the thickness of the slab
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-vertices
-(
-    (0.2 0 0) // Vertex r0b = 0
-    (0.2 0 0) // Vertex r0sb = 1
-    (0.141421356364228 -0.141421356110391 0) // Vertex r1b = 2
-    (3.58979347393082e-10 -0.2 0) // Vertex r2b = 3
-    (3.58979347393082e-10 -0.2 0) // Vertex r2sb = 4
-    (-0.141421355856554 -0.141421356618065 0) // Vertex r3b = 5
-    (-0.2 7.17958694786164e-10 0) // Vertex r4b = 6
-    (-0.2 7.17958694786164e-10 0) // Vertex r4sb = 7
-    (-0.141421355856554 0.141421356618065 0) // Vertex r5b = 8
-    (3.58979347393082e-10 0.2 0) // Vertex r6b = 9
-    (3.58979347393082e-10 0.2 0) // Vertex r6sb = 10
-    (0.141421356364228 0.141421356110391 0) // Vertex r7b = 11
-
-    (0.5 0 0) // Vertex rb0b = 12
-    (0.353553390910569 -0.353553390275978 0) // Vertex rb1b = 13
-    (8.97448368482705e-10 -0.5 0) // Vertex rb2b = 14
-    (-0.353553389641386 -0.353553391545162 0) // Vertex rb3b = 15
-    (-0.5 1.79489673696541e-09 0) // Vertex rb4b = 16
-    (-0.353553389641386 0.353553391545162 0) // Vertex rb5b = 17
-    (8.97448368482705e-10 0.5 0) // Vertex rb6b = 18
-    (0.353553390910569 0.353553390275978 0) // Vertex rb7b = 19
-
-    (0.6 0 0) // Vertex ri0b = 20
-    (0.424264069092683 -0.424264068331174 0) // Vertex ri1b = 21
-    (1.07693804217925e-09 -0.6 0) // Vertex ri2b = 22
-    (-0.424264067569663 -0.424264069854194 0) // Vertex ri3b = 23
-    (-0.6 2.15387608435849e-09 0) // Vertex ri4b = 24
-    (-0.424264067569663 0.424264069854194 0) // Vertex ri5b = 25
-    (1.07693804217925e-09 0.6 0) // Vertex ri6b = 26
-    (0.424264069092683 0.424264068331174 0) // Vertex ri7b = 27
-
-    (0.7 0 0) // Vertex Rb0b = 28
-    (0.494974747274797 -0.494974746386369 0) // Vertex Rb1b = 29
-    (1.25642771587579e-09 -0.7 0) // Vertex Rb2b = 30
-    (-0.49497474549794 -0.494974748163226 0) // Vertex Rb3b = 31
-    (-0.7 2.51285543175157e-09 0) // Vertex Rb4b = 32
-    (-0.49497474549794 0.494974748163226 0) // Vertex Rb5b = 33
-    (1.25642771587579e-09 0.7 0) // Vertex Rb6b = 34
-    (0.494974747274797 0.494974746386369 0) // Vertex Rb7b = 35
-
-    (1 0 0) // Vertex R0b = 36
-    (0.707106781821139 -0.707106780551956 0) // Vertex R1b = 37
-    (0.707106781821139 -0.707106780551956 0) // Vertex R1sb = 38
-    (1.79489673696541e-09 -1 0) // Vertex R2b = 39
-    (-0.707106779282772 -0.707106783090323 0) // Vertex R3b = 40
-    (-0.707106779282772 -0.707106783090323 0) // Vertex R3sb = 41
-    (-1 3.58979347393082e-09 0) // Vertex R4b = 42
-    (-0.707106779282772 0.707106783090323 0) // Vertex R5b = 43
-    (-0.707106779282772 0.707106783090323 0) // Vertex R5sb = 44
-    (1.79489673696541e-09 1 0) // Vertex R6b = 45
-    (0.707106781821139 0.707106780551956 0) // Vertex R7b = 46
-    (0.707106781821139 0.707106780551956 0) // Vertex R7sb = 47
-
-    (0.2 0 0.1) // Vertex r0t = 48
-    (0.2 0 0.1) // Vertex r0st = 49
-    (0.141421356364228 -0.141421356110391 0.1) // Vertex r1t = 50
-    (3.58979347393082e-10 -0.2 0.1) // Vertex r2t = 51
-    (3.58979347393082e-10 -0.2 0.1) // Vertex r2st = 52
-    (-0.141421355856554 -0.141421356618065 0.1) // Vertex r3t = 53
-    (-0.2 7.17958694786164e-10 0.1) // Vertex r4t = 54
-    (-0.2 7.17958694786164e-10 0.1) // Vertex r4st = 55
-    (-0.141421355856554 0.141421356618065 0.1) // Vertex r5t = 56
-    (3.58979347393082e-10 0.2 0.1) // Vertex r6t = 57
-    (3.58979347393082e-10 0.2 0.1) // Vertex r6st = 58
-    (0.141421356364228 0.141421356110391 0.1) // Vertex r7t = 59
-
-    (0.5 0 0.1) // Vertex rb0t = 60
-    (0.353553390910569 -0.353553390275978 0.1) // Vertex rb1t = 61
-    (8.97448368482705e-10 -0.5 0.1) // Vertex rb2t = 62
-    (-0.353553389641386 -0.353553391545162 0.1) // Vertex rb3t = 63
-    (-0.5 1.79489673696541e-09 0.1) // Vertex rb4t = 64
-    (-0.353553389641386 0.353553391545162 0.1) // Vertex rb5t = 65
-    (8.97448368482705e-10 0.5 0.1) // Vertex rb6t = 66
-    (0.353553390910569 0.353553390275978 0.1) // Vertex rb7t = 67
-
-    (0.6 0 0.1) // Vertex ri0t = 68
-    (0.424264069092683 -0.424264068331174 0.1) // Vertex ri1t = 69
-    (1.07693804217925e-09 -0.6 0.1) // Vertex ri2t = 70
-    (-0.424264067569663 -0.424264069854194 0.1) // Vertex ri3t = 71
-    (-0.6 2.15387608435849e-09 0.1) // Vertex ri4t = 72
-    (-0.424264067569663 0.424264069854194 0.1) // Vertex ri5t = 73
-    (1.07693804217925e-09 0.6 0.1) // Vertex ri6t = 74
-    (0.424264069092683 0.424264068331174 0.1) // Vertex ri7t = 75
-
-    (0.7 0 0.1) // Vertex Rb0t = 76
-    (0.494974747274797 -0.494974746386369 0.1) // Vertex Rb1t = 77
-    (1.25642771587579e-09 -0.7 0.1) // Vertex Rb2t = 78
-    (-0.49497474549794 -0.494974748163226 0.1) // Vertex Rb3t = 79
-    (-0.7 2.51285543175157e-09 0.1) // Vertex Rb4t = 80
-    (-0.49497474549794 0.494974748163226 0.1) // Vertex Rb5t = 81
-    (1.25642771587579e-09 0.7 0.1) // Vertex Rb6t = 82
-    (0.494974747274797 0.494974746386369 0.1) // Vertex Rb7t = 83
-
-    (1 0 0.1) // Vertex R0t = 84
-    (0.707106781821139 -0.707106780551956 0.1) // Vertex R1t = 85
-    (0.707106781821139 -0.707106780551956 0.1) // Vertex R1st = 86
-    (1.79489673696541e-09 -1 0.1) // Vertex R2t = 87
-    (-0.707106779282772 -0.707106783090323 0.1) // Vertex R3t = 88
-    (-0.707106779282772 -0.707106783090323 0.1) // Vertex R3st = 89
-    (-1 3.58979347393082e-09 0.1) // Vertex R4t = 90
-    (-0.707106779282772 0.707106783090323 0.1) // Vertex R5t = 91
-    (-0.707106779282772 0.707106783090323 0.1) // Vertex R5st = 92
-    (1.79489673696541e-09 1 0.1) // Vertex R6t = 93
-    (0.707106781821139 0.707106780551956 0.1) // Vertex R7t = 94
-    (0.707106781821139 0.707106780551956 0.1) // Vertex R7st = 95
-);
-
-blocks
-(
-    // block0
-    hex (0 2 13 12 48 50 61 60)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (2 4 14 13 50 52 62 61)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (3 5 15 14 51 53 63 62)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (5 7 16 15 53 55 64 63)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (6 8 17 16 54 56 65 64)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (8 10 18 17 56 58 66 65)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (9 11 19 18 57 59 67 66)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (11 1 12 19 59 49 60 67)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (12 13 21 20 60 61 69 68)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (13 14 22 21 61 62 70 69)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (14 15 23 22 62 63 71 70)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (15 16 24 23 63 64 72 71)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (16 17 25 24 64 65 73 72)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (17 18 26 25 65 66 74 73)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (18 19 27 26 66 67 75 74)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (19 12 20 27 67 60 68 75)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (20 21 29 28 68 69 77 76)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (21 22 30 29 69 70 78 77)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (22 23 31 30 70 71 79 78)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (23 24 32 31 71 72 80 79)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (24 25 33 32 72 73 81 80)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (25 26 34 33 73 74 82 81)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (26 27 35 34 74 75 83 82)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (27 20 28 35 75 68 76 83)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (28 29 38 36 76 77 86 84)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (29 30 39 37 77 78 87 85)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (30 31 41 39 78 79 89 87)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (31 32 42 40 79 80 90 88)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (32 33 44 42 80 81 92 90)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (33 34 45 43 81 82 93 91)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (34 35 47 45 82 83 95 93)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (35 28 36 46 83 76 84 94)
-    (12 12 1)
-    simpleGrading (1 1 1)
-);
-
-edges
-(
-    arc 0 2 (0.184775906536601 -0.0765366863901046 0)
-    arc 2 4 (0.0765366867217582 -0.184775906399226 0)
-    arc 3 5 (-0.0765366860584508 -0.184775906673977 0)
-    arc 5 7 (-0.18477590626185 -0.0765366870534118 0)
-    arc 6 8 (-0.18477590626185 0.0765366870534118 0)
-    arc 8 10 (-0.0765366860584508 0.184775906673977 0)
-    arc 9 11 (0.0765366867217582 0.184775906399226 0)
-    arc 11 1 (0.184775906536601 0.0765366863901046 0)
-
-    arc 12 13 (0.461939766341503 -0.191341715975262 0)
-    arc 13 14 (0.191341716804395 -0.461939765998065 0)
-    arc 14 15 (-0.191341715146127 -0.461939766684942 0)
-    arc 15 16 (-0.461939765654626 -0.19134171763353 0)
-    arc 16 17 (-0.461939765654626 0.19134171763353 0)
-    arc 17 18 (-0.191341715146127 0.461939766684942 0)
-    arc 18 19 (0.191341716804395 0.461939765998065 0)
-    arc 19 12 (0.461939766341503 0.191341715975262 0)
-
-    arc 20 21 (0.554327719609804 -0.229610059170314 0)
-    arc 21 22 (0.229610060165275 -0.554327719197677 0)
-    arc 22 23 (-0.229610058175352 -0.55432772002193 0)
-    arc 23 24 (-0.554327718785551 -0.229610061160235 0)
-    arc 24 25 (-0.554327718785551 0.229610061160235 0)
-    arc 25 26 (-0.229610058175352 0.55432772002193 0)
-    arc 26 27 (0.229610060165275 0.554327719197677 0)
-    arc 27 20 (0.554327719609804 0.229610059170314 0)
-
-    arc 28 29 (0.646715672878104 -0.267878402365366 0)
-    arc 29 30 (0.267878403526154 -0.64671567239729 0)
-    arc 30 31 (-0.267878401204578 -0.646715673358918 0)
-    arc 31 32 (-0.646715671916476 -0.267878404686941 0)
-    arc 32 33 (-0.646715671916476 0.267878404686941 0)
-    arc 33 34 (-0.267878401204578 0.646715673358918 0)
-    arc 34 35 (0.267878403526154 0.64671567239729 0)
-    arc 35 28 (0.646715672878104 0.267878402365366 0)
-
-    arc 36 38 (0.923879532683006 -0.382683431950523 0)
-    arc 37 39 (0.382683433608791 -0.923879531996129 0)
-    arc 39 41 (-0.382683430292254 -0.923879533369883 0)
-    arc 40 42 (-0.923879531309252 -0.382683435267059 0)
-    arc 42 44 (-0.923879531309252 0.382683435267059 0)
-    arc 43 45 (-0.382683430292254 0.923879533369883 0)
-    arc 45 47 (0.382683433608791 0.923879531996129 0)
-    arc 46 36 (0.923879532683006 0.382683431950523 0)
-
-    arc 48 50 (0.184775906536601 -0.0765366863901046 0.1)
-    arc 50 52 (0.0765366867217582 -0.184775906399226 0.1)
-    arc 51 53 (-0.0765366860584508 -0.184775906673977 0.1)
-    arc 53 55 (-0.18477590626185 -0.0765366870534118 0.1)
-    arc 54 56 (-0.18477590626185 0.0765366870534118 0.1)
-    arc 56 58 (-0.0765366860584508 0.184775906673977 0.1)
-    arc 57 59 (0.0765366867217582 0.184775906399226 0.1)
-    arc 59 49 (0.184775906536601 0.0765366863901046 0.1)
-
-    arc 60 61 (0.461939766341503 -0.191341715975262 0.1)
-    arc 61 62 (0.191341716804395 -0.461939765998065 0.1)
-    arc 62 63 (-0.191341715146127 -0.461939766684942 0.1)
-    arc 63 64 (-0.461939765654626 -0.19134171763353 0.1)
-    arc 64 65 (-0.461939765654626 0.19134171763353 0.1)
-    arc 65 66 (-0.191341715146127 0.461939766684942 0.1)
-    arc 66 67 (0.191341716804395 0.461939765998065 0.1)
-    arc 67 60 (0.461939766341503 0.191341715975262 0.1)
-
-    arc 68 69 (0.554327719609804 -0.229610059170314 0.1)
-    arc 69 70 (0.229610060165275 -0.554327719197677 0.1)
-    arc 70 71 (-0.229610058175352 -0.55432772002193 0.1)
-    arc 71 72 (-0.554327718785551 -0.229610061160235 0.1)
-    arc 72 73 (-0.554327718785551 0.229610061160235 0.1)
-    arc 73 74 (-0.229610058175352 0.55432772002193 0.1)
-    arc 74 75 (0.229610060165275 0.554327719197677 0.1)
-    arc 75 68 (0.554327719609804 0.229610059170314 0.1)
-
-    arc 76 77 (0.646715672878104 -0.267878402365366 0.1)
-    arc 77 78 (0.267878403526154 -0.64671567239729 0.1)
-    arc 78 79 (-0.267878401204578 -0.646715673358918 0.1)
-    arc 79 80 (-0.646715671916476 -0.267878404686941 0.1)
-    arc 80 81 (-0.646715671916476 0.267878404686941 0.1)
-    arc 81 82 (-0.267878401204578 0.646715673358918 0.1)
-    arc 82 83 (0.267878403526154 0.64671567239729 0.1)
-    arc 83 76 (0.646715672878104 0.267878402365366 0.1)
-
-    arc 84 86 (0.923879532683006 -0.382683431950523 0.1)
-    arc 85 87 (0.382683433608791 -0.923879531996129 0.1)
-    arc 87 89 (-0.382683430292254 -0.923879533369883 0.1)
-    arc 88 90 (-0.923879531309252 -0.382683435267059 0.1)
-    arc 90 92 (-0.923879531309252 0.382683435267059 0.1)
-    arc 91 93 (-0.382683430292254 0.923879533369883 0.1)
-    arc 93 95 (0.382683433608791 0.923879531996129 0.1)
-    arc 94 84 (0.923879532683006 0.382683431950523 0.1)
-);
-
-patches
-(
-    wall rotor
-    (
-        (0 2 50 48)
-        (2 4 52 50)
-        (3 5 53 51)
-        (5 7 55 53)
-        (6 8 56 54)
-        (8 10 58 56)
-        (9 11 59 57)
-        (11 1 49 59)
-
-        (0 12 60 48)
-        (1 12 60 49)
-
-        (3 14 62 51)
-        (4 14 62 52)
-
-        (6 16 64 54)
-        (7 16 64 55)
-
-        (9 18 66 57)
-        (10 18 66 58)
-    )
-
-    wall stator
-    (
-        (36 38 86 84)
-        (37 39 87 85)
-        (39 41 89 87)
-        (40 42 90 88)
-        (42 44 92 90)
-        (43 45 93 91)
-        (45 47 95 93)
-        (46 36 84 94)
-
-        (37 29 77 85)
-        (38 29 77 86)
-
-        (40 31 79 88)
-        (41 31 79 89)
-
-        (43 33 81 91)
-        (44 33 81 92)
-
-        (46 35 83 94)
-        (47 35 83 95)
-    )
-
-    empty front
-    (
-        (48 50 61 60)
-        (50 52 62 61)
-        (51 53 63 62)
-        (53 55 64 63)
-        (54 56 65 64)
-        (56 58 66 65)
-        (57 59 67 66)
-        (59 49 60 67)
-        (60 61 69 68)
-        (61 62 70 69)
-        (62 63 71 70)
-        (63 64 72 71)
-        (64 65 73 72)
-        (65 66 74 73)
-        (66 67 75 74)
-        (67 60 68 75)
-        (68 69 77 76)
-        (69 70 78 77)
-        (70 71 79 78)
-        (71 72 80 79)
-        (72 73 81 80)
-        (73 74 82 81)
-        (74 75 83 82)
-        (75 68 76 83)
-        (76 77 86 84)
-        (77 78 87 85)
-        (78 79 89 87)
-        (79 80 90 88)
-        (80 81 92 90)
-        (81 82 93 91)
-        (82 83 95 93)
-        (83 76 84 94)
-    )
-
-    empty back
-    (
-        (0 12 13 2)
-        (2 13 14 4)
-        (3 14 15 5)
-        (5 15 16 7)
-        (6 16 17 8)
-        (8 17 18 10)
-        (9 18 19 11)
-        (11 19 12 1)
-        (12 20 21 13)
-        (13 21 22 14)
-        (14 22 23 15)
-        (15 23 24 16)
-        (16 24 25 17)
-        (17 25 26 18)
-        (18 26 27 19)
-        (19 27 20 12)
-        (20 28 29 21)
-        (21 29 30 22)
-        (22 30 31 23)
-        (23 31 32 24)
-        (24 32 33 25)
-        (25 33 34 26)
-        (26 34 35 27)
-        (27 35 28 20)
-        (28 36 38 29)
-        (29 37 39 30)
-        (30 39 41 31)
-        (31 40 42 32)
-        (32 42 44 33)
-        (33 43 45 34)
-        (34 45 47 35)
-        (35 46 36 28)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/alphas b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/alphas
deleted file mode 100644
index 295da111d5fc96c7d14c159d8567c13544b3adac..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/0/alphas
+++ /dev/null
@@ -1,3119 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       volScalarField;
-    location    "0";
-    object      alphas;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-dimensions      [0 0 0 0 0 0 0];
-
-internalField   nonuniform List<scalar>
-3072
-(
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1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0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-)
-;
-
-boundaryField
-{
-    rotor
-    {
-        type            zeroGradient;
-    }
-    stator
-    {
-        type            zeroGradient;
-    }
-    front
-    {
-        type            empty;
-    }
-    back
-    {
-        type            empty;
-    }
-}
-
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict b/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict
deleted file mode 100644
index c9ad25278e42edd1507710cde0663289cf726734..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/MRFMultiphaseInterFoam/mixerVessel2D/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,818 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General macros to create 2D/extruded-2D meshes
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-convertToMeters 0.1;
-
-// Hub radius
-
-
-// Impeller-tip radius
-
-
-// Baffle-tip radius
-
-
-// Tank radius
-
-
-// MRF region radius
-
-
-// Thickness of 2D slab
-
-
-// Base z
-
-
-// Top z
-
-
-// Number of cells radially between hub and impeller tip
-
-
-// Number of cells radially in each of the two regions between
-// impeller and baffle tips
-
-
-// Number of cells radially between baffle tip and tank
-
-
-// Number of cells azimuthally in each of the 8 blocks
-
-
-// Number of cells in the thickness of the slab
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-vertices
-(
-    (0.2 0 0) // Vertex r0b = 0
-    (0.2 0 0) // Vertex r0sb = 1
-    (0.141421356364228 -0.141421356110391 0) // Vertex r1b = 2
-    (3.58979347393082e-10 -0.2 0) // Vertex r2b = 3
-    (3.58979347393082e-10 -0.2 0) // Vertex r2sb = 4
-    (-0.141421355856554 -0.141421356618065 0) // Vertex r3b = 5
-    (-0.2 7.17958694786164e-10 0) // Vertex r4b = 6
-    (-0.2 7.17958694786164e-10 0) // Vertex r4sb = 7
-    (-0.141421355856554 0.141421356618065 0) // Vertex r5b = 8
-    (3.58979347393082e-10 0.2 0) // Vertex r6b = 9
-    (3.58979347393082e-10 0.2 0) // Vertex r6sb = 10
-    (0.141421356364228 0.141421356110391 0) // Vertex r7b = 11
-
-    (0.5 0 0) // Vertex rb0b = 12
-    (0.353553390910569 -0.353553390275978 0) // Vertex rb1b = 13
-    (8.97448368482705e-10 -0.5 0) // Vertex rb2b = 14
-    (-0.353553389641386 -0.353553391545162 0) // Vertex rb3b = 15
-    (-0.5 1.79489673696541e-09 0) // Vertex rb4b = 16
-    (-0.353553389641386 0.353553391545162 0) // Vertex rb5b = 17
-    (8.97448368482705e-10 0.5 0) // Vertex rb6b = 18
-    (0.353553390910569 0.353553390275978 0) // Vertex rb7b = 19
-
-    (0.6 0 0) // Vertex ri0b = 20
-    (0.424264069092683 -0.424264068331174 0) // Vertex ri1b = 21
-    (1.07693804217925e-09 -0.6 0) // Vertex ri2b = 22
-    (-0.424264067569663 -0.424264069854194 0) // Vertex ri3b = 23
-    (-0.6 2.15387608435849e-09 0) // Vertex ri4b = 24
-    (-0.424264067569663 0.424264069854194 0) // Vertex ri5b = 25
-    (1.07693804217925e-09 0.6 0) // Vertex ri6b = 26
-    (0.424264069092683 0.424264068331174 0) // Vertex ri7b = 27
-
-    (0.7 0 0) // Vertex Rb0b = 28
-    (0.494974747274797 -0.494974746386369 0) // Vertex Rb1b = 29
-    (1.25642771587579e-09 -0.7 0) // Vertex Rb2b = 30
-    (-0.49497474549794 -0.494974748163226 0) // Vertex Rb3b = 31
-    (-0.7 2.51285543175157e-09 0) // Vertex Rb4b = 32
-    (-0.49497474549794 0.494974748163226 0) // Vertex Rb5b = 33
-    (1.25642771587579e-09 0.7 0) // Vertex Rb6b = 34
-    (0.494974747274797 0.494974746386369 0) // Vertex Rb7b = 35
-
-    (1 0 0) // Vertex R0b = 36
-    (0.707106781821139 -0.707106780551956 0) // Vertex R1b = 37
-    (0.707106781821139 -0.707106780551956 0) // Vertex R1sb = 38
-    (1.79489673696541e-09 -1 0) // Vertex R2b = 39
-    (-0.707106779282772 -0.707106783090323 0) // Vertex R3b = 40
-    (-0.707106779282772 -0.707106783090323 0) // Vertex R3sb = 41
-    (-1 3.58979347393082e-09 0) // Vertex R4b = 42
-    (-0.707106779282772 0.707106783090323 0) // Vertex R5b = 43
-    (-0.707106779282772 0.707106783090323 0) // Vertex R5sb = 44
-    (1.79489673696541e-09 1 0) // Vertex R6b = 45
-    (0.707106781821139 0.707106780551956 0) // Vertex R7b = 46
-    (0.707106781821139 0.707106780551956 0) // Vertex R7sb = 47
-
-    (0.2 0 0.1) // Vertex r0t = 48
-    (0.2 0 0.1) // Vertex r0st = 49
-    (0.141421356364228 -0.141421356110391 0.1) // Vertex r1t = 50
-    (3.58979347393082e-10 -0.2 0.1) // Vertex r2t = 51
-    (3.58979347393082e-10 -0.2 0.1) // Vertex r2st = 52
-    (-0.141421355856554 -0.141421356618065 0.1) // Vertex r3t = 53
-    (-0.2 7.17958694786164e-10 0.1) // Vertex r4t = 54
-    (-0.2 7.17958694786164e-10 0.1) // Vertex r4st = 55
-    (-0.141421355856554 0.141421356618065 0.1) // Vertex r5t = 56
-    (3.58979347393082e-10 0.2 0.1) // Vertex r6t = 57
-    (3.58979347393082e-10 0.2 0.1) // Vertex r6st = 58
-    (0.141421356364228 0.141421356110391 0.1) // Vertex r7t = 59
-
-    (0.5 0 0.1) // Vertex rb0t = 60
-    (0.353553390910569 -0.353553390275978 0.1) // Vertex rb1t = 61
-    (8.97448368482705e-10 -0.5 0.1) // Vertex rb2t = 62
-    (-0.353553389641386 -0.353553391545162 0.1) // Vertex rb3t = 63
-    (-0.5 1.79489673696541e-09 0.1) // Vertex rb4t = 64
-    (-0.353553389641386 0.353553391545162 0.1) // Vertex rb5t = 65
-    (8.97448368482705e-10 0.5 0.1) // Vertex rb6t = 66
-    (0.353553390910569 0.353553390275978 0.1) // Vertex rb7t = 67
-
-    (0.6 0 0.1) // Vertex ri0t = 68
-    (0.424264069092683 -0.424264068331174 0.1) // Vertex ri1t = 69
-    (1.07693804217925e-09 -0.6 0.1) // Vertex ri2t = 70
-    (-0.424264067569663 -0.424264069854194 0.1) // Vertex ri3t = 71
-    (-0.6 2.15387608435849e-09 0.1) // Vertex ri4t = 72
-    (-0.424264067569663 0.424264069854194 0.1) // Vertex ri5t = 73
-    (1.07693804217925e-09 0.6 0.1) // Vertex ri6t = 74
-    (0.424264069092683 0.424264068331174 0.1) // Vertex ri7t = 75
-
-    (0.7 0 0.1) // Vertex Rb0t = 76
-    (0.494974747274797 -0.494974746386369 0.1) // Vertex Rb1t = 77
-    (1.25642771587579e-09 -0.7 0.1) // Vertex Rb2t = 78
-    (-0.49497474549794 -0.494974748163226 0.1) // Vertex Rb3t = 79
-    (-0.7 2.51285543175157e-09 0.1) // Vertex Rb4t = 80
-    (-0.49497474549794 0.494974748163226 0.1) // Vertex Rb5t = 81
-    (1.25642771587579e-09 0.7 0.1) // Vertex Rb6t = 82
-    (0.494974747274797 0.494974746386369 0.1) // Vertex Rb7t = 83
-
-    (1 0 0.1) // Vertex R0t = 84
-    (0.707106781821139 -0.707106780551956 0.1) // Vertex R1t = 85
-    (0.707106781821139 -0.707106780551956 0.1) // Vertex R1st = 86
-    (1.79489673696541e-09 -1 0.1) // Vertex R2t = 87
-    (-0.707106779282772 -0.707106783090323 0.1) // Vertex R3t = 88
-    (-0.707106779282772 -0.707106783090323 0.1) // Vertex R3st = 89
-    (-1 3.58979347393082e-09 0.1) // Vertex R4t = 90
-    (-0.707106779282772 0.707106783090323 0.1) // Vertex R5t = 91
-    (-0.707106779282772 0.707106783090323 0.1) // Vertex R5st = 92
-    (1.79489673696541e-09 1 0.1) // Vertex R6t = 93
-    (0.707106781821139 0.707106780551956 0.1) // Vertex R7t = 94
-    (0.707106781821139 0.707106780551956 0.1) // Vertex R7st = 95
-);
-
-blocks
-(
-    // block0
-    hex (0 2 13 12 48 50 61 60)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (2 4 14 13 50 52 62 61)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (3 5 15 14 51 53 63 62)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (5 7 16 15 53 55 64 63)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (6 8 17 16 54 56 65 64)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (8 10 18 17 56 58 66 65)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (9 11 19 18 57 59 67 66)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (11 1 12 19 59 49 60 67)
-    rotor
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (12 13 21 20 60 61 69 68)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (13 14 22 21 61 62 70 69)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (14 15 23 22 62 63 71 70)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (15 16 24 23 63 64 72 71)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (16 17 25 24 64 65 73 72)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (17 18 26 25 65 66 74 73)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (18 19 27 26 66 67 75 74)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (19 12 20 27 67 60 68 75)
-    rotor
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (20 21 29 28 68 69 77 76)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (21 22 30 29 69 70 78 77)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (22 23 31 30 70 71 79 78)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (23 24 32 31 71 72 80 79)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (24 25 33 32 72 73 81 80)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (25 26 34 33 73 74 82 81)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (26 27 35 34 74 75 83 82)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (27 20 28 35 75 68 76 83)
-    (12 4 1)
-    simpleGrading (1 1 1)
-
-    // block0
-    hex (28 29 38 36 76 77 86 84)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (29 30 39 37 77 78 87 85)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (30 31 41 39 78 79 89 87)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block3
-    hex (31 32 42 40 79 80 90 88)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block4
-    hex (32 33 44 42 80 81 92 90)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block5
-    hex (33 34 45 43 81 82 93 91)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block6
-    hex (34 35 47 45 82 83 95 93)
-    (12 12 1)
-    simpleGrading (1 1 1)
-
-    // block7
-    hex (35 28 36 46 83 76 84 94)
-    (12 12 1)
-    simpleGrading (1 1 1)
-);
-
-edges
-(
-    arc 0 2 (0.184775906536601 -0.0765366863901046 0)
-    arc 2 4 (0.0765366867217582 -0.184775906399226 0)
-    arc 3 5 (-0.0765366860584508 -0.184775906673977 0)
-    arc 5 7 (-0.18477590626185 -0.0765366870534118 0)
-    arc 6 8 (-0.18477590626185 0.0765366870534118 0)
-    arc 8 10 (-0.0765366860584508 0.184775906673977 0)
-    arc 9 11 (0.0765366867217582 0.184775906399226 0)
-    arc 11 1 (0.184775906536601 0.0765366863901046 0)
-
-    arc 12 13 (0.461939766341503 -0.191341715975262 0)
-    arc 13 14 (0.191341716804395 -0.461939765998065 0)
-    arc 14 15 (-0.191341715146127 -0.461939766684942 0)
-    arc 15 16 (-0.461939765654626 -0.19134171763353 0)
-    arc 16 17 (-0.461939765654626 0.19134171763353 0)
-    arc 17 18 (-0.191341715146127 0.461939766684942 0)
-    arc 18 19 (0.191341716804395 0.461939765998065 0)
-    arc 19 12 (0.461939766341503 0.191341715975262 0)
-
-    arc 20 21 (0.554327719609804 -0.229610059170314 0)
-    arc 21 22 (0.229610060165275 -0.554327719197677 0)
-    arc 22 23 (-0.229610058175352 -0.55432772002193 0)
-    arc 23 24 (-0.554327718785551 -0.229610061160235 0)
-    arc 24 25 (-0.554327718785551 0.229610061160235 0)
-    arc 25 26 (-0.229610058175352 0.55432772002193 0)
-    arc 26 27 (0.229610060165275 0.554327719197677 0)
-    arc 27 20 (0.554327719609804 0.229610059170314 0)
-
-    arc 28 29 (0.646715672878104 -0.267878402365366 0)
-    arc 29 30 (0.267878403526154 -0.64671567239729 0)
-    arc 30 31 (-0.267878401204578 -0.646715673358918 0)
-    arc 31 32 (-0.646715671916476 -0.267878404686941 0)
-    arc 32 33 (-0.646715671916476 0.267878404686941 0)
-    arc 33 34 (-0.267878401204578 0.646715673358918 0)
-    arc 34 35 (0.267878403526154 0.64671567239729 0)
-    arc 35 28 (0.646715672878104 0.267878402365366 0)
-
-    arc 36 38 (0.923879532683006 -0.382683431950523 0)
-    arc 37 39 (0.382683433608791 -0.923879531996129 0)
-    arc 39 41 (-0.382683430292254 -0.923879533369883 0)
-    arc 40 42 (-0.923879531309252 -0.382683435267059 0)
-    arc 42 44 (-0.923879531309252 0.382683435267059 0)
-    arc 43 45 (-0.382683430292254 0.923879533369883 0)
-    arc 45 47 (0.382683433608791 0.923879531996129 0)
-    arc 46 36 (0.923879532683006 0.382683431950523 0)
-
-    arc 48 50 (0.184775906536601 -0.0765366863901046 0.1)
-    arc 50 52 (0.0765366867217582 -0.184775906399226 0.1)
-    arc 51 53 (-0.0765366860584508 -0.184775906673977 0.1)
-    arc 53 55 (-0.18477590626185 -0.0765366870534118 0.1)
-    arc 54 56 (-0.18477590626185 0.0765366870534118 0.1)
-    arc 56 58 (-0.0765366860584508 0.184775906673977 0.1)
-    arc 57 59 (0.0765366867217582 0.184775906399226 0.1)
-    arc 59 49 (0.184775906536601 0.0765366863901046 0.1)
-
-    arc 60 61 (0.461939766341503 -0.191341715975262 0.1)
-    arc 61 62 (0.191341716804395 -0.461939765998065 0.1)
-    arc 62 63 (-0.191341715146127 -0.461939766684942 0.1)
-    arc 63 64 (-0.461939765654626 -0.19134171763353 0.1)
-    arc 64 65 (-0.461939765654626 0.19134171763353 0.1)
-    arc 65 66 (-0.191341715146127 0.461939766684942 0.1)
-    arc 66 67 (0.191341716804395 0.461939765998065 0.1)
-    arc 67 60 (0.461939766341503 0.191341715975262 0.1)
-
-    arc 68 69 (0.554327719609804 -0.229610059170314 0.1)
-    arc 69 70 (0.229610060165275 -0.554327719197677 0.1)
-    arc 70 71 (-0.229610058175352 -0.55432772002193 0.1)
-    arc 71 72 (-0.554327718785551 -0.229610061160235 0.1)
-    arc 72 73 (-0.554327718785551 0.229610061160235 0.1)
-    arc 73 74 (-0.229610058175352 0.55432772002193 0.1)
-    arc 74 75 (0.229610060165275 0.554327719197677 0.1)
-    arc 75 68 (0.554327719609804 0.229610059170314 0.1)
-
-    arc 76 77 (0.646715672878104 -0.267878402365366 0.1)
-    arc 77 78 (0.267878403526154 -0.64671567239729 0.1)
-    arc 78 79 (-0.267878401204578 -0.646715673358918 0.1)
-    arc 79 80 (-0.646715671916476 -0.267878404686941 0.1)
-    arc 80 81 (-0.646715671916476 0.267878404686941 0.1)
-    arc 81 82 (-0.267878401204578 0.646715673358918 0.1)
-    arc 82 83 (0.267878403526154 0.64671567239729 0.1)
-    arc 83 76 (0.646715672878104 0.267878402365366 0.1)
-
-    arc 84 86 (0.923879532683006 -0.382683431950523 0.1)
-    arc 85 87 (0.382683433608791 -0.923879531996129 0.1)
-    arc 87 89 (-0.382683430292254 -0.923879533369883 0.1)
-    arc 88 90 (-0.923879531309252 -0.382683435267059 0.1)
-    arc 90 92 (-0.923879531309252 0.382683435267059 0.1)
-    arc 91 93 (-0.382683430292254 0.923879533369883 0.1)
-    arc 93 95 (0.382683433608791 0.923879531996129 0.1)
-    arc 94 84 (0.923879532683006 0.382683431950523 0.1)
-);
-
-patches
-(
-    wall rotor
-    (
-        (0 2 50 48)
-        (2 4 52 50)
-        (3 5 53 51)
-        (5 7 55 53)
-        (6 8 56 54)
-        (8 10 58 56)
-        (9 11 59 57)
-        (11 1 49 59)
-
-        (0 12 60 48)
-        (1 12 60 49)
-
-        (3 14 62 51)
-        (4 14 62 52)
-
-        (6 16 64 54)
-        (7 16 64 55)
-
-        (9 18 66 57)
-        (10 18 66 58)
-    )
-
-    wall stator
-    (
-        (36 38 86 84)
-        (37 39 87 85)
-        (39 41 89 87)
-        (40 42 90 88)
-        (42 44 92 90)
-        (43 45 93 91)
-        (45 47 95 93)
-        (46 36 84 94)
-
-        (37 29 77 85)
-        (38 29 77 86)
-
-        (40 31 79 88)
-        (41 31 79 89)
-
-        (43 33 81 91)
-        (44 33 81 92)
-
-        (46 35 83 94)
-        (47 35 83 95)
-    )
-
-    empty front
-    (
-        (48 50 61 60)
-        (50 52 62 61)
-        (51 53 63 62)
-        (53 55 64 63)
-        (54 56 65 64)
-        (56 58 66 65)
-        (57 59 67 66)
-        (59 49 60 67)
-        (60 61 69 68)
-        (61 62 70 69)
-        (62 63 71 70)
-        (63 64 72 71)
-        (64 65 73 72)
-        (65 66 74 73)
-        (66 67 75 74)
-        (67 60 68 75)
-        (68 69 77 76)
-        (69 70 78 77)
-        (70 71 79 78)
-        (71 72 80 79)
-        (72 73 81 80)
-        (73 74 82 81)
-        (74 75 83 82)
-        (75 68 76 83)
-        (76 77 86 84)
-        (77 78 87 85)
-        (78 79 89 87)
-        (79 80 90 88)
-        (80 81 92 90)
-        (81 82 93 91)
-        (82 83 95 93)
-        (83 76 84 94)
-    )
-
-    empty back
-    (
-        (0 12 13 2)
-        (2 13 14 4)
-        (3 14 15 5)
-        (5 15 16 7)
-        (6 16 17 8)
-        (8 17 18 10)
-        (9 18 19 11)
-        (11 19 12 1)
-        (12 20 21 13)
-        (13 21 22 14)
-        (14 22 23 15)
-        (15 23 24 16)
-        (16 24 25 17)
-        (17 25 26 18)
-        (18 26 27 19)
-        (19 27 20 12)
-        (20 28 29 21)
-        (21 29 30 22)
-        (22 30 31 23)
-        (23 31 32 24)
-        (24 32 33 25)
-        (25 33 34 26)
-        (26 34 35 27)
-        (27 35 28 20)
-        (28 36 38 29)
-        (29 37 39 30)
-        (30 39 41 31)
-        (31 40 42 32)
-        (32 42 44 33)
-        (33 43 45 34)
-        (34 45 47 35)
-        (35 46 36 28)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/cavitatingFoam/les/throttle/constant/polyMesh/boundary b/tutorials/multiphase/cavitatingFoam/les/throttle/constant/polyMesh/boundary
index 999c16bc8e26ed46ecbb925d88ba148ca59dce11..01fdac64572dc94daa716c6c190832921cefc194 100644
--- a/tutorials/multiphase/cavitatingFoam/les/throttle/constant/polyMesh/boundary
+++ b/tutorials/multiphase/cavitatingFoam/les/throttle/constant/polyMesh/boundary
@@ -21,25 +21,25 @@ FoamFile
     {
         type            patch;
         nFaces          51;
-        startFace       15151;
+        startFace       57362;
     }
     outlet
     {
         type            patch;
         nFaces          51;
-        startFace       15202;
+        startFace       57413;
     }
     walls
     {
         type            wall;
-        nFaces          436;
-        startFace       15253;
+        nFaces          836;
+        startFace       57464;
     }
     frontBack
     {
         type            empty;
-        nFaces          15420;
-        startFace       15689;
+        nFaces          57540;
+        startFace       58300;
     }
 )
 
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/constant/polyMesh/blockMeshDict
deleted file mode 100644
index b3c363e44842e64b09d6705989df95b09c7652b9..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,143 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General m4 macros
-
-  
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// User-defined parameters
-
-convertToMeters 1;
-
-      // Length of tank (x-direction)
-       // Breadth of tank (y-direction)
-       // Depth of tank (z-direction)
-
-      // Depth to the top (height) of lower chamfer
-     // Height of upper chamfer
-
- // Angle of lower chamfer to the horizontal
- // Angle of upper chamfer to the horizontal
-
-  // Centre of gravity in y-direction
-         // Centre of gravity in z-direction
-
-       // Number of cells in the length (1 for 2D)
-      // Number of cells in the breadth
-     // Number of cells in the height of the lower champfer
-      // Number of cells in the height between the chamfers
-    // Number of cells in the height of the upper champfer
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Derived parameters
-
- // Breadth to the top (height) of lower chamfer
- // Breadth of upper chamfer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Parametric description
-
-vertices
-(
-    (-0.5 -15 -10.0) // Vertex bllcb = 0 
-    (-0.5 -20 -5)  // Vertex bllc = 1 
-    (-0.5 -20 10)  // Vertex bluc = 2 
-    (-0.5 -10 20) // Vertex bluct = 3 
-    (-0.5 15 -10.0) // Vertex brlcb = 4 
-    (-0.5 20 -5)  // Vertex brlc = 5 
-    (-0.5 20 10)  // Vertex bruc = 6 
-    (-0.5 10 20) // Vertex bruct = 7 
-
-    (0.5 -15 -10.0) // Vertex fllcb = 8 
-    (0.5 -20 -5)  // Vertex fllc = 9 
-    (0.5 -20 10)  // Vertex fluc = 10 
-    (0.5 -10 20) // Vertex fluct = 11 
-    (0.5 15 -10.0) // Vertex frlcb = 12 
-    (0.5 20 -5)  // Vertex frlc = 13 
-    (0.5 20 10)  // Vertex fruc = 14 
-    (0.5 10 20) // Vertex fruct = 15 
-);
-
-blocks
-(
-    // block0
-    hex (0 4 5 1 8 12 13 9)
-    (40 6 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (1 5 6 2 9 13 14 10)
-    (40 16 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (2 6 7 3 10 14 15 11)
-    (40 12 1)
-    simpleGrading (1 1 1)
-);
-
-patches
-(
-    patch walls
-    (
-        (0 4 12 8)
-        (4 5 13 12)
-        (5 6 14 13)
-        (6 7 15 14)
-        (7 3 11 15)
-        (3 2 10 11)
-        (2 1 9 10)
-        (1 0 8 9)
-    )
-
-    empty front
-    (
-        (8 12 13 9)
-        (9 13 14 10)
-        (10 14 15 11)
-    )
-
-    empty back
-    (
-        (0 1 5 4)
-        (1 2 6 5)
-        (2 3 7 6)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/constant/polyMesh/blockMeshDict
deleted file mode 100644
index b3c363e44842e64b09d6705989df95b09c7652b9..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank2D3DoF/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,143 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General m4 macros
-
-  
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// User-defined parameters
-
-convertToMeters 1;
-
-      // Length of tank (x-direction)
-       // Breadth of tank (y-direction)
-       // Depth of tank (z-direction)
-
-      // Depth to the top (height) of lower chamfer
-     // Height of upper chamfer
-
- // Angle of lower chamfer to the horizontal
- // Angle of upper chamfer to the horizontal
-
-  // Centre of gravity in y-direction
-         // Centre of gravity in z-direction
-
-       // Number of cells in the length (1 for 2D)
-      // Number of cells in the breadth
-     // Number of cells in the height of the lower champfer
-      // Number of cells in the height between the chamfers
-    // Number of cells in the height of the upper champfer
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Derived parameters
-
- // Breadth to the top (height) of lower chamfer
- // Breadth of upper chamfer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Parametric description
-
-vertices
-(
-    (-0.5 -15 -10.0) // Vertex bllcb = 0 
-    (-0.5 -20 -5)  // Vertex bllc = 1 
-    (-0.5 -20 10)  // Vertex bluc = 2 
-    (-0.5 -10 20) // Vertex bluct = 3 
-    (-0.5 15 -10.0) // Vertex brlcb = 4 
-    (-0.5 20 -5)  // Vertex brlc = 5 
-    (-0.5 20 10)  // Vertex bruc = 6 
-    (-0.5 10 20) // Vertex bruct = 7 
-
-    (0.5 -15 -10.0) // Vertex fllcb = 8 
-    (0.5 -20 -5)  // Vertex fllc = 9 
-    (0.5 -20 10)  // Vertex fluc = 10 
-    (0.5 -10 20) // Vertex fluct = 11 
-    (0.5 15 -10.0) // Vertex frlcb = 12 
-    (0.5 20 -5)  // Vertex frlc = 13 
-    (0.5 20 10)  // Vertex fruc = 14 
-    (0.5 10 20) // Vertex fruct = 15 
-);
-
-blocks
-(
-    // block0
-    hex (0 4 5 1 8 12 13 9)
-    (40 6 1)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (1 5 6 2 9 13 14 10)
-    (40 16 1)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (2 6 7 3 10 14 15 11)
-    (40 12 1)
-    simpleGrading (1 1 1)
-);
-
-patches
-(
-    patch walls
-    (
-        (0 4 12 8)
-        (4 5 13 12)
-        (5 6 14 13)
-        (6 7 15 14)
-        (7 3 11 15)
-        (3 2 10 11)
-        (2 1 9 10)
-        (1 0 8 9)
-    )
-
-    empty front
-    (
-        (8 12 13 9)
-        (9 13 14 10)
-        (10 14 15 11)
-    )
-
-    empty back
-    (
-        (0 1 5 4)
-        (1 2 6 5)
-        (2 3 7 6)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/constant/polyMesh/blockMeshDict
deleted file mode 100644
index e0e276608f5aa2cef8f0c9b7a1593ce7d3f631be..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,135 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General m4 macros
-
-  
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// User-defined parameters
-
-convertToMeters 1;
-
-       // Length of tank (x-direction)
-       // Breadth of tank (y-direction)
-       // Depth of tank (z-direction)
-
-      // Depth to the top (height) of lower chamfer
-     // Height of upper chamfer
-
- // Angle of lower chamfer to the horizontal
- // Angle of upper chamfer to the horizontal
-
-  // Centre of gravity in y-direction
-         // Centre of gravity in z-direction
-
-      // Number of cells in the length (1 for 2D)
-      // Number of cells in the breadth
-     // Number of cells in the height of the lower champfer
-      // Number of cells in the height between the chamfers
-    // Number of cells in the height of the upper champfer
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Derived parameters
-
- // Breadth to the top (height) of lower chamfer
- // Breadth of upper chamfer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Parametric description
-
-vertices
-(
-    (-10 -15 -10.0) // Vertex bllcb = 0 
-    (-10 -20 -5)  // Vertex bllc = 1 
-    (-10 -20 10)  // Vertex bluc = 2 
-    (-10 -10 20) // Vertex bluct = 3 
-    (-10 15 -10.0) // Vertex brlcb = 4 
-    (-10 20 -5)  // Vertex brlc = 5 
-    (-10 20 10)  // Vertex bruc = 6 
-    (-10 10 20) // Vertex bruct = 7 
-
-    (10 -15 -10.0) // Vertex fllcb = 8 
-    (10 -20 -5)  // Vertex fllc = 9 
-    (10 -20 10)  // Vertex fluc = 10 
-    (10 -10 20) // Vertex fluct = 11 
-    (10 15 -10.0) // Vertex frlcb = 12 
-    (10 20 -5)  // Vertex frlc = 13 
-    (10 20 10)  // Vertex fruc = 14 
-    (10 10 20) // Vertex fruct = 15 
-);
-
-blocks
-(
-    // block0
-    hex (0 4 5 1 8 12 13 9)
-    (40 6 19)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (1 5 6 2 9 13 14 10)
-    (40 16 19)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (2 6 7 3 10 14 15 11)
-    (40 12 19)
-    simpleGrading (1 1 1)
-);
-
-patches
-(
-    patch walls
-    (
-        (0 4 12 8)
-        (4 5 13 12)
-        (5 6 14 13)
-        (6 7 15 14)
-        (7 3 11 15)
-        (3 2 10 11)
-        (2 1 9 10)
-        (1 0 8 9)
-        (8 12 13 9)
-        (9 13 14 10)
-        (10 14 15 11)
-        (0 1 5 4)
-        (1 2 6 5)
-        (2 3 7 6)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/constant/polyMesh/blockMeshDict
deleted file mode 100644
index e0e276608f5aa2cef8f0c9b7a1593ce7d3f631be..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D3DoF/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,135 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General m4 macros
-
-  
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// User-defined parameters
-
-convertToMeters 1;
-
-       // Length of tank (x-direction)
-       // Breadth of tank (y-direction)
-       // Depth of tank (z-direction)
-
-      // Depth to the top (height) of lower chamfer
-     // Height of upper chamfer
-
- // Angle of lower chamfer to the horizontal
- // Angle of upper chamfer to the horizontal
-
-  // Centre of gravity in y-direction
-         // Centre of gravity in z-direction
-
-      // Number of cells in the length (1 for 2D)
-      // Number of cells in the breadth
-     // Number of cells in the height of the lower champfer
-      // Number of cells in the height between the chamfers
-    // Number of cells in the height of the upper champfer
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Derived parameters
-
- // Breadth to the top (height) of lower chamfer
- // Breadth of upper chamfer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Parametric description
-
-vertices
-(
-    (-10 -15 -10.0) // Vertex bllcb = 0 
-    (-10 -20 -5)  // Vertex bllc = 1 
-    (-10 -20 10)  // Vertex bluc = 2 
-    (-10 -10 20) // Vertex bluct = 3 
-    (-10 15 -10.0) // Vertex brlcb = 4 
-    (-10 20 -5)  // Vertex brlc = 5 
-    (-10 20 10)  // Vertex bruc = 6 
-    (-10 10 20) // Vertex bruct = 7 
-
-    (10 -15 -10.0) // Vertex fllcb = 8 
-    (10 -20 -5)  // Vertex fllc = 9 
-    (10 -20 10)  // Vertex fluc = 10 
-    (10 -10 20) // Vertex fluct = 11 
-    (10 15 -10.0) // Vertex frlcb = 12 
-    (10 20 -5)  // Vertex frlc = 13 
-    (10 20 10)  // Vertex fruc = 14 
-    (10 10 20) // Vertex fruct = 15 
-);
-
-blocks
-(
-    // block0
-    hex (0 4 5 1 8 12 13 9)
-    (40 6 19)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (1 5 6 2 9 13 14 10)
-    (40 16 19)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (2 6 7 3 10 14 15 11)
-    (40 12 19)
-    simpleGrading (1 1 1)
-);
-
-patches
-(
-    patch walls
-    (
-        (0 4 12 8)
-        (4 5 13 12)
-        (5 6 14 13)
-        (6 7 15 14)
-        (7 3 11 15)
-        (3 2 10 11)
-        (2 1 9 10)
-        (1 0 8 9)
-        (8 12 13 9)
-        (9 13 14 10)
-        (10 14 15 11)
-        (0 1 5 4)
-        (1 2 6 5)
-        (2 3 7 6)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/constant/polyMesh/blockMeshDict b/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/constant/polyMesh/blockMeshDict
deleted file mode 100644
index e0e276608f5aa2cef8f0c9b7a1593ce7d3f631be..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interDyMFoam/ras/sloshingTank3D6DoF/constant/polyMesh/blockMeshDict
+++ /dev/null
@@ -1,135 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       dictionary;
-    object      blockMeshDict;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// General m4 macros
-
-  
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// User-defined parameters
-
-convertToMeters 1;
-
-       // Length of tank (x-direction)
-       // Breadth of tank (y-direction)
-       // Depth of tank (z-direction)
-
-      // Depth to the top (height) of lower chamfer
-     // Height of upper chamfer
-
- // Angle of lower chamfer to the horizontal
- // Angle of upper chamfer to the horizontal
-
-  // Centre of gravity in y-direction
-         // Centre of gravity in z-direction
-
-      // Number of cells in the length (1 for 2D)
-      // Number of cells in the breadth
-     // Number of cells in the height of the lower champfer
-      // Number of cells in the height between the chamfers
-    // Number of cells in the height of the upper champfer
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Derived parameters
-
- // Breadth to the top (height) of lower chamfer
- // Breadth of upper chamfer
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-// Parametric description
-
-vertices
-(
-    (-10 -15 -10.0) // Vertex bllcb = 0 
-    (-10 -20 -5)  // Vertex bllc = 1 
-    (-10 -20 10)  // Vertex bluc = 2 
-    (-10 -10 20) // Vertex bluct = 3 
-    (-10 15 -10.0) // Vertex brlcb = 4 
-    (-10 20 -5)  // Vertex brlc = 5 
-    (-10 20 10)  // Vertex bruc = 6 
-    (-10 10 20) // Vertex bruct = 7 
-
-    (10 -15 -10.0) // Vertex fllcb = 8 
-    (10 -20 -5)  // Vertex fllc = 9 
-    (10 -20 10)  // Vertex fluc = 10 
-    (10 -10 20) // Vertex fluct = 11 
-    (10 15 -10.0) // Vertex frlcb = 12 
-    (10 20 -5)  // Vertex frlc = 13 
-    (10 20 10)  // Vertex fruc = 14 
-    (10 10 20) // Vertex fruct = 15 
-);
-
-blocks
-(
-    // block0
-    hex (0 4 5 1 8 12 13 9)
-    (40 6 19)
-    simpleGrading (1 1 1)
-
-    // block1
-    hex (1 5 6 2 9 13 14 10)
-    (40 16 19)
-    simpleGrading (1 1 1)
-
-    // block2
-    hex (2 6 7 3 10 14 15 11)
-    (40 12 19)
-    simpleGrading (1 1 1)
-);
-
-patches
-(
-    patch walls
-    (
-        (0 4 12 8)
-        (4 5 13 12)
-        (5 6 14 13)
-        (6 7 15 14)
-        (7 3 11 15)
-        (3 2 10 11)
-        (2 1 9 10)
-        (1 0 8 9)
-        (8 12 13 9)
-        (9 13 14 10)
-        (10 14 15 11)
-        (0 1 5 4)
-        (1 2 6 5)
-        (2 3 7 6)
-    )
-);
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/alpha1 b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/alpha1
deleted file mode 100644
index 3b7713537191f4b2e7675008deb552d4ea4dc959..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/0/alpha1
+++ /dev/null
@@ -1,1285 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       volScalarField;
-    location    "0";
-    object      alpha1;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-dimensions      [0 0 0 0 0 0 0];
-
-internalField   nonuniform List<scalar>
-1250
-(
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1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
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-)
-;
-
-boundaryField
-{
-    walls
-    {
-        type            zeroGradient;
-    }
-}
-
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/Allclean b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/Allclean
index 4b3e979c4a186c0aacc698997691a0ba604c672e..82e093ec03dc36c50fb1281de4b51bf917537199 100755
--- a/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/Allclean
+++ b/tutorials/multiphase/interDyMFoam/ras/testTubeMixer/Allclean
@@ -1,7 +1,10 @@
 #!/bin/sh
 cd ${0%/*} || exit 1    # run from this directory
 
-foamCleanTutorials cases
-rm -rf 0/alpha1.gz
+# Source tutorial clean functions
+. $WM_PROJECT_DIR/bin/tools/CleanFunctions
+
+cleanCase
+rm -rf 0/alpha1
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/multiphase/interFoam/laminar/capillaryRise/0/alpha1 b/tutorials/multiphase/interFoam/laminar/capillaryRise/0/alpha1
deleted file mode 100644
index 92c874244a509e69d813dd66d50dea48b1b7beb6..0000000000000000000000000000000000000000
--- a/tutorials/multiphase/interFoam/laminar/capillaryRise/0/alpha1
+++ /dev/null
@@ -1,8856 +0,0 @@
-/*--------------------------------*- C++ -*----------------------------------*\
-| =========                 |                                                 |
-| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
-|  \\    /   O peration     | Version:  dev                                   |
-|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
-|    \\/     M anipulation  |                                                 |
-\*---------------------------------------------------------------------------*/
-FoamFile
-{
-    version     2.0;
-    format      ascii;
-    class       volScalarField;
-    location    "0";
-    object      alpha1;
-}
-// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-
-dimensions      [0 0 0 0 0 0 0];
-
-internalField   nonuniform List<scalar>
-8000
-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-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-)
-;
-
-boundaryField
-{
-    inlet
-    {
-        type            inletOutlet;
-        inletValue      uniform 1;
-        value           uniform 1;
-    }
-    atmosphere
-    {
-        type            zeroGradient;
-    }
-    walls
-    {
-        type            constantAlphaContactAngle;
-        theta0          45;
-        limit           gradient;
-        value           nonuniform List<scalar>
-800
-(
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1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-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-1
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-0
-)
-;
-    }
-    frontAndBack
-    {
-        type            empty;
-    }
-}
-
-
-// ************************************************************************* //
diff --git a/tutorials/multiphase/interFoam/les/nozzleFlow2D/Allclean b/tutorials/multiphase/interFoam/les/nozzleFlow2D/Allclean
index cb4e2bd79201e5994ab07f6378c74dbad278b54d..e7f7e3082b5697003b474184e8cdb785ccaee963 100755
--- a/tutorials/multiphase/interFoam/les/nozzleFlow2D/Allclean
+++ b/tutorials/multiphase/interFoam/les/nozzleFlow2D/Allclean
@@ -5,6 +5,7 @@ cd ${0%/*} || exit 1    # run from this directory
 . $WM_PROJECT_DIR/bin/tools/CleanFunctions
 
 cleanCase
+rm system/topoSetDict > /dev/null 2>&1
 cp constant/polyMesh/boundary.org constant/polyMesh/boundary
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/polyMesh/boundary b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/polyMesh/boundary
index b3860525e86f797c144f1d2afbb1bb66ae4710fa..6d438fa52b4c52beadf6a7f0563f512328656dda 100644
--- a/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/polyMesh/boundary
+++ b/tutorials/multiphase/interPhaseChangeFoam/cavitatingBullet/constant/polyMesh/boundary
@@ -38,7 +38,7 @@ FoamFile
     bullet
     {
         type            wall;
-        nFaces          56218;
+        nFaces          37896;
         startFace       1133431;
     }
 )