diff --git a/applications/utilities/mesh/generation/cvMesh/Allwmake b/applications/utilities/mesh/generation/cvMesh/Allwmake
index eb453138ce..d88e8cee4a 100755
--- a/applications/utilities/mesh/generation/cvMesh/Allwmake
+++ b/applications/utilities/mesh/generation/cvMesh/Allwmake
@@ -4,7 +4,8 @@ set -x
wmake libso conformalVoronoiMesh
wmake
-wmake cvMeshBackgroundMesh
+#wmake cvMeshBackgroundMesh
(cd cvMeshSurfaceSimplify && ./Allwmake)
+wmake cellSizeAndAlignmentGrid
# ----------------------------------------------------------------- end-of-file
diff --git a/applications/utilities/mesh/generation/cvMesh/Make/options b/applications/utilities/mesh/generation/cvMesh/Make/options
index 27241b2965..9461fa3725 100644
--- a/applications/utilities/mesh/generation/cvMesh/Make/options
+++ b/applications/utilities/mesh/generation/cvMesh/Make/options
@@ -2,7 +2,7 @@ EXE_DEBUG = -DFULLDEBUG -g -O0
EXE_FROUNDING_MATH = -frounding-math
EXE_NDEBUG = -DNDEBUG
-CGAL_EXACT =
+CGAL_EXACT = /*-DCGAL_DONT_USE_LAZY_KERNEL*/
CGAL_INEXACT = -DCGAL_INEXACT
include $(GENERAL_RULES)/CGAL
@@ -19,7 +19,9 @@ EXE_INC = \
-I$(LIB_SRC)/edgeMesh/lnInclude \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/dynamicMesh/lnInclude \
- -I$(LIB_SRC)/triSurface/lnInclude
+ -I$(LIB_SRC)/triSurface/lnInclude \
+ -I$(LIB_SRC)/sampling/lnInclude \
+ -IvectorTools
EXE_LIBS = \
$(CGAL_LIBS) \
@@ -32,4 +34,5 @@ EXE_LIBS = \
-ledgeMesh \
-lfileFormats \
-ltriSurface \
- -ldynamicMesh
+ -ldynamicMesh \
+ -lsampling
diff --git a/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/Make/files b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/Make/files
new file mode 100644
index 0000000000..83b77fdc77
--- /dev/null
+++ b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/Make/files
@@ -0,0 +1,2 @@
+cellSizeAndAlignmentGrid.C
+EXE = $(FOAM_USER_APPBIN)/cellSizeAndAlignmentGrid
diff --git a/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/Make/options b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/Make/options
new file mode 100644
index 0000000000..31d0d80858
--- /dev/null
+++ b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/Make/options
@@ -0,0 +1,40 @@
+EXE_DEBUG = -DFULLDEBUG -g -O0
+EXE_FROUNDING_MATH = -frounding-math
+EXE_NDEBUG = -DNDEBUG
+
+CGAL_EXACT = /*-DCGAL_DONT_USE_LAZY_KERNEL*/
+CGAL_INEXACT = -DCGAL_INEXACT
+
+include $(GENERAL_RULES)/CGAL
+
+
+EXE_INC = \
+ ${EXE_FROUNDING_MATH} \
+ ${EXE_NDEBUG} \
+ ${CGAL_INEXACT} \
+ ${CGAL_INC} \
+ -I$(LIB_SRC)/finiteVolume/lnInclude \
+ -I$(LIB_SRC)/dynamicMesh/lnInclude \
+ -I$(LIB_SRC)/triSurface/lnInclude \
+ -I$(LIB_SRC)/fileFormats/lnInclude \
+ -I$(LIB_SRC)/sampling/lnInclude \
+ -I$(LIB_SRC)/meshTools/lnInclude \
+ -I$(LIB_SRC)/parallel/decompose/decompositionMethods/lnInclude \
+ -I$(LIB_SRC)/edgeMesh/lnInclude \
+ -I$(HOME)/OpenFOAM/OpenFOAM-dev/applications/utilities/mesh/generation/cvMesh/conformalVoronoiMesh/lnInclude \
+ -I$(HOME)/OpenFOAM/OpenFOAM-dev/applications/utilities/mesh/generation/cvMesh/vectorTools
+
+EXE_LIBS = \
+ $(CGAL_LIBS) \
+ -lmpfr \
+ -lboost_thread \
+ -lconformalVoronoiMesh \
+ -lfiniteVolume \
+ -lmeshTools \
+ -ldecompositionMethods \
+ -L$(FOAM_LIBBIN)/dummy -lptscotchDecomp \
+ -ledgeMesh \
+ -ltriSurface \
+ -ldynamicMesh \
+ -lsampling \
+ -lfileFormats
diff --git a/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C
new file mode 100644
index 0000000000..27cc47f823
--- /dev/null
+++ b/applications/utilities/mesh/generation/cvMesh/cellSizeAndAlignmentGrid/cellSizeAndAlignmentGrid.C
@@ -0,0 +1,711 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
+ \\ / O peration |
+ \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
+ \\/ 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 .
+
+Application
+ Test-distributedDelaunayMesh
+
+Description
+
+\*---------------------------------------------------------------------------*/
+
+#include "CGALTriangulation3DKernel.H"
+
+#include "indexedVertex.H"
+#include "indexedCell.H"
+
+#include "argList.H"
+#include "Time.H"
+#include "DistributedDelaunayMesh.H"
+#include "backgroundMeshDecomposition.H"
+#include "searchableSurfaces.H"
+#include "conformationSurfaces.H"
+#include "PrintTable.H"
+#include "Random.H"
+#include "boundBox.H"
+#include "point.H"
+#include "cellShapeControlMesh.H"
+#include "triadField.H"
+#include "scalarIOField.H"
+#include "pointIOField.H"
+#include "triadIOField.H"
+
+using namespace Foam;
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+// Main program:
+
+template
+Foam::tmp > filterFarPoints
+(
+ const Triangulation& mesh,
+ const Field& field
+)
+{
+ tmp > tNewField(new Field(field.size()));
+ Field& newField = tNewField();
+
+ label added = 0;
+ label count = 0;
+
+ for
+ (
+ typename Triangulation::Finite_vertices_iterator vit =
+ mesh.finite_vertices_begin();
+ vit != mesh.finite_vertices_end();
+ ++vit
+ )
+ {
+ if (vit->real())
+ {
+ newField[added++] = field[count];
+ }
+
+ count++;
+ }
+
+ newField.resize(added);
+
+ return tNewField;
+}
+
+
+template
+autoPtr buildMap
+(
+ const T& mesh,
+ labelListList& pointPoints
+)
+{
+ pointPoints.setSize(mesh.vertexCount());
+
+ globalIndex globalIndexing(mesh.vertexCount());
+
+ for
+ (
+ typename T::Finite_vertices_iterator vit = mesh.finite_vertices_begin();
+ vit != mesh.finite_vertices_end();
+ ++vit
+ )
+ {
+ if (!vit->real())
+ {
+ continue;
+ }
+
+ std::list adjVerts;
+ mesh.finite_adjacent_vertices(vit, std::back_inserter(adjVerts));
+
+ DynamicList