From cfdc43989abe62b463c2e79acda986afee842e05 Mon Sep 17 00:00:00 2001
From: Franjo Juretic <franjo.juretic@c-fields.com>
Date: Mon, 8 Jun 2015 11:14:09 +0200
Subject: [PATCH] Improvements of the edge-extraction procedure

---
 .../createFundamentalSheets.C                    | 12 ++++++------
 .../createFundamentalSheets.H                    | 16 ++++++++++++----
 .../createFundamentalSheetsFJ.C                  |  8 ++++++--
 .../createFundamentalSheetsFJ.H                  |  6 +++++-
 .../createFundamentalSheetsJFS.C                 |  8 ++++++--
 .../createFundamentalSheetsJFS.H                 |  6 +++++-
 .../meshSurfaceEdgeExtractorFUN.C                | 16 ++++------------
 .../meshSurfaceEdgeExtractorFUN.H                |  6 +++++-
 .../meshSurfaceEdgeExtractorFUNDistributeFaces.C |  2 +-
 .../voronoiMeshGenerator/voronoiMeshGenerator.C  |  3 +--
 10 files changed, 51 insertions(+), 32 deletions(-)

diff --git a/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheets/createFundamentalSheets.C b/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheets/createFundamentalSheets.C
index f2950cfd..065cfb1d 100644
--- a/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheets/createFundamentalSheets.C
+++ b/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheets/createFundamentalSheets.C
@@ -45,18 +45,18 @@ defineRunTimeSelectionTable(createFundamentalSheets, polyMeshGen);
 // Construct from mesh, octree, regions for boundary vertices
 createFundamentalSheets::createFundamentalSheets
 (
-    polyMeshGen& mesh
+    polyMeshGen& mesh,
+    const bool createWrapperSheet
 )
 :
-    mesh_(mesh)
-{
-}
+    mesh_(mesh),
+    createWrapperSheet_(createWrapperSheet)
+{}
 
 // * * * * * * * * * * * * * * * * Destructor  * * * * * * * * * * * * * * * //
 
 createFundamentalSheets::~createFundamentalSheets()
-{
-}
+{}
 
 // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
 
diff --git a/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheets/createFundamentalSheets.H b/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheets/createFundamentalSheets.H
index eb2b79bc..bd77a3a6 100644
--- a/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheets/createFundamentalSheets.H
+++ b/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheets/createFundamentalSheets.H
@@ -64,6 +64,9 @@ protected:
         //- reference to mesh
         polyMeshGen& mesh_;
 
+        //- shall the procedure create the intial wrapper sheet
+        const bool createWrapperSheet_;
+
     // Protected member functions
 
         //- Disallow default bitwise copy construct
@@ -80,7 +83,11 @@ public:
     // Constructors
 
         //- Construct from mesh data
-        createFundamentalSheets(polyMeshGen& mesh);
+        createFundamentalSheets
+        (
+            polyMeshGen& mesh,
+            const bool createWrapperSheet = true
+        );
 
     // Declare run-time constructor selection table
 
@@ -90,9 +97,10 @@ public:
             createFundamentalSheets,
             polyMeshGen,
             (
-                polyMeshGen& mesh
+                polyMeshGen& mesh,
+                const bool createWrapperSheet
             ),
-            (mesh)
+            (mesh, createWrapperSheet)
         );
 
 
@@ -101,7 +109,7 @@ public:
         //- Select constructed from dictionary
         static autoPtr<createFundamentalSheets> New
         (
-            polyMeshGen& mesh
+            polyMeshGen& mesh, const bool createWrapperSheet = true
         );
 
     // Destructor
