From 897baf81c0fe1bd799941e31fd5ca53637c09d3a Mon Sep 17 00:00:00 2001
From: Mark Olesen <Mark.Olesen@Germany>
Date: Thu, 17 Sep 2009 23:45:52 +0200
Subject: [PATCH] blockMesh: most mesh data are now demand-driven

- Unless the points(), cells(), patches() methods are called, the classes
  should know maintain a lightweight representation for as long as possible.

- bugfix: old-code used xferMove() instead of xferCopy() when creating the
  topology mesh - causing const pointField& to break if the code order was
  changed

- relocate blockMesh from src/meshing -> src/mesh
---
 .../mesh/generation/blockMesh/Make/options    |  2 +-
 .../mesh/generation/blockMesh/blockMeshApp.C  | 35 ++++++-
 .../foamDebugSwitches/Make/options            |  3 +-
 src/Allwmake                                  |  1 +
 src/{meshing => mesh}/Allwmake                |  0
 src/{meshing => mesh}/blockMesh/Make/files    |  7 +-
 src/{meshing => mesh}/blockMesh/Make/options  |  0
 src/{meshing => mesh}/blockMesh/block/block.C | 50 ++++++----
 src/{meshing => mesh}/blockMesh/block/block.H | 42 +++++---
 .../blockMesh/block/blockCreate.C             | 92 ++++++++++--------
 .../blockMesh/block/blockList.H               |  0
 .../blockDescriptor/blockDescriptor.C         | 21 ++--
 .../blockDescriptor/blockDescriptor.H         | 18 +++-
 .../blockDescriptor/blockDescriptorEdges.C    |  3 +-
 .../blockMesh/blockMesh/blockMesh.C           | 67 +++++++------
 .../blockMesh/blockMesh/blockMesh.H           | 63 ++++++------
 .../blockMesh/blockMesh/blockMeshCheck.C      | 14 +--
 .../blockMesh/blockMesh/blockMeshCreate.C}    | 94 ++++++++++++++++--
 .../blockMesh/blockMesh/blockMeshMerge.C}     | 96 +++++++++++--------
 .../blockMesh/blockMesh/blockMeshTopology.C   | 82 +++++++++-------
 .../blockMesh/curvedEdges/BSpline.C           |  0
 .../blockMesh/curvedEdges/BSpline.H           |  0
 .../blockMesh/curvedEdges/arcEdge.C           |  0
 .../blockMesh/curvedEdges/arcEdge.H           |  0
 .../blockMesh/curvedEdges/curvedEdge.C        |  0
 .../blockMesh/curvedEdges/curvedEdge.H        |  0
 .../blockMesh/curvedEdges/curvedEdgeList.H    |  0
 .../blockMesh/curvedEdges/lineDivide.C        |  0
 .../blockMesh/curvedEdges/lineDivide.H        |  0
 .../blockMesh/curvedEdges/lineEdge.C          |  0
 .../blockMesh/curvedEdges/lineEdge.H          |  0
 .../blockMesh/curvedEdges/polyLine.C          |  0
 .../blockMesh/curvedEdges/polyLine.H          |  0
 .../blockMesh/curvedEdges/polyLineEdge.C      |  0
 .../blockMesh/curvedEdges/polyLineEdge.H      |  0
 .../blockMesh/curvedEdges/polySplineEdge.C    |  0
 .../blockMesh/curvedEdges/polySplineEdge.H    |  0
 .../blockMesh/curvedEdges/simpleSplineEdge.C  |  0
 .../blockMesh/curvedEdges/simpleSplineEdge.H  |  0
 .../blockMesh/curvedEdges/spline.C            |  0
 .../blockMesh/curvedEdges/spline.H            |  0
 .../blockMesh/blockMesh/blockMeshCells.C      | 73 --------------
 .../blockMesh/blockMesh/blockMeshOffsets.C    | 57 -----------
 .../blockMesh/blockMesh/blockMeshPoints.C     | 68 -------------
 44 files changed, 456 insertions(+), 432 deletions(-)
 rename src/{meshing => mesh}/Allwmake (100%)
 rename src/{meshing => mesh}/blockMesh/Make/files (76%)
 rename src/{meshing => mesh}/blockMesh/Make/options (100%)
 rename src/{meshing => mesh}/blockMesh/block/block.C (77%)
 rename src/{meshing => mesh}/blockMesh/block/block.H (79%)
 rename src/{meshing => mesh}/blockMesh/block/blockCreate.C (88%)
 rename src/{meshing => mesh}/blockMesh/block/blockList.H (100%)
 rename src/{meshing => mesh}/blockMesh/blockDescriptor/blockDescriptor.C (94%)
 rename src/{meshing => mesh}/blockMesh/blockDescriptor/blockDescriptor.H (93%)
 rename src/{meshing => mesh}/blockMesh/blockDescriptor/blockDescriptorEdges.C (98%)
 rename src/{meshing => mesh}/blockMesh/blockMesh/blockMesh.C (74%)
 rename src/{meshing => mesh}/blockMesh/blockMesh/blockMesh.H (77%)
 rename src/{meshing => mesh}/blockMesh/blockMesh/blockMeshCheck.C (94%)
 rename src/{meshing/blockMesh/blockMesh/blockMeshPatches.C => mesh/blockMesh/blockMesh/blockMeshCreate.C} (70%)
 rename src/{meshing/blockMesh/blockMesh/blockMeshMergeList.C => mesh/blockMesh/blockMesh/blockMeshMerge.C} (87%)
 rename src/{meshing => mesh}/blockMesh/blockMesh/blockMeshTopology.C (81%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/BSpline.C (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/BSpline.H (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/arcEdge.C (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/arcEdge.H (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/curvedEdge.C (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/curvedEdge.H (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/curvedEdgeList.H (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/lineDivide.C (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/lineDivide.H (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/lineEdge.C (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/lineEdge.H (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/polyLine.C (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/polyLine.H (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/polyLineEdge.C (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/polyLineEdge.H (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/polySplineEdge.C (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/polySplineEdge.H (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/simpleSplineEdge.C (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/simpleSplineEdge.H (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/spline.C (100%)
 rename src/{meshing => mesh}/blockMesh/curvedEdges/spline.H (100%)
 delete mode 100644 src/meshing/blockMesh/blockMesh/blockMeshCells.C
 delete mode 100644 src/meshing/blockMesh/blockMesh/blockMeshOffsets.C
 delete mode 100644 src/meshing/blockMesh/blockMesh/blockMeshPoints.C

diff --git a/applications/utilities/mesh/generation/blockMesh/Make/options b/applications/utilities/mesh/generation/blockMesh/Make/options
index abb7181f138..2e07c477da8 100644
--- a/applications/utilities/mesh/generation/blockMesh/Make/options
+++ b/applications/utilities/mesh/generation/blockMesh/Make/options
@@ -1,5 +1,5 @@
 EXE_INC = \
-    -I$(LIB_SRC)/meshing/blockMesh/lnInclude \
+    -I$(LIB_SRC)/mesh/blockMesh/lnInclude \
     -I$(LIB_SRC)/meshTools/lnInclude \
     -I$(LIB_SRC)/dynamicMesh/lnInclude
 
diff --git a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C
index 73c1e783c05..501b45c132a 100644
--- a/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C
+++ b/applications/utilities/mesh/generation/blockMesh/blockMeshApp.C
@@ -203,6 +203,7 @@ int main(int argc, char *argv[])
     word defaultFacesType = emptyPolyPatch::typeName;
     wordList patchPhysicalTypes = blocks.patchPhysicalTypes();
 
+
     preservePatchTypes
     (
         runTime,
@@ -338,7 +339,7 @@ int main(int argc, char *argv[])
     // Set the precision of the points data to 10
     IOstream::defaultPrecision(10);
 
-    Info << nl << "Writing polyMesh" << endl;
+    Info<< nl << "Writing polyMesh" << endl;
     mesh.removeFiles();
     if (!mesh.write())
     {
@@ -347,6 +348,38 @@ int main(int argc, char *argv[])
             << exit(FatalError);
     }
 
+
+    //
+    // write some information
+    //
+    {
+        const polyPatchList& patches = mesh.boundaryMesh();
+
+        Info<< "----------------" << nl
+            << "Mesh Information" << nl
+            << "----------------" << nl
+            << "  " << "boundingBox: " << boundBox(mesh.points()) << nl
+            << "  " << "nPoints: " << mesh.nPoints() << nl
+            << "  " << "nCells: " << mesh.nCells() << nl
+            << "  " << "nFaces: " << mesh.nFaces() << nl
+            << "  " << "nInternalFaces: " << mesh.nInternalFaces() << nl;
+
+        Info<< "----------------" << nl
+            << "Patches" << nl
+            << "----------------" << nl;
+
+        forAll(patches, patchI)
+        {
+            const polyPatch& p = patches[patchI];
+
+            Info<< "  " << "patch " << patchI
+                << " (start: " << p.start()
+                << " size: " << p.size()
+                << ") name: " << p.name()
+                << nl;
+        }
+    }
+
     Info<< nl << "End" << endl;
 
     return 0;
diff --git a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options
index ed65d154376..421e59a7f14 100644
--- a/applications/utilities/miscellaneous/foamDebugSwitches/Make/options
+++ b/applications/utilities/miscellaneous/foamDebugSwitches/Make/options
@@ -39,4 +39,5 @@ EXE_LIBS = \
     -lthermophysicalFunctions \
     -ltopoChangerFvMesh \
     -ltriSurface \
-    -lautoMesh
+    -lautoMesh \
+    -lblockMesh
diff --git a/src/Allwmake b/src/Allwmake
index ebef2d8d0d1..acbc2c3f0f6 100755
--- a/src/Allwmake
+++ b/src/Allwmake
@@ -51,6 +51,7 @@ lagrangian/Allwmake
 postProcessing/Allwmake
 conversion/Allwmake
 
+mesh/Allwmake
 wmake libso autoMesh
 wmake libso errorEstimation
 
diff --git a/src/meshing/Allwmake b/src/mesh/Allwmake
similarity index 100%
rename from src/meshing/Allwmake
rename to src/mesh/Allwmake
diff --git a/src/meshing/blockMesh/Make/files b/src/mesh/blockMesh/Make/files
similarity index 76%
rename from src/meshing/blockMesh/Make/files
rename to src/mesh/blockMesh/Make/files
index ca3f2670d7b..cc7a1c1bb5f 100644
--- a/src/meshing/blockMesh/Make/files
+++ b/src/mesh/blockMesh/Make/files
@@ -16,12 +16,9 @@ block/block.C
 block/blockCreate.C
 
 blockMesh/blockMesh.C
-blockMesh/blockMeshCells.C
-blockMesh/blockMeshPatches.C
-blockMesh/blockMeshPoints.C
+blockMesh/blockMeshCreate.C
 blockMesh/blockMeshTopology.C
 blockMesh/blockMeshCheck.C
-blockMesh/blockMeshOffsets.C
-blockMesh/blockMeshMergeList.C
+blockMesh/blockMeshMerge.C
 
 LIB = $(FOAM_LIBBIN)/libblockMesh
diff --git a/src/meshing/blockMesh/Make/options b/src/mesh/blockMesh/Make/options
similarity index 100%
rename from src/meshing/blockMesh/Make/options
rename to src/mesh/blockMesh/Make/options
diff --git a/src/meshing/blockMesh/block/block.C b/src/mesh/blockMesh/block/block.C
similarity index 77%
rename from src/meshing/blockMesh/block/block.C
rename to src/mesh/blockMesh/block/block.C
index 0fe19e2ba7d..094b592bd5e 100644
--- a/src/meshing/blockMesh/block/block.C
+++ b/src/mesh/blockMesh/block/block.C
@@ -27,52 +27,68 @@ License
 #include "error.H"
 #include "block.H"
 
-
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
 Foam::block::block
 (
-    const pointField& blockMeshPoints,
+    const pointField& blockPointField,
     const curvedEdgeList& edges,
     Istream& is
 )
 :
-    blockDescriptor(blockMeshPoints, edges, is),
-    vertices_(nPoints()),
-    cells_(nCells()),
-    boundaryPatches_(6)
-{
-    createPrimitives();
-}
+    blockDescriptor(blockPointField, edges, is),
+    vertices_(0),
+    cells_(0),
+    boundaryPatches_(0)
+{}
 
 
-Foam::block::block(const blockDescriptor& definition)
+Foam::block::block(const blockDescriptor& blockDesc)
 :
-    blockDescriptor(definition),
-    vertices_(nPoints()),
-    cells_(nCells()),
-    boundaryPatches_(6)
-{
-    createPrimitives();
-}
+    blockDescriptor(blockDesc),
+    vertices_(0),
+    cells_(0),
+    boundaryPatches_(0)
+{}
+
+
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
+Foam::block::~block()
+{}
 
 
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 const Foam::pointField& Foam::block::points() const
 {
+    if (vertices_.empty())
+    {
+        createPoints();
+    }
+
     return vertices_;
 }
 
 
 const Foam::labelListList& Foam::block::cells() const
 {
+    if (cells_.empty())
+    {
+        createCells();
+    }
+
     return cells_;
 }
 
 
 const Foam::labelListListList& Foam::block::boundaryPatches() const
 {
+    if (boundaryPatches_.empty())
+    {
+        createBoundary();
+    }
+
     return boundaryPatches_;
 }
 
diff --git a/src/meshing/blockMesh/block/block.H b/src/mesh/blockMesh/block/block.H
similarity index 79%
rename from src/meshing/blockMesh/block/block.H
rename to src/mesh/blockMesh/block/block.H
index a53a067c604..943d38bdfc6 100644
--- a/src/meshing/blockMesh/block/block.H
+++ b/src/mesh/blockMesh/block/block.H
@@ -29,6 +29,9 @@ Description
     Creates a single block of cells from point coordinates, numbers of
     cells in each direction and an expansion ratio.
 
+Note
+    The vertices and cells for filling the block are demand-driven.
+
 SourceFiles
     block.C
     blockCreate.C
@@ -51,6 +54,10 @@ namespace Foam
 class Istream;
 class Ostream;
 
+// Forward declaration of friend functions and operators
+class block;
+Ostream& operator<<(Ostream&, const block&);
+
 /*---------------------------------------------------------------------------*\
                            Class block Declaration
 \*---------------------------------------------------------------------------*/
@@ -62,13 +69,13 @@ class block
     // Private data
 
         //- List of vertices
-        pointField vertices_;
+        mutable pointField vertices_;
 
         //- List of cells
-        labelListList cells_;
+        mutable labelListList cells_;
 
         //- Boundary patches
-        labelListListList boundaryPatches_;
+        mutable labelListListList boundaryPatches_;
 
 
     // Private Member Functions
@@ -76,17 +83,14 @@ class block
         //- Vertex label offset for a particular i,j,k position
         label vtxLabel(label i, label j, label k) const;
 
-        //- Creates vertices for cells filling the block.
-        void createPoints();
+        //- Creates vertices for cells filling the block
+        void createPoints() const;
 
-        //- Creates cells for the block.
-        void createCells();
+        //- Creates cells for filling the block
+        void createCells() const;
 
-        //- Creates boundary patches for the block
-        void createBoundary();
-
-        //- Creates vertices, cells, boundary patches for the block
-        void createPrimitives();
+        //- Creates boundary patch faces for the block
+        void createBoundary() const;
 
         //- Disallow default bitwise copy construct
         block(const block&);
@@ -101,7 +105,7 @@ public:
         //- Construct from components with Istream
         block
         (
-            const pointField& blockMeshPoints,
+            const pointField& blockPointField,
             const curvedEdgeList&,
             Istream&
         );
@@ -117,6 +121,11 @@ public:
         }
 
 
+    //- Destructor
+
+        ~block();
+
+
     // Member Functions
 
         // Access
@@ -127,13 +136,20 @@ public:
                 return *this;
             }
 
+            //- Return the points for filling the block
             const pointField& points() const;
 
+            //- Return the cells for filling the block
             const labelListList& cells() const;
 
+            //- Return the boundary patch faces for the block
             const labelListListList& boundaryPatches() const;
 
 
+            //- Clear geometry
+            void clearGeom();
+
+
     // Ostream Operator
 
         friend Ostream& operator<<(Ostream&, const block&);
diff --git a/src/meshing/blockMesh/block/blockCreate.C b/src/mesh/blockMesh/block/blockCreate.C
similarity index 88%
rename from src/meshing/blockMesh/block/blockCreate.C
rename to src/mesh/blockMesh/block/blockCreate.C
index d3d09edc971..3f741fd587d 100644
--- a/src/meshing/blockMesh/block/blockCreate.C
+++ b/src/mesh/blockMesh/block/blockCreate.C
@@ -27,7 +27,6 @@ License
 #include "error.H"
 #include "block.H"
 
-
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
 Foam::label Foam::block::vtxLabel(label i, label j, label k) const
@@ -41,7 +40,7 @@ Foam::label Foam::block::vtxLabel(label i, label j, label k) const
 }
 
 
-void Foam::block::createPoints()
+void Foam::block::createPoints() const
 {
     // set local variables for mesh specification
     const label ni = meshDensity().x();
@@ -63,7 +62,11 @@ void Foam::block::createPoints()
     const List< List<point> >& p = blockEdgePoints();
     const scalarListList& w = blockEdgeWeights();
 
+    //
     // generate vertices
+    //
+    vertices_.clear();
+    vertices_.setSize(nPoints());
 
     for (label k = 0; k <= nk; k++)
     {
@@ -71,7 +74,7 @@ void Foam::block::createPoints()
         {
             for (label i = 0; i <= ni; i++)
             {
-                label vertexNo = vtxLabel(i, j, k);
+                const label vertexNo = vtxLabel(i, j, k);
 
                 // points on edges
                 vector edgex1 = p000 + (p100 - p000)*w[0][i];
@@ -89,6 +92,7 @@ void Foam::block::createPoints()
                 vector edgez3 = p110 + (p111 - p110)*w[10][k];
                 vector edgez4 = p010 + (p011 - p010)*w[11][k];
 
+
                 // calculate the importance factors for all edges
 
                 // x-direction
@@ -110,7 +114,6 @@ void Foam::block::createPoints()
                    + w[2][i]*w[6][j]*w[10][k]
                 );
 
-
                 scalar impx4 =
                 (
                     (1.0 - w[3][i])*(1.0 - w[7][j])*w[8][k]
@@ -187,6 +190,7 @@ void Foam::block::createPoints()
                 impz3 /= magImpz;
                 impz4 /= magImpz;
 
+
                 // calculate the correction vectors
                 vector corx1 = impx1*(p[0][i] - edgex1);
                 vector corx2 = impx2*(p[1][i] - edgex2);
@@ -226,34 +230,44 @@ void Foam::block::createPoints()
 
 
                 // add the contributions
-                vertices_[vertexNo] = edgex1 + edgex2 + edgex3 + edgex4;
-                vertices_[vertexNo] += edgey1 + edgey2 + edgey3 + edgey4;
-                vertices_[vertexNo] += edgez1 + edgez2 + edgez3 + edgez4;
-
-                vertices_[vertexNo] /= 3.0;
+                vertices_[vertexNo] =
+                (
+                    edgex1 + edgex2 + edgex3 + edgex4
+                  + edgey1 + edgey2 + edgey3 + edgey4
+                  + edgez1 + edgez2 + edgez3 + edgez4
+                ) / 3.0;
 
-                vertices_[vertexNo] += corx1 + corx2 + corx3 + corx4;
-                vertices_[vertexNo] += cory1 + cory2 + cory3 + cory4;
-                vertices_[vertexNo] += corz1 + corz2 + corz3 + corz4;
+                vertices_[vertexNo] +=
+                (
+                    corx1 + corx2 + corx3 + corx4
+                  + cory1 + cory2 + cory3 + cory4
+                  + corz1 + corz2 + corz3 + corz4
+                );
             }
         }
     }
 }
 
 
-void Foam::block::createCells()
+void Foam::block::createCells() const
 {
     const label ni = meshDensity().x();
     const label nj = meshDensity().y();
     const label nk = meshDensity().z();
 
+    //
+    // generate cells
+    //
+    cells_.clear();
+    cells_.setSize(nCells());
+
     label cellNo = 0;
 
-    for (label k = 0; k <= nk - 1; k++)
+    for (label k = 0; k < nk; k++)
     {
-        for (label j = 0; j <= nj - 1; j++)
+        for (label j = 0; j < nj; j++)
         {
-            for (label i = 0; i <= ni - 1; i++)
+            for (label i = 0; i < ni; i++)
             {
                 cells_[cellNo].setSize(8);
 
@@ -272,12 +286,19 @@ void Foam::block::createCells()
 }
 
 
-void Foam::block::createBoundary()
+void Foam::block::createBoundary() const
 {
     const label ni = meshDensity().x();
     const label nj = meshDensity().y();
     const label nk = meshDensity().z();
 
+    //
+    // generate boundaries on each side of the hex
+    //
+    boundaryPatches_.clear();
+    boundaryPatches_.setSize(6);
+
+
     // x-direction
 
     label wallLabel = 0;
@@ -285,9 +306,9 @@ void Foam::block::createBoundary()
 
     // x-min
     boundaryPatches_[wallLabel].setSize(nj*nk);
-    for (label k = 0; k <= nk - 1; k++)
+    for (label k = 0; k < nk; k++)
     {
-        for (label j = 0; j <= nj - 1; j++)
+        for (label j = 0; j < nj; j++)
         {
             boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
 
@@ -312,9 +333,9 @@ void Foam::block::createBoundary()
 
     boundaryPatches_[wallLabel].setSize(nj*nk);
 
-    for (label k = 0; k <= nk - 1; k++)
+    for (label k = 0; k < nk; k++)
     {
-        for (label j = 0; j <= nj - 1; j++)
+        for (label j = 0; j < nj; j++)
         {
             boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
 
@@ -340,9 +361,9 @@ void Foam::block::createBoundary()
     wallCellLabel = 0;
 
     boundaryPatches_[wallLabel].setSize(ni*nk);
-    for (label i = 0; i <= ni - 1; i++)
+    for (label i = 0; i < ni; i++)
     {
-        for (label k = 0; k <= nk - 1; k++)
+        for (label k = 0; k < nk; k++)
         {
             boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
 
@@ -367,9 +388,9 @@ void Foam::block::createBoundary()
 
     boundaryPatches_[wallLabel].setSize(ni*nk);
 
-    for (label i = 0; i <= ni - 1; i++)
+    for (label i = 0; i < ni; i++)
     {
-        for (label k = 0; k <= nk - 1; k++)
+        for (label k = 0; k < nk; k++)
         {
             boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
 
@@ -396,9 +417,9 @@ void Foam::block::createBoundary()
 
     boundaryPatches_[wallLabel].setSize(ni*nj);
 
-    for (label i = 0; i <= ni - 1; i++)
+    for (label i = 0; i < ni; i++)
     {
-        for (label j = 0; j <= nj - 1; j++)
+        for (label j = 0; j < nj; j++)
         {
             boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
 
@@ -423,9 +444,9 @@ void Foam::block::createBoundary()
 
     boundaryPatches_[wallLabel].setSize(ni*nj);
 
-    for (label i = 0; i <= ni - 1; i++)
+    for (label i = 0; i < ni; i++)
     {
-        for (label j = 0; j <= nj - 1; j++)
+        for (label j = 0; j < nj; j++)
         {
             boundaryPatches_[wallLabel][wallCellLabel].setSize(4);
 
@@ -446,16 +467,11 @@ void Foam::block::createBoundary()
 }
 
 
-void Foam::block::createPrimitives()
+void Foam::block::clearGeom()
 {
-    // create points
-    createPoints();
-
-    // generate internal cells
-    createCells();
-
-    // generate boundary patches
-    createBoundary();
+    vertices_.clear();
+    cells_.clear();
+    boundaryPatches_.clear();
 }
 
 
diff --git a/src/meshing/blockMesh/block/blockList.H b/src/mesh/blockMesh/block/blockList.H
similarity index 100%
rename from src/meshing/blockMesh/block/blockList.H
rename to src/mesh/blockMesh/block/blockList.H
diff --git a/src/meshing/blockMesh/blockDescriptor/blockDescriptor.C b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C
similarity index 94%
rename from src/meshing/blockMesh/blockDescriptor/blockDescriptor.C
rename to src/mesh/blockMesh/blockDescriptor/blockDescriptor.C
index 7551cc6459a..7b7a0bdcace 100644
--- a/src/meshing/blockMesh/blockDescriptor/blockDescriptor.C
+++ b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.C
@@ -32,14 +32,14 @@ License
 Foam::blockDescriptor::blockDescriptor
 (
     const cellShape& bshape,
-    const pointField& blockMeshPoints,
+    const pointField& blockPointField,
     const curvedEdgeList& edges,
     const Vector<label>& meshDensity,
     const UList<scalar>& expand,
     const word& zoneName
 )
 :
-    blockMeshPoints_(blockMeshPoints),
+    blockPointField_(blockPointField),
     curvedEdges_(edges),
     blockShape_(bshape),
     meshDensity_(meshDensity),
@@ -53,7 +53,7 @@ Foam::blockDescriptor::blockDescriptor
         FatalErrorIn
         (
             "blockDescriptor::blockDescriptor"
-            "(const cellShape&, const pointField& blockMeshPoints, "
+            "(const cellShape&, const pointField& blockPointField, "
             "const curvedEdgeList&, const Vector<label>& meshDensity, "
             "const scalarList& expand, const word& zoneName)"
         )   << "Unknown definition of expansion ratios"
@@ -67,12 +67,12 @@ Foam::blockDescriptor::blockDescriptor
 
 Foam::blockDescriptor::blockDescriptor
 (
-    const pointField& blockMeshPoints,
+    const pointField& blockPointField,
     const curvedEdgeList& edges,
     Istream& is
 )
 :
-    blockMeshPoints_(blockMeshPoints),
+    blockPointField_(blockPointField),
     curvedEdges_(edges),
     blockShape_(is),
     meshDensity_(),
@@ -168,11 +168,17 @@ Foam::blockDescriptor::blockDescriptor
 }
 
 
+// * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
+
+Foam::blockDescriptor::~blockDescriptor()
+{}
+
+
 // * * * * * * * * * * * * * * * Member Functions  * * * * * * * * * * * * * //
 
 const Foam::pointField& Foam::blockDescriptor::blockPointField() const
 {
-    return blockMeshPoints_;
+    return blockPointField_;
 }
 
 
@@ -231,11 +237,10 @@ Foam::label Foam::blockDescriptor::nCells() const
 
 const Foam::point& Foam::blockDescriptor::blockPoint(const label i) const
 {
-    return blockMeshPoints_[blockShape_[i]];
+    return blockPointField_[blockShape_[i]];
 }
 
 
-
 // * * * * * * * * * * * * * * Friend Operators * * * * * * * * * * * * * * //
 
 Foam::Ostream& Foam::operator<<(Ostream& os, const blockDescriptor& bd)
diff --git a/src/meshing/blockMesh/blockDescriptor/blockDescriptor.H b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.H
similarity index 93%
rename from src/meshing/blockMesh/blockDescriptor/blockDescriptor.H
rename to src/mesh/blockMesh/blockDescriptor/blockDescriptor.H
index 1e5335d4444..4c6b0f526d9 100644
--- a/src/meshing/blockMesh/blockDescriptor/blockDescriptor.H
+++ b/src/mesh/blockMesh/blockDescriptor/blockDescriptor.H
@@ -38,8 +38,8 @@ SourceFiles
 #ifndef blockDescriptor_H
 #define blockDescriptor_H
 
-#include "point.H"
 #include "cellShape.H"
+#include "pointField.H"
 #include "scalarList.H"
 #include "curvedEdgeList.H"
 
@@ -51,6 +51,11 @@ namespace Foam
 class Istream;
 class Ostream;
 
+// Forward declaration of friend functions and operators
+class blockMesh;
+class blockDescriptor;
+Ostream& operator<<(Ostream&, const blockDescriptor&);
+
 /*---------------------------------------------------------------------------*\
                        Class blockDescriptor Declaration
 \*---------------------------------------------------------------------------*/
@@ -60,7 +65,7 @@ class blockDescriptor
     // Private data
 
         //- Reference to point field defining the block mesh
-        const pointField& blockMeshPoints_;
+        const pointField& blockPointField_;
 
         //- Reference to a list of curved edges
         const curvedEdgeList& curvedEdges_;
@@ -106,7 +111,7 @@ public:
         blockDescriptor
         (
             const cellShape&,
-            const pointField& blockMeshPoints,
+            const pointField& blockPointField,
             const curvedEdgeList&,
             const Vector<label>& meshDensity,
             const UList<scalar>& expand,
@@ -116,7 +121,7 @@ public:
         //- Construct from Istream
         blockDescriptor
         (
-            const pointField& blockMeshPoints,
+            const pointField& blockPointField,
             const curvedEdgeList&,
             Istream&
         );
@@ -129,6 +134,11 @@ public:
         }
 
 
+    // Destructor
+
+        ~blockDescriptor();
+
+
     // Member Functions
 
         // Access
diff --git a/src/meshing/blockMesh/blockDescriptor/blockDescriptorEdges.C b/src/mesh/blockMesh/blockDescriptor/blockDescriptorEdges.C
similarity index 98%
rename from src/meshing/blockMesh/blockDescriptor/blockDescriptorEdges.C
rename to src/mesh/blockMesh/blockDescriptor/blockDescriptorEdges.C
index a583662b122..5fcf31f4218 100644
--- a/src/meshing/blockMesh/blockDescriptor/blockDescriptorEdges.C
+++ b/src/mesh/blockMesh/blockDescriptor/blockDescriptorEdges.C
@@ -26,6 +26,7 @@ License
 
 #include "error.H"
 #include "blockDescriptor.H"
+
 #include "lineEdge.H"
 #include "lineDivide.H"
 
@@ -86,7 +87,7 @@ void Foam::blockDescriptor::setEdge
     const labelList& blockLabels = blockShape_;
 
     // set reference to global list of points
-    const pointField blockPoints = blockShape_.points(blockMeshPoints_);
+    const pointField blockPoints = blockShape_.points(blockPointField_);
 
     // Set the edge points/weights
     // The edge is a straight-line if it is not in the list of curvedEdges
diff --git a/src/meshing/blockMesh/blockMesh/blockMesh.C b/src/mesh/blockMesh/blockMesh/blockMesh.C
similarity index 74%
rename from src/meshing/blockMesh/blockMesh/blockMesh.C
rename to src/mesh/blockMesh/blockMesh/blockMesh.C
index a46eace62df..acdcc8b86db 100644
--- a/src/meshing/blockMesh/blockMesh/blockMesh.C
+++ b/src/mesh/blockMesh/blockMesh/blockMesh.C
@@ -26,18 +26,16 @@ License
 
 #include "blockMesh.H"
 
-
 // * * * * * * * * * * * * * * * * Constructors  * * * * * * * * * * * * * * //
 
-Foam::blockMesh::blockMesh(IOdictionary& meshDescription)
+Foam::blockMesh::blockMesh(IOdictionary& dict)
 :
-    topologyPtr_(createTopology(meshDescription)),
-    blockOffsets_(createBlockOffsets()),
-    mergeList_(createMergeList()),
-    points_(createPoints(meshDescription)),
-    cells_(createCells()),
-    patches_(createPatches())
-{}
+    blockPointField_(dict.lookup("vertices")),
+    scaleFactor_(1.0),
+    topologyPtr_(createTopology(dict))
+{
+    calcMergeInfo();
+}
 
 
 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
@@ -63,45 +61,54 @@ const Foam::polyMesh& Foam::blockMesh::topology() const
 }
 
 
-Foam::wordList Foam::blockMesh::patchNames() const
+const Foam::pointField& Foam::blockMesh::points() const
 {
-    const polyPatchList& patchTopologies = topology().boundaryMesh();
-    wordList names(patchTopologies.size());
-
-    forAll(names, patchI)
+    if (points_.empty())
     {
-        names[patchI] = patchTopologies[patchI].name();
+        createPoints();
     }
 
-    return names;
+    return points_;
 }
 
 
-Foam::wordList Foam::blockMesh::patchTypes() const
+const Foam::cellShapeList& Foam::blockMesh::cells() const
 {
-    const polyPatchList& patchTopologies = topology().boundaryMesh();
-    wordList types(patchTopologies.size());
-
-    forAll(types, patchI)
+    if (cells_.empty())
     {
-        types[patchI] = patchTopologies[patchI].type();
+        createCells();
     }
 
-    return types;
+    return cells_;
 }
 
 
-Foam::wordList Foam::blockMesh::patchPhysicalTypes() const
+const Foam::faceListList& Foam::blockMesh::patches() const
 {
-    const polyPatchList& patchTopologies = topology().boundaryMesh();
-    wordList physicalTypes(patchTopologies.size());
-
-    forAll(physicalTypes, patchI)
+    if (patches_.empty())
     {
-        physicalTypes[patchI] = patchTopologies[patchI].physicalType();
+        createPatches();
     }
 
-    return physicalTypes;
+    return patches_;
+}
+
+
+Foam::wordList Foam::blockMesh::patchNames() const
+{
+    return topology().boundaryMesh().names();
+}
+
+
+Foam::wordList Foam::blockMesh::patchTypes() const
+{
+    return topology().boundaryMesh().types();
+}
+
+
+Foam::wordList Foam::blockMesh::patchPhysicalTypes() const
+{
+    return topology().boundaryMesh().physicalTypes();
 }
 
 
diff --git a/src/meshing/blockMesh/blockMesh/blockMesh.H b/src/mesh/blockMesh/blockMesh/blockMesh.H
similarity index 77%
rename from src/meshing/blockMesh/blockMesh/blockMesh.H
rename to src/mesh/blockMesh/blockMesh/blockMesh.H
index 6d650656a72..4acc0797c4d 100644
--- a/src/meshing/blockMesh/blockMesh/blockMesh.H
+++ b/src/mesh/blockMesh/blockMesh/blockMesh.H
@@ -26,15 +26,16 @@ Class
     Foam::blockMesh
 
 Description
+    A multi-block mesh generator
+
+Note
+    The vertices, cells and patches for filling the blocks are demand-driven.
 
 SourceFiles
     blockMesh.C
-    blockMeshCells.C
     blockMeshCheck.C
-    blockMeshMergeList.C
-    blockMeshOffsets.C
-    blockMeshPatches.C
-    blockMeshPoints.C
+    blockMeshCreate.C
+    blockMeshMerge.C
     blockMeshTopology.C
 
 \*---------------------------------------------------------------------------*/
@@ -62,19 +63,34 @@ class blockMesh
 {
     // Private data
 
-        label nPoints_;
-        label nCells_;
+        //- Point field defining the block mesh (corners)
+        pointField blockPointField_;
 
+        //- The list of curved edges
         curvedEdgeList edges_;
 
+        //- The scaling factor to convert to meters
+        scalar scaleFactor_;
+
+        //- The blocks themselves (the topology) as a polyMesh
         polyMesh* topologyPtr_;
 
+        label nPoints_;
+
+        //- The sum of all cells in each block
+        label nCells_;
+
+        //- The point offset added to each block
         labelList blockOffsets_;
+
+        //- The merge points information
         labelList mergeList_;
 
-        pointField points_;
-        cellShapeList cells_;
-        faceListList patches_;
+        mutable pointField points_;
+
+        mutable cellShapeList cells_;
+
+        mutable faceListList patches_;
 
 
     // Private Member Functions
@@ -96,14 +112,14 @@ class blockMesh
         polyMesh* createTopology(IOdictionary&);
         void checkBlockMesh(const polyMesh&) const;
 
-        labelList createBlockOffsets();
-        labelList createMergeList();
-
-        pointField createPoints(const dictionary&) const;
-        cellShapeList createCells() const;
+        //- Determine the merge info and the final number of cells/points
+        void calcMergeInfo();
 
         faceList createPatchFaces(const polyPatch& patchTopologyFaces) const;
-        faceListList createPatches() const;
+
+        void createPoints() const;
+        void createCells() const;
+        void createPatches() const;
 
         //- as copy (not implemented)
         blockMesh(const blockMesh&);
@@ -133,20 +149,11 @@ public:
                 return edges_;
             }
 
-            const pointField& points() const
-            {
-                return points_;
-            }
+            const pointField& points() const;
 
-            const cellShapeList& cells() const
-            {
-                return cells_;
-            }
+            const cellShapeList& cells() const;
 
-            const faceListList& patches() const
-            {
-                return patches_;
-            }
+            const faceListList& patches() const;
 
             wordList patchNames() const;
 
diff --git a/src/meshing/blockMesh/blockMesh/blockMeshCheck.C b/src/mesh/blockMesh/blockMesh/blockMeshCheck.C
similarity index 94%
rename from src/meshing/blockMesh/blockMesh/blockMeshCheck.C
rename to src/mesh/blockMesh/blockMesh/blockMeshCheck.C
index 00540d60a2b..1e3d6ca6932 100644
--- a/src/meshing/blockMesh/blockMesh/blockMeshCheck.C
+++ b/src/mesh/blockMesh/blockMesh/blockMeshCheck.C
@@ -31,7 +31,7 @@ License
 // Check the blockMesh topology
 void Foam::blockMesh::checkBlockMesh(const polyMesh& bm) const
 {
-    Info<< nl << "Check blockMesh topology" << endl;
+    Info<< nl << "Check topology" << endl;
 
     bool ok = true;
 
@@ -55,19 +55,19 @@ void Foam::blockMesh::checkBlockMesh(const polyMesh& bm) const
     }
 
 
-    Info<< nl << tab << "Basic statistics" << endl;
+    Info<< nl << tab << "Basic statistics" << nl;
 
     Info<< tab << tab << "Number of internal faces : "
-        << bm.nInternalFaces() << endl;
+        << bm.nInternalFaces() << nl;
 
     Info<< tab << tab << "Number of boundary faces : "
-        << nBoundaryFaces << endl;
+        << nBoundaryFaces << nl;
 
     Info<< tab << tab << "Number of defined boundary faces : "
-        << nDefinedBoundaryFaces << endl;
+        << nDefinedBoundaryFaces << nl;
 
     Info<< tab << tab << "Number of undefined boundary faces : "
-        << nBoundaryFaces - nDefinedBoundaryFaces << endl;
+        << nBoundaryFaces - nDefinedBoundaryFaces << nl;
 
     if ((nBoundaryFaces - nDefinedBoundaryFaces) > 0)
     {
@@ -76,7 +76,7 @@ void Foam::blockMesh::checkBlockMesh(const polyMesh& bm) const
             << "of 2D planar geometries!)" << endl;
     }
 
-    Info<< nl << tab << "Checking patch -> block consistency" << endl;
+    Info<< tab << "Checking patch -> block consistency" << endl;
 
 
     forAll(patches, patchi)
diff --git a/src/meshing/blockMesh/blockMesh/blockMeshPatches.C b/src/mesh/blockMesh/blockMesh/blockMeshCreate.C
similarity index 70%
rename from src/meshing/blockMesh/blockMesh/blockMeshPatches.C
rename to src/mesh/blockMesh/blockMesh/blockMeshCreate.C
index 3e0f6087921..546b9fbc8b2 100644
--- a/src/meshing/blockMesh/blockMesh/blockMeshPatches.C
+++ b/src/mesh/blockMesh/blockMesh/blockMeshCreate.C
@@ -24,10 +24,84 @@ License
 
 \*---------------------------------------------------------------------------*/
 
+#include "error.H"
 #include "blockMesh.H"
+#include "cellModeller.H"
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
+void Foam::blockMesh::createPoints() const
+{
+    const blockMesh& blocks = *this;
+
+    Info<< "Creating points with scale " << scaleFactor_ << endl;
+
+    //
+    // generate points
+    //
+    points_.clear();
+    points_.setSize(nPoints_);
+
+    forAll(blocks, blockI)
+    {
+        const pointField& blockPoints = blocks[blockI].points();
+
+        forAll(blockPoints, blockPointI)
+        {
+            points_
+            [
+                mergeList_
+                [
+                    blockOffsets_[blockI] + blockPointI
+                ]
+            ] = scaleFactor_ * blockPoints[blockPointI];
+        }
+    }
+}
+
+
+void Foam::blockMesh::createCells() const
+{
+    const blockMesh& blocks = *this;
+    const cellModel& hex = *(cellModeller::lookup("hex"));
+
+    Info<< "Creating cells" << endl;
+
+    //
+    // generate cells
+    //
+    cells_.clear();
+    cells_.setSize(nCells_);
+
+    label cellLabel = 0;
+
+    forAll(blocks, blockI)
+    {
+        const labelListList& blockCells = blocks[blockI].cells();
+
+        forAll(blockCells, blockCellI)
+        {
+            labelList cellPoints(blockCells[blockCellI].size());
+
+            forAll(cellPoints, cellPointI)
+            {
+                cellPoints[cellPointI] =
+                    mergeList_
+                    [
+                        blockCells[blockCellI][cellPointI]
+                      + blockOffsets_[blockI]
+                    ];
+            }
+
+            // Construct collapsed cell and add to list
+            cells_[cellLabel] = cellShape(hex, cellPoints, true);
+
+            cellLabel++;
+        }
+    }
+}
+
+
 Foam::faceList Foam::blockMesh::createPatchFaces
 (
     const polyPatch& patchTopologyFaces
@@ -37,7 +111,7 @@ Foam::faceList Foam::blockMesh::createPatchFaces
 
     labelList blockLabels = patchTopologyFaces.polyPatch::faceCells();
 
-    label nFaces=0;
+    label nFaces = 0;
 
     forAll(patchTopologyFaces, patchTopologyFaceLabel)
     {
@@ -143,20 +217,24 @@ Foam::faceList Foam::blockMesh::createPatchFaces
 }
 
 
-Foam::faceListList Foam::blockMesh::createPatches() const
+void Foam::blockMesh::createPatches() const
 {
+    const polyPatchList& topoPatches = topology().boundaryMesh();
+
     Info<< "Creating patches" << endl;
 
-    const polyPatchList& patchTopologies = topology().boundaryMesh();
-    faceListList patches(patchTopologies.size());
+    //
+    // generate points
+    //
+
+    patches_.clear();
+    patches_.setSize(topoPatches.size());
 
-    forAll(patchTopologies, patchLabel)
+    forAll(topoPatches, patchI)
     {
-        patches[patchLabel] =
-            createPatchFaces(patchTopologies[patchLabel]);
+        patches_[patchI] = createPatchFaces(topoPatches[patchI]);
     }
 
-    return patches;
 }
 
 // ************************************************************************* //
diff --git a/src/meshing/blockMesh/blockMesh/blockMeshMergeList.C b/src/mesh/blockMesh/blockMesh/blockMeshMerge.C
similarity index 87%
rename from src/meshing/blockMesh/blockMesh/blockMeshMergeList.C
rename to src/mesh/blockMesh/blockMesh/blockMeshMerge.C
index 1e17bc30027..20442c15c77 100644
--- a/src/meshing/blockMesh/blockMesh/blockMeshMergeList.C
+++ b/src/mesh/blockMesh/blockMesh/blockMeshMerge.C
@@ -28,13 +28,32 @@ License
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
-Foam::labelList Foam::blockMesh::createMergeList()
+void Foam::blockMesh::calcMergeInfo()
 {
+    const blockMesh& blocks = *this;
+
+    Info<< "Creating block offsets" << endl;
+
+    blockOffsets_.setSize(blocks.size());
+
+    nPoints_ = 0;
+    nCells_  = 0;
+
+    forAll(blocks, blockI)
+    {
+        blockOffsets_[blockI] = nPoints_;
+
+        nPoints_ += blocks[blockI].nPoints();
+        nCells_  += blocks[blockI].nCells();
+    }
+
+
     Info<< "Creating merge list " << flush;
 
-    labelList MergeList(nPoints_, -1);
+    // set unused to -1
+    mergeList_.setSize(nPoints_);
+    mergeList_ = -1;
 
-    const blockMesh& blocks = *this;
 
     const pointField& blockPoints = topology().points();
     const cellList& blockCells = topology().cells();
@@ -46,6 +65,7 @@ Foam::labelList Foam::blockMesh::createMergeList()
 
     const labelList& faceNeighbourBlocks = topology().faceNeighbour();
 
+
     forAll(blockFaces, blockFaceLabel)
     {
         label blockPlabel = faceOwnerBlocks[blockFaceLabel];
@@ -74,7 +94,7 @@ Foam::labelList Foam::blockMesh::createMergeList()
 
         if (!foundFace)
         {
-            FatalErrorIn("blockMesh::createMergeList()")
+            FatalErrorIn("blockMesh::calcMergeInfo()")
                 << "Cannot find merge face for block " << blockPlabel
                 << exit(FatalError);
         };
@@ -130,17 +150,17 @@ Foam::labelList Foam::blockMesh::createMergeList()
 
                             label minPP2 = min(PpointLabel, PpointLabel2);
 
-                            if (MergeList[PpointLabel] != -1)
+                            if (mergeList_[PpointLabel] != -1)
                             {
-                                minPP2 = min(minPP2, MergeList[PpointLabel]);
+                                minPP2 = min(minPP2, mergeList_[PpointLabel]);
                             }
 
-                            if (MergeList[PpointLabel2] != -1)
+                            if (mergeList_[PpointLabel2] != -1)
                             {
-                                minPP2 = min(minPP2, MergeList[PpointLabel2]);
+                                minPP2 = min(minPP2, mergeList_[PpointLabel2]);
                             }
 
-                            MergeList[PpointLabel] = MergeList[PpointLabel2]
+                            mergeList_[PpointLabel] = mergeList_[PpointLabel2]
                                 = minPP2;
                         }
                         else
@@ -183,7 +203,7 @@ Foam::labelList Foam::blockMesh::createMergeList()
 
         if (!foundFace)
         {
-            FatalErrorIn("blockMesh::createMergeList()")
+            FatalErrorIn("blockMesh::calcMergeInfo()")
                 << "Cannot find merge face for block " << blockNlabel
                 << exit(FatalError);
         };
@@ -193,7 +213,7 @@ Foam::labelList Foam::blockMesh::createMergeList()
 
         if (blockPfaceFaces.size() != blockNfaceFaces.size())
         {
-            FatalErrorIn("blockMesh::createMergeList()")
+            FatalErrorIn("blockMesh::calcMergeInfo()")
                 << "Inconsistent number of faces between block pair "
                 << blockPlabel << " and " << blockNlabel
                 << exit(FatalError);
@@ -251,17 +271,17 @@ Foam::labelList Foam::blockMesh::createMergeList()
 
                             label minPN = min(PpointLabel, NpointLabel);
 
-                            if (MergeList[PpointLabel] != -1)
+                            if (mergeList_[PpointLabel] != -1)
                             {
-                                minPN = min(minPN, MergeList[PpointLabel]);
+                                minPN = min(minPN, mergeList_[PpointLabel]);
                             }
 
-                            if (MergeList[NpointLabel] != -1)
+                            if (mergeList_[NpointLabel] != -1)
                             {
-                                minPN = min(minPN, MergeList[NpointLabel]);
+                                minPN = min(minPN, mergeList_[NpointLabel]);
                             }
 
-                            MergeList[PpointLabel] = MergeList[NpointLabel]
+                            mergeList_[PpointLabel] = mergeList_[NpointLabel]
                                 = minPN;
                         }
                     }
@@ -271,7 +291,7 @@ Foam::labelList Foam::blockMesh::createMergeList()
             {
                 if (cp[blockPfaceFacePointLabel] == -1)
                 {
-                    FatalErrorIn("blockMesh::createMergeList()")
+                    FatalErrorIn("blockMesh::calcMergeInfo()")
                         << "Inconsistent point locations between block pair "
                         << blockPlabel << " and " << blockNlabel << nl
                         << "    probably due to inconsistent grading."
@@ -374,18 +394,18 @@ Foam::labelList Foam::blockMesh::createMergeList()
 
                     if
                     (
-                        MergeList[PpointLabel]
-                     != MergeList[NpointLabel]
+                        mergeList_[PpointLabel]
+                     != mergeList_[NpointLabel]
                     )
                     {
                         changedPointMerge = true;
 
-                        MergeList[PpointLabel]
-                      = MergeList[NpointLabel]
+                        mergeList_[PpointLabel]
+                      = mergeList_[NpointLabel]
                       = min
                         (
-                            MergeList[PpointLabel],
-                            MergeList[NpointLabel]
+                            mergeList_[PpointLabel],
+                            mergeList_[NpointLabel]
                         );
                     }
                 }
@@ -395,7 +415,7 @@ Foam::labelList Foam::blockMesh::createMergeList()
 
         if (nPasses > 100)
         {
-            FatalErrorIn("blockMesh::createMergeList()")
+            FatalErrorIn("blockMesh::calcMergeInfo()")
                 << "Point merging failed after max number of passes."
                 << abort(FatalError);
         }
@@ -436,7 +456,7 @@ Foam::labelList Foam::blockMesh::createMergeList()
 
         if (!foundFace)
         {
-            FatalErrorIn("blockMesh::createMergeList()")
+            FatalErrorIn("blockMesh::calcMergeInfo()")
                 << "Cannot find merge face for block " << blockPlabel
                 << exit(FatalError);
         };
@@ -463,7 +483,7 @@ Foam::labelList Foam::blockMesh::createMergeList()
 
         if (!foundFace)
         {
-            FatalErrorIn("blockMesh::createMergeList()")
+            FatalErrorIn("blockMesh::calcMergeInfo()")
                 << "Cannot find merge face for block " << blockNlabel
                 << exit(FatalError);
         };
@@ -485,9 +505,9 @@ Foam::labelList Foam::blockMesh::createMergeList()
                     blockPfaceFacePoints[blockPfaceFacePointLabel]
                   + blockOffsets_[blockPlabel];
 
-                if (MergeList[PpointLabel] == -1)
+                if (mergeList_[PpointLabel] == -1)
                 {
-                    FatalErrorIn("blockMesh::createMergeList()")
+                    FatalErrorIn("blockMesh::calcMergeInfo()")
                         << "Unable to merge point "
                         << blockPfaceFacePointLabel
                         << ' ' << blockPpoints[blockPfaceFacePointLabel]
@@ -511,9 +531,9 @@ Foam::labelList Foam::blockMesh::createMergeList()
                     blockNfaceFacePoints[blockNfaceFacePointLabel]
                   + blockOffsets_[blockNlabel];
 
-                if (MergeList[NpointLabel] == -1)
+                if (mergeList_[NpointLabel] == -1)
                 {
-                    FatalErrorIn("blockMesh::createMergeList()")
+                    FatalErrorIn("blockMesh::calcMergeInfo()")
                         << "unable to merge point "
                         << blockNfaceFacePointLabel
                         << ' ' << blockNpoints[blockNfaceFacePointLabel]
@@ -532,33 +552,31 @@ Foam::labelList Foam::blockMesh::createMergeList()
     // given old point label
     label newPointLabel = 0;
 
-    forAll(MergeList, pointLabel)
+    forAll(mergeList_, pointLabel)
     {
-        if (MergeList[pointLabel] > pointLabel)
+        if (mergeList_[pointLabel] > pointLabel)
         {
-            FatalErrorIn("blockMesh::createMergeList()")
+            FatalErrorIn("blockMesh::calcMergeInfo()")
                 << "ouch" << exit(FatalError);
         }
 
         if
         (
-            (MergeList[pointLabel] == -1)
-         || MergeList[pointLabel] == pointLabel
+            mergeList_[pointLabel] == -1
+         || mergeList_[pointLabel] == pointLabel
         )
         {
-            MergeList[pointLabel] = newPointLabel;
+            mergeList_[pointLabel] = newPointLabel;
             newPointLabel++;
         }
         else
         {
-            MergeList[pointLabel] = MergeList[MergeList[pointLabel]];
+            mergeList_[pointLabel] = mergeList_[mergeList_[pointLabel]];
         }
     }
 
     nPoints_ = newPointLabel;
 
-
-    return MergeList;
 }
 
 // ************************************************************************* //
diff --git a/src/meshing/blockMesh/blockMesh/blockMeshTopology.C b/src/mesh/blockMesh/blockMesh/blockMeshTopology.C
similarity index 81%
rename from src/meshing/blockMesh/blockMesh/blockMeshTopology.C
rename to src/mesh/blockMesh/blockMesh/blockMeshTopology.C
index 3bca1b40523..10c4a85684b 100644
--- a/src/meshing/blockMesh/blockMesh/blockMeshTopology.C
+++ b/src/mesh/blockMesh/blockMesh/blockMeshTopology.C
@@ -32,7 +32,7 @@ License
 
 // * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
 
-Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
+Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& dict)
 {
     bool topologyOK = true;
 
@@ -44,24 +44,29 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
     // get names/types for the unassigned patch faces
     // this is a bit heavy handed (and ugly), but there is currently
     // no easy way to rename polyMesh patches subsequently
-    if (const dictionary* dictPtr = meshDescription.subDictPtr("defaultPatch"))
+    if (const dictionary* dictPtr = dict.subDictPtr("defaultPatch"))
     {
         dictPtr->readIfPresent("name", defaultPatchName);
         dictPtr->readIfPresent("type", defaultPatchType);
     }
 
-    Info<< "Creating block corners" << endl;
+    // optional 'convertToMeters' or 'scale'  scaling factor
+    if (!dict.readIfPresent("convertToMeters", scaleFactor_))
+    {
+        dict.readIfPresent("scale", scaleFactor_);
+    }
 
-    // create blockCorners
-    pointField tmpBlockPoints(meshDescription.lookup("vertices"));
 
-    if (meshDescription.found("edges"))
+    //
+    // get the non-linear edges in mesh
+    //
+    if (dict.found("edges"))
     {
-        // read number of non-linear edges in mesh
         Info<< "Creating curved edges" << endl;
 
-        ITstream& is(meshDescription.lookup("edges"));
+        ITstream& is(dict.lookup("edges"));
 
+        // read number of edges in mesh
         label nEdges = 0;
 
         token firstToken(is);
@@ -84,9 +89,9 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
         token lastToken(is);
         while
         (
-            !(
-                lastToken.isPunctuation()
-                && lastToken.pToken() == token::END_LIST
+           !(
+                 lastToken.isPunctuation()
+              && lastToken.pToken() == token::END_LIST
             )
         )
         {
@@ -100,7 +105,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
             edges_.set
             (
                 nEdges,
-                curvedEdge::New(tmpBlockPoints, is)
+                curvedEdge::New(blockPointField_, is)
             );
 
             nEdges++;
@@ -114,13 +119,16 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
     }
     else
     {
-        Info<< "No non-linear edges" << endl;
+        Info<< "No non-linear edges defined" << endl;
     }
 
 
-    Info<< "Creating blocks" << endl;
+    //
+    // Create the blocks
+    //
+    Info<< "Creating topology blocks" << endl;
     {
-        ITstream& is(meshDescription.lookup("blocks"));
+        ITstream& is(dict.lookup("blocks"));
 
         // read number of blocks in mesh
         label nBlocks = 0;
@@ -145,9 +153,9 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
         token lastToken(is);
         while
         (
-            !(
-                lastToken.isPunctuation()
-                && lastToken.pToken() == token::END_LIST
+           !(
+                 lastToken.isPunctuation()
+              && lastToken.pToken() == token::END_LIST
             )
         )
         {
@@ -163,7 +171,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
                 nBlocks,
                 new block
                 (
-                    tmpBlockPoints,
+                    blockPointField_,
                     edges_,
                     is
                 )
@@ -172,7 +180,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
             topologyOK = topologyOK && blockLabelsOK
             (
                 nBlocks,
-                tmpBlockPoints,
+                blockPointField_,
                 blocks[nBlocks].blockShape()
             );
 
@@ -187,14 +195,17 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
     }
 
 
-    Info<< "Creating patches" << endl;
+    //
+    // Create the patches
+    //
+    Info<< "Creating topology patches" << endl;
 
     faceListList tmpBlocksPatches;
     wordList patchNames;
     wordList patchTypes;
 
     {
-        ITstream& is(meshDescription.lookup("patches"));
+        ITstream& is(dict.lookup("patches"));
 
         // read number of patches in mesh
         label nPatches = 0;
@@ -223,9 +234,9 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
         while
         (
             !(
-                lastToken.isPunctuation()
-                && lastToken.pToken() == token::END_LIST
-            )
+                 lastToken.isPunctuation()
+              && lastToken.pToken() == token::END_LIST
+             )
         )
         {
             if (tmpBlocksPatches.size() <= nPatches)
@@ -261,7 +272,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
             topologyOK = topologyOK && patchLabelsOK
             (
                 nPatches,
-                tmpBlockPoints,
+                blockPointField_,
                 tmpBlocksPatches[nPatches]
             );
 
@@ -284,7 +295,10 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
     }
 
 
-    Info<< "Creating topology" << endl;
+    //
+    // Create the topology
+    //
+    Info<< "Creating topology mesh" << endl;
 
     PtrList<cellShape> tmpBlockShapes(blocks.size());
     forAll(blocks, blockI)
@@ -295,7 +309,7 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
             new cellShape(blocks[blockI].blockShape())
         );
 
-        if (tmpBlockShapes[blockI].mag(tmpBlockPoints) < 0.0)
+        if (tmpBlockShapes[blockI].mag(blockPointField_) < 0.0)
         {
             WarningIn
             (
@@ -309,8 +323,8 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
 
     preservePatchTypes
     (
-        meshDescription.time(),
-        meshDescription.time().constant(),
+        dict.time(),
+        dict.time().constant(),
         polyMesh::meshSubDir,
         patchNames,
         patchTypes,
@@ -319,18 +333,20 @@ Foam::polyMesh* Foam::blockMesh::createTopology(IOdictionary& meshDescription)
         patchPhysicalTypes
     );
 
+
+    // construct the topology as its own mesh
     polyMesh* blockMeshPtr = new polyMesh
     (
         IOobject
         (
             "blockMesh",
-            meshDescription.time().constant(),
-            meshDescription.time(),
+            dict.time().constant(),
+            dict.time(),
             IOobject::NO_READ,
             IOobject::NO_WRITE,
             false
         ),
-        xferMove(tmpBlockPoints),
+        xferCopy(blockPointField_),   // copy these points, do NOT move
         tmpBlockShapes,
         tmpBlocksPatches,
         patchNames,
diff --git a/src/meshing/blockMesh/curvedEdges/BSpline.C b/src/mesh/blockMesh/curvedEdges/BSpline.C
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/BSpline.C
rename to src/mesh/blockMesh/curvedEdges/BSpline.C
diff --git a/src/meshing/blockMesh/curvedEdges/BSpline.H b/src/mesh/blockMesh/curvedEdges/BSpline.H
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/BSpline.H
rename to src/mesh/blockMesh/curvedEdges/BSpline.H
diff --git a/src/meshing/blockMesh/curvedEdges/arcEdge.C b/src/mesh/blockMesh/curvedEdges/arcEdge.C
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/arcEdge.C
rename to src/mesh/blockMesh/curvedEdges/arcEdge.C
diff --git a/src/meshing/blockMesh/curvedEdges/arcEdge.H b/src/mesh/blockMesh/curvedEdges/arcEdge.H
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/arcEdge.H
rename to src/mesh/blockMesh/curvedEdges/arcEdge.H
diff --git a/src/meshing/blockMesh/curvedEdges/curvedEdge.C b/src/mesh/blockMesh/curvedEdges/curvedEdge.C
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/curvedEdge.C
rename to src/mesh/blockMesh/curvedEdges/curvedEdge.C
diff --git a/src/meshing/blockMesh/curvedEdges/curvedEdge.H b/src/mesh/blockMesh/curvedEdges/curvedEdge.H
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/curvedEdge.H
rename to src/mesh/blockMesh/curvedEdges/curvedEdge.H
diff --git a/src/meshing/blockMesh/curvedEdges/curvedEdgeList.H b/src/mesh/blockMesh/curvedEdges/curvedEdgeList.H
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/curvedEdgeList.H
rename to src/mesh/blockMesh/curvedEdges/curvedEdgeList.H
diff --git a/src/meshing/blockMesh/curvedEdges/lineDivide.C b/src/mesh/blockMesh/curvedEdges/lineDivide.C
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/lineDivide.C
rename to src/mesh/blockMesh/curvedEdges/lineDivide.C
diff --git a/src/meshing/blockMesh/curvedEdges/lineDivide.H b/src/mesh/blockMesh/curvedEdges/lineDivide.H
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/lineDivide.H
rename to src/mesh/blockMesh/curvedEdges/lineDivide.H
diff --git a/src/meshing/blockMesh/curvedEdges/lineEdge.C b/src/mesh/blockMesh/curvedEdges/lineEdge.C
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/lineEdge.C
rename to src/mesh/blockMesh/curvedEdges/lineEdge.C
diff --git a/src/meshing/blockMesh/curvedEdges/lineEdge.H b/src/mesh/blockMesh/curvedEdges/lineEdge.H
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/lineEdge.H
rename to src/mesh/blockMesh/curvedEdges/lineEdge.H
diff --git a/src/meshing/blockMesh/curvedEdges/polyLine.C b/src/mesh/blockMesh/curvedEdges/polyLine.C
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/polyLine.C
rename to src/mesh/blockMesh/curvedEdges/polyLine.C
diff --git a/src/meshing/blockMesh/curvedEdges/polyLine.H b/src/mesh/blockMesh/curvedEdges/polyLine.H
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/polyLine.H
rename to src/mesh/blockMesh/curvedEdges/polyLine.H
diff --git a/src/meshing/blockMesh/curvedEdges/polyLineEdge.C b/src/mesh/blockMesh/curvedEdges/polyLineEdge.C
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/polyLineEdge.C
rename to src/mesh/blockMesh/curvedEdges/polyLineEdge.C
diff --git a/src/meshing/blockMesh/curvedEdges/polyLineEdge.H b/src/mesh/blockMesh/curvedEdges/polyLineEdge.H
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/polyLineEdge.H
rename to src/mesh/blockMesh/curvedEdges/polyLineEdge.H
diff --git a/src/meshing/blockMesh/curvedEdges/polySplineEdge.C b/src/mesh/blockMesh/curvedEdges/polySplineEdge.C
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/polySplineEdge.C
rename to src/mesh/blockMesh/curvedEdges/polySplineEdge.C
diff --git a/src/meshing/blockMesh/curvedEdges/polySplineEdge.H b/src/mesh/blockMesh/curvedEdges/polySplineEdge.H
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/polySplineEdge.H
rename to src/mesh/blockMesh/curvedEdges/polySplineEdge.H
diff --git a/src/meshing/blockMesh/curvedEdges/simpleSplineEdge.C b/src/mesh/blockMesh/curvedEdges/simpleSplineEdge.C
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/simpleSplineEdge.C
rename to src/mesh/blockMesh/curvedEdges/simpleSplineEdge.C
diff --git a/src/meshing/blockMesh/curvedEdges/simpleSplineEdge.H b/src/mesh/blockMesh/curvedEdges/simpleSplineEdge.H
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/simpleSplineEdge.H
rename to src/mesh/blockMesh/curvedEdges/simpleSplineEdge.H
diff --git a/src/meshing/blockMesh/curvedEdges/spline.C b/src/mesh/blockMesh/curvedEdges/spline.C
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/spline.C
rename to src/mesh/blockMesh/curvedEdges/spline.C
diff --git a/src/meshing/blockMesh/curvedEdges/spline.H b/src/mesh/blockMesh/curvedEdges/spline.H
similarity index 100%
rename from src/meshing/blockMesh/curvedEdges/spline.H
rename to src/mesh/blockMesh/curvedEdges/spline.H
diff --git a/src/meshing/blockMesh/blockMesh/blockMeshCells.C b/src/meshing/blockMesh/blockMesh/blockMeshCells.C
deleted file mode 100644
index 461b0aaddf1..00000000000
--- a/src/meshing/blockMesh/blockMesh/blockMeshCells.C
+++ /dev/null
@@ -1,73 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software; you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by the
-    Free Software Foundation; either version 2 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, write to the Free Software Foundation,
-    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-\*---------------------------------------------------------------------------*/
-
-#include "error.H"
-#include "blockMesh.H"
-#include "cellModeller.H"
-
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
-
-Foam::cellShapeList Foam::blockMesh::createCells() const
-{
-    Info<< "Creating cells" << endl;
-
-    PtrList<cellShape> cells(nCells_);
-
-    const blockMesh& blocks = *this;
-
-    const cellModel& hex = *(cellModeller::lookup("hex"));
-
-    label cellLabel = 0;
-
-    forAll(blocks, blockI)
-    {
-        const labelListList& blockCells = blocks[blockI].cells();
-
-        forAll(blockCells, blockCellI)
-        {
-            labelList cellPoints(blockCells[blockCellI].size());
-
-            forAll(cellPoints, cellPointI)
-            {
-                cellPoints[cellPointI] =
-                    mergeList_
-                    [
-                        blockCells[blockCellI][cellPointI]
-                      + blockOffsets_[blockI]
-                    ];
-            }
-
-            // Construct collapsed cell and add to list
-            cells.set(cellLabel, new cellShape(hex, cellPoints, true));
-
-            cellLabel++;
-        }
-    }
-
-    return cells;
-}
-
-// ************************************************************************* //
diff --git a/src/meshing/blockMesh/blockMesh/blockMeshOffsets.C b/src/meshing/blockMesh/blockMesh/blockMeshOffsets.C
deleted file mode 100644
index 69eddd05d7e..00000000000
--- a/src/meshing/blockMesh/blockMesh/blockMeshOffsets.C
+++ /dev/null
@@ -1,57 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software; you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by the
-    Free Software Foundation; either version 2 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, write to the Free Software Foundation,
-    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-\*---------------------------------------------------------------------------*/
-
-#include "error.H"
-#include "blockMesh.H"
-
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
-
-Foam::labelList Foam::blockMesh::createBlockOffsets()
-{
-    Info<< "Creating block offsets" << endl;
-
-    const blockMesh& blocks = *this;
-
-    labelList BlockOffsets(blocks.size());
-
-    BlockOffsets[0] = 0;
-    nPoints_ = blocks[0].points().size();
-    nCells_  = blocks[0].cells().size();
-
-    for (label blockI=1; blockI < blocks.size(); blockI++)
-    {
-        BlockOffsets[blockI]
-            = BlockOffsets[blockI-1]
-            + blocks[blockI-1].points().size();
-
-        nPoints_ += blocks[blockI].points().size();
-        nCells_  += blocks[blockI].cells().size();
-    }
-
-    return BlockOffsets;
-}
-
-// ************************************************************************* //
diff --git a/src/meshing/blockMesh/blockMesh/blockMeshPoints.C b/src/meshing/blockMesh/blockMesh/blockMeshPoints.C
deleted file mode 100644
index 16bfb3488ed..00000000000
--- a/src/meshing/blockMesh/blockMesh/blockMeshPoints.C
+++ /dev/null
@@ -1,68 +0,0 @@
-/*---------------------------------------------------------------------------*\
-  =========                 |
-  \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox
-   \\    /   O peration     |
-    \\  /    A nd           | Copyright (C) 1991-2009 OpenCFD Ltd.
-     \\/     M anipulation  |
--------------------------------------------------------------------------------
-License
-    This file is part of OpenFOAM.
-
-    OpenFOAM is free software; you can redistribute it and/or modify it
-    under the terms of the GNU General Public License as published by the
-    Free Software Foundation; either version 2 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, write to the Free Software Foundation,
-    Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
-
-\*---------------------------------------------------------------------------*/
-
-#include "error.H"
-#include "blockMesh.H"
-
-// * * * * * * * * * * * * * Private Member Functions  * * * * * * * * * * * //
-
-Foam::pointField Foam::blockMesh::createPoints(const dictionary& dict) const
-{
-    const blockMesh& blocks = *this;
-
-    scalar scaleFactor = 1.0;
-
-    // optional 'convertToMeters' (or 'scale'?)
-    if (!dict.readIfPresent("convertToMeters", scaleFactor))
-    {
-        dict.readIfPresent("scale", scaleFactor);
-    }
-
-    Info<< "Creating points with scale " << scaleFactor << endl;
-
-    pointField points(nPoints_);
-
-    forAll(blocks, blockI)
-    {
-        const pointField& blockPoints = blocks[blockI].points();
-
-        forAll(blockPoints, blockPointLabel)
-        {
-            points
-            [
-                mergeList_
-                [
-                    blockPointLabel
-                  + blockOffsets_[blockI]
-                ]
-            ] = scaleFactor * blockPoints[blockPointLabel];
-        }
-    }
-
-    return points;
-}
-
-// ************************************************************************* //
-- 
GitLab