diff --git a/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheetsFJ/createFundamentalSheetsFJ.C b/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheetsFJ/createFundamentalSheetsFJ.C
index 869c3867..35dbda5f 100644
--- a/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheetsFJ/createFundamentalSheetsFJ.C
+++ b/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheetsFJ/createFundamentalSheetsFJ.C
@@ -57,6 +57,9 @@ addToRunTimeSelectionTable
 
 void createFundamentalSheetsFJ::createInitialSheet()
 {
+    if( !createWrapperSheet_ )
+        return;
+
     const PtrList<boundaryPatch>& boundaries = mesh_.boundaries();
 
     const label start = boundaries[0].patchStart();
@@ -197,10 +200,11 @@ void createFundamentalSheetsFJ::createSheetsAtFeatureEdges()
 // Construct from mesh, octree, regions for boundary vertices
 createFundamentalSheetsFJ::createFundamentalSheetsFJ
 (
-    polyMeshGen& mesh
+    polyMeshGen& mesh,
+    const bool createWrapperSheet
 )
 :
-    createFundamentalSheets(mesh)
+    createFundamentalSheets(mesh, createWrapperSheet)
 {
     createInitialSheet();
 
diff --git a/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheetsFJ/createFundamentalSheetsFJ.H b/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheetsFJ/createFundamentalSheetsFJ.H
index 6436d2ed..1a9f33f6 100644
--- a/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheetsFJ/createFundamentalSheetsFJ.H
+++ b/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheetsFJ/createFundamentalSheetsFJ.H
@@ -84,7 +84,11 @@ public:
     // Constructors
 
         //- Construct from mesh data
-        createFundamentalSheetsFJ(polyMeshGen& mesh);
+        createFundamentalSheetsFJ
+        (
+            polyMeshGen& mesh,
+            const bool createWrapperSheet = true
+        );
 
     // Destructor
 
diff --git a/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheetsJFS/createFundamentalSheetsJFS.C b/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheetsJFS/createFundamentalSheetsJFS.C
index eb244eb8..35762937 100644
--- a/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheetsJFS/createFundamentalSheetsJFS.C
+++ b/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheetsJFS/createFundamentalSheetsJFS.C
@@ -57,6 +57,9 @@ addToRunTimeSelectionTable
 
 void createFundamentalSheetsJFS::createInitialSheet()
 {
+    if( !createWrapperSheet_ )
+        return;
+
     const PtrList<boundaryPatch>& boundaries = mesh_.boundaries();
 
     const label start = boundaries[0].patchStart();
@@ -168,10 +171,11 @@ void createFundamentalSheetsJFS::createSheetsAtFeatureEdges()
 // Construct from mesh, octree, regions for boundary vertices
 createFundamentalSheetsJFS::createFundamentalSheetsJFS
 (
-    polyMeshGen& mesh
+    polyMeshGen& mesh,
+    const bool createWrapperSheet
 )
 :
-    createFundamentalSheets(mesh)
+    createFundamentalSheets(mesh, createWrapperSheet)
 {
     createInitialSheet();
 
diff --git a/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheetsJFS/createFundamentalSheetsJFS.H b/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheetsJFS/createFundamentalSheetsJFS.H
index 11b5249b..ecc564d3 100644
--- a/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheetsJFS/createFundamentalSheetsJFS.H
+++ b/meshLibrary/utilities/surfaceTools/createFundamentalSheets/createFundamentalSheetsJFS/createFundamentalSheetsJFS.H
@@ -80,7 +80,11 @@ public:
     // Constructors
 
         //- Construct from mesh data
-        createFundamentalSheetsJFS(polyMeshGen& mesh);
+        createFundamentalSheetsJFS
+        (
+            polyMeshGen& mesh,
+            const bool createWrapperSheet = true
+        );
 
     // Destructor
 
diff --git a/meshLibrary/utilities/surfaceTools/meshSurfaceEdgeExtractorFUN/meshSurfaceEdgeExtractorFUN.C b/meshLibrary/utilities/surfaceTools/meshSurfaceEdgeExtractorFUN/meshSurfaceEdgeExtractorFUN.C
index c77b80a3..a0c5e3bf 100644
--- a/meshLibrary/utilities/surfaceTools/meshSurfaceEdgeExtractorFUN/meshSurfaceEdgeExtractorFUN.C
+++ b/meshLibrary/utilities/surfaceTools/meshSurfaceEdgeExtractorFUN/meshSurfaceEdgeExtractorFUN.C
@@ -70,12 +70,14 @@ void meshSurfaceEdgeExtractorFUN::clearOut()
 meshSurfaceEdgeExtractorFUN::meshSurfaceEdgeExtractorFUN
 (
     polyMeshGen& mesh,
-    const meshOctree& octree
+    const meshOctree& octree,
+    const bool createWrapperSheet
 )
 :
     mesh_(mesh),
     meshOctree_(octree),
-    surfaceEnginePtr_(NULL)
+    surfaceEnginePtr_(NULL),
+    createWrapperSheet_(createWrapperSheet)
 {
     if( Pstream::parRun() )
         FatalErrorIn
@@ -84,20 +86,10 @@ meshSurfaceEdgeExtractorFUN::meshSurfaceEdgeExtractorFUN
             "(polyMeshGen&, const meshOctree&)"
         ) << "Cannot run in parallel!" << exit(FatalError);
 
-    //distributeBoundaryFaces();
-
-    //reviseCorners();
-
-    //reviseEdges();
-
-    //remapBoundaryPoints();
-
     createBasicFundamentalSheets();
 
     smoothMeshSurface();
 
-    //improveQualityOfFundamentalSheets();
-
     remapBoundaryPoints();
 }
 
diff --git a/meshLibrary/utilities/surfaceTools/meshSurfaceEdgeExtractorFUN/meshSurfaceEdgeExtractorFUN.H b/meshLibrary/utilities/surfaceTools/meshSurfaceEdgeExtractorFUN/meshSurfaceEdgeExtractorFUN.H
index 071238fc..21b16ad1 100644
--- a/meshLibrary/utilities/surfaceTools/meshSurfaceEdgeExtractorFUN/meshSurfaceEdgeExtractorFUN.H
+++ b/meshLibrary/utilities/surfaceTools/meshSurfaceEdgeExtractorFUN/meshSurfaceEdgeExtractorFUN.H
@@ -64,6 +64,9 @@ class meshSurfaceEdgeExtractorFUN
         //- mesh surface pointer
         meshSurfaceEngine* surfaceEnginePtr_;
 
+        //- shall the procedure generate an initial wrapper sheet
+        const bool createWrapperSheet_;
+
     // Private member functions
 
         //- return reference to surface engine
@@ -115,7 +118,8 @@ public:
         meshSurfaceEdgeExtractorFUN
         (
             polyMeshGen& mesh,
-            const meshOctree& octree
+            const meshOctree& octree,
+            const bool createWrapperSheet = true
         );
 
     // Destructor
diff --git a/meshLibrary/utilities/surfaceTools/meshSurfaceEdgeExtractorFUN/meshSurfaceEdgeExtractorFUNDistributeFaces.C b/meshLibrary/utilities/surfaceTools/meshSurfaceEdgeExtractorFUN/meshSurfaceEdgeExtractorFUNDistributeFaces.C
index ae7539c9..462a62ed 100644
--- a/meshLibrary/utilities/surfaceTools/meshSurfaceEdgeExtractorFUN/meshSurfaceEdgeExtractorFUNDistributeFaces.C
+++ b/meshLibrary/utilities/surfaceTools/meshSurfaceEdgeExtractorFUN/meshSurfaceEdgeExtractorFUNDistributeFaces.C
@@ -137,7 +137,7 @@ void meshSurfaceEdgeExtractorFUN::remapBoundaryPoints()
 
 void meshSurfaceEdgeExtractorFUN::createBasicFundamentalSheets()
 {
-    createFundamentalSheetsJFS edgeSheets(mesh_);
+    createFundamentalSheetsJFS edgeSheets(mesh_, createWrapperSheet_);
 
     clearOut();
 }
diff --git a/meshLibrary/voronoiMesh/voronoiMeshGenerator/voronoiMeshGenerator.C b/meshLibrary/voronoiMesh/voronoiMeshGenerator/voronoiMeshGenerator.C
index 685551e4..36c6651f 100644
--- a/meshLibrary/voronoiMesh/voronoiMeshGenerator/voronoiMeshGenerator.C
+++ b/meshLibrary/voronoiMesh/voronoiMeshGenerator/voronoiMeshGenerator.C
@@ -128,8 +128,7 @@ void voronoiMeshGenerator::extractPatches()
 
 void voronoiMeshGenerator::mapEdgesAndCorners()
 {
-    //meshSurfaceEdgeExtractorNonTopo(mesh_, *octreePtr_);
-    meshSurfaceEdgeExtractorFUN(mesh_, *octreePtr_);
+    meshSurfaceEdgeExtractorFUN(mesh_, *octreePtr_, false);
 
     # ifdef DEBUG
     mesh_.write();
-- 
GitLab