From b56d84db7949d3216fa5bd7966c61d8e0edfea41 Mon Sep 17 00:00:00 2001
From: laurence <laurence>
Date: Wed, 12 Dec 2012 16:05:03 +0000
Subject: [PATCH] ENH: cvMesh: Update tutorials

---
 tutorials/mesh/cvMesh/blob/system/cvMeshDict  |  26 +----
 tutorials/mesh/cvMesh/flange/Allrun           |   2 +-
 tutorials/mesh/cvMesh/flange/Allrun-parallel  |   3 +-
 .../cvMesh/flange/constant/polyMesh/boundary  |   4 +-
 .../mesh/cvMesh/flange/system/controlDict     |   2 +-
 .../mesh/cvMesh/flange/system/cvMeshDict      |  33 ++----
 .../constant/triSurface/domain.stl            |   2 +-
 .../cvMesh/simpleShapes/system/collapseDict   |  52 +++++++++
 .../cvMesh/simpleShapes/system/controlDict    |   2 +-
 .../cvMesh/simpleShapes/system/cvMeshDict     | 100 ++++--------------
 10 files changed, 93 insertions(+), 133 deletions(-)
 create mode 100644 tutorials/mesh/cvMesh/simpleShapes/system/collapseDict

diff --git a/tutorials/mesh/cvMesh/blob/system/cvMeshDict b/tutorials/mesh/cvMesh/blob/system/cvMeshDict
index 89afe0d0a1a..eda52324f55 100644
--- a/tutorials/mesh/cvMesh/blob/system/cvMeshDict
+++ b/tutorials/mesh/cvMesh/blob/system/cvMeshDict
@@ -125,34 +125,18 @@ motionControl
 {
     defaultCellSize     0.1;
 
-    //cellShapeControl    constantControl;
-    //cellShapeControl    fileControl;
-    cellShapeControl    surfaceControl;
-
-    constantControlCoeffs
-    {
-        cellSize      $defaultCellSize;
-        cellAlignment (1 1 0 0 1 0 0 1 1);
-    }
-
-    fileControlCoeffs
-    {
-        pointFile       "alignmentPoints";
-        sizesFile       "alignmentSizes";
-        alignmentsFile  "alignmentTensors";
-    }
-
-    surfaceControlCoeffs
+    shapeControlFunctions
     {
         blob.stl
         {
-            priority            1;
-            mode                bothSides;
+            type                    searchableSurfaceControl;
+            priority                1;
+            mode                    bothSides;
 
             surfaceCellSizeFunction uniformValue;
             uniformValueCoeffs
             {
-                surfaceCellSize 0.1;
+                surfaceCellSize     $defaultCellSize;
             }
 
             cellSizeFunction        uniform;
diff --git a/tutorials/mesh/cvMesh/flange/Allrun b/tutorials/mesh/cvMesh/flange/Allrun
index 19c22647f53..8e16ed1b00b 100755
--- a/tutorials/mesh/cvMesh/flange/Allrun
+++ b/tutorials/mesh/cvMesh/flange/Allrun
@@ -13,7 +13,7 @@ mv log.topoSet log.topoSet.background
 runApplication subsetMesh -cellSet background -patch walls -overwrite
 
 runApplication cvMesh
-#runApplication collapseEdges -time 100 -collapseFaces
+runApplication collapseEdges -latestTime -collapseFaces
 runApplication checkMesh -latestTime -allGeometry -allTopology
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/mesh/cvMesh/flange/Allrun-parallel b/tutorials/mesh/cvMesh/flange/Allrun-parallel
index 1a4543a316d..f5bedb8935e 100755
--- a/tutorials/mesh/cvMesh/flange/Allrun-parallel
+++ b/tutorials/mesh/cvMesh/flange/Allrun-parallel
@@ -18,8 +18,9 @@ runApplication subsetMesh background -patch walls -overwrite
 runApplication decomposePar
 
 runParallel cvMesh $nProc
+runParallel collapseEdges $nProc -latestTime -collapseFaces
 runParallel checkMesh $nProc -latestTime -allTopology -allGeometry
 
-runApplication reconstructParMesh -constant
+runApplication reconstructParMesh -latestTime
 
 # ----------------------------------------------------------------- end-of-file
diff --git a/tutorials/mesh/cvMesh/flange/constant/polyMesh/boundary b/tutorials/mesh/cvMesh/flange/constant/polyMesh/boundary
index 959eee3b1b7..efe6bfe832f 100644
--- a/tutorials/mesh/cvMesh/flange/constant/polyMesh/boundary
+++ b/tutorials/mesh/cvMesh/flange/constant/polyMesh/boundary
@@ -20,8 +20,8 @@ FoamFile
     walls
     {
         type            wall;
-        nFaces          116;
-        startFace       155;
+        nFaces          126;
+        startFace       207;
     }
 )
 
diff --git a/tutorials/mesh/cvMesh/flange/system/controlDict b/tutorials/mesh/cvMesh/flange/system/controlDict
index 8d709289547..213488e4d87 100644
--- a/tutorials/mesh/cvMesh/flange/system/controlDict
+++ b/tutorials/mesh/cvMesh/flange/system/controlDict
@@ -36,7 +36,7 @@ deltaT          1;
 
 writeControl    timeStep;
 
-writeInterval   100;
+writeInterval   10;
 
 purgeWrite      0;
 
diff --git a/tutorials/mesh/cvMesh/flange/system/cvMeshDict b/tutorials/mesh/cvMesh/flange/system/cvMeshDict
index 5f6671d962a..ea769c8152d 100644
--- a/tutorials/mesh/cvMesh/flange/system/cvMeshDict
+++ b/tutorials/mesh/cvMesh/flange/system/cvMeshDict
@@ -117,37 +117,20 @@ motionControl
 {
     defaultCellSize     0.001;
 
-    //cellShapeControl    constantControl;
-    //cellShapeControl    fileControl;
-    cellShapeControl    surfaceControl;
-
-    constantControlCoeffs
-    {
-        cellSize      0.05;
-        cellAlignment (1 1 0 0 1 0 0 1 1);
-    }
-
-    fileControlCoeffs
-    {
-        pointFile       "";
-        sizesFile       "";
-        alignmentsFile  "";
-    }
-
-    surfaceControlCoeffs
-    //cellSizeControlGeometry
+    shapeControlFunctions
     {
         flange.obj
         {
-            priority            1;
-            mode                inside;
+            type                    searchableSurfaceControl;
+            priority                1;
+            mode                    inside;
             surfaceCellSizeFunction uniformValue;
             uniformValueCoeffs
             {
-                surfaceCellSize     0.001;
+                surfaceCellSize     $defaultCellSize;
             }
 
-            cellSizeFunction    uniform;
+            cellSizeFunction        uniform;
             uniformCoeffs{}
         }
     }
@@ -170,7 +153,7 @@ motionControl
 
     timeChecks                  no;
 
-    maxLoadUnbalance            0.05;
+    maxLoadUnbalance            0.2;
 
     alignmentSearchSpokes       36;
 
@@ -203,7 +186,7 @@ motionControl
 polyMeshFiltering
 {
     filterEdges                 on;
-    filterFaces                 on;
+    filterFaces                 off;
     writeTetDualMesh            false;
 }
 
diff --git a/tutorials/mesh/cvMesh/simpleShapes/constant/triSurface/domain.stl b/tutorials/mesh/cvMesh/simpleShapes/constant/triSurface/domain.stl
index b51c0529144..5650ed20013 100644
--- a/tutorials/mesh/cvMesh/simpleShapes/constant/triSurface/domain.stl
+++ b/tutorials/mesh/cvMesh/simpleShapes/constant/triSurface/domain.stl
@@ -83,4 +83,4 @@ solid ascii
    vertex 1.3 -0.9 1
   endloop
  endfacet
-end solid
+endsolid
diff --git a/tutorials/mesh/cvMesh/simpleShapes/system/collapseDict b/tutorials/mesh/cvMesh/simpleShapes/system/collapseDict
new file mode 100644
index 00000000000..9034677ca9c
--- /dev/null
+++ b/tutorials/mesh/cvMesh/simpleShapes/system/collapseDict
@@ -0,0 +1,52 @@
+/*--------------------------------*- C++ -*----------------------------------*\
+| =========                 |                                                 |
+| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
+|  \\    /   O peration     | Version:  dev                                   |
+|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
+|    \\/     M anipulation  |                                                 |
+\*---------------------------------------------------------------------------*/
+
+FoamFile
+{
+    version         2.0;
+    format          ascii;
+
+    root            "";
+    case            "";
+    instance        "";
+    local           "";
+
+    class           dictionary;
+    object          collapseDict;
+}
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+collapseEdgesCoeffs
+{
+    minimumEdgeLength   1e-6;
+    maximumMergeAngle   180;
+    reductionFactor     0.5;
+}
+
+collapseFacesCoeffs
+{
+    initialFaceLengthFactor                 0.5;
+    reductionFactor                         0.5;
+
+    allowEarlyCollapseToPoint               on;
+    allowEarlyCollapseCoeff                 0.2;
+    guardFraction                           0.1;
+    maxCollapseFaceToPointSideLengthCoeff   0.3;
+}
+
+meshQualityCoeffs
+{
+    #include                    "meshQualityDict";
+    maximumIterations           30;
+    maximumSmoothingIterations  1;
+    maxPointErrorCount          5;
+}
+
+
+// ************************************************************************* //
diff --git a/tutorials/mesh/cvMesh/simpleShapes/system/controlDict b/tutorials/mesh/cvMesh/simpleShapes/system/controlDict
index 05271d052bb..8bbced6c67a 100644
--- a/tutorials/mesh/cvMesh/simpleShapes/system/controlDict
+++ b/tutorials/mesh/cvMesh/simpleShapes/system/controlDict
@@ -34,7 +34,7 @@ deltaT          1;
 
 writeControl    timeStep;
 
-writeInterval   1000;   //10 to see the meshing steps
+writeInterval   80;   // 10 to see the meshing steps
 
 purgeWrite      0;
 
diff --git a/tutorials/mesh/cvMesh/simpleShapes/system/cvMeshDict b/tutorials/mesh/cvMesh/simpleShapes/system/cvMeshDict
index b97c668ee03..99379e62c93 100644
--- a/tutorials/mesh/cvMesh/simpleShapes/system/cvMeshDict
+++ b/tutorials/mesh/cvMesh/simpleShapes/system/cvMeshDict
@@ -126,32 +126,21 @@ surfaceConformation
     // Initial and intermediate controls
     conformationControls
     {
-        // Initial conformation
-        initial
-        {
-            // We've got a point poking through the surface. Don't do any
-            // surface conformation if near feature edge (since feature edge
-            // conformation should have priority)
+        // We've got a point poking through the surface. Don't do any
+        // surface conformation if near feature edge (since feature edge
+        // conformation should have priority)
 
-            // distance to search for near feature edges
-            edgeSearchDistCoeff         2;
+        // distance to search for near feature edges
+        edgeSearchDistCoeff         2;
 
-            // Proximity to a feature edge where a surface hit is
-            //  not created, only the edge conformation is created
-            // - fraction of the local target cell size. Coarse
-            // conformation, initial protrusion tests.
-            surfacePtReplaceDistCoeff   0.5;
+        // Proximity to a feature edge where a surface hit is
+        //  not created, only the edge conformation is created
+        // - fraction of the local target cell size. Coarse
+        // conformation, initial protrusion tests.
+        surfacePtReplaceDistCoeff   0.5;
 
 
-            surfacePtExclusionDistanceCoeff 0.5;
-        }
-
-        // Same for iterations
-        iteration
-        {
-            edgeSearchDistCoeff         1.25;
-            surfacePtReplaceDistCoeff   0.7;
-        }
+        surfacePtExclusionDistanceCoeff 0.5;
 
         // Stop either at maxIterations or if the number of surface pokes
         // is very small (iterationToInitialHitRatioLimit * initial number)
@@ -162,16 +151,6 @@ surfaceConformation
         iterationToInitialHitRatioLimit 0.001;
     }
 
-    coarseConformationControls
-    {
-        $conformationControls;
-    }
-
-    fineConformationControls
-    {
-        $conformationControls;
-    }
-
     // Geometry to mesh to
     geometryToConformTo
     {
@@ -258,21 +237,20 @@ initialPoints
 motionControl
 {
     // Absolute cell size of back ground mesh. This is the maximum cell size.
-    defaultCellSize     0.05;
+    defaultCellSize     0.1;
 
-    cellShapeControl    surfaceControl;
-
-    surfaceControlCoeffs
+    shapeControlFunctions
     {
         coneAndSphere
         {
+            type                searchableSurfaceControl;
             priority            1;
             mode                bothSides;
 
             surfaceCellSizeFunction uniformValue;
             uniformValueCoeffs
             {
-                surfaceCellSize $defaultCellSize;
+                surfaceCellSize 0.075;
             }
 
             cellSizeFunction        uniform;
@@ -282,6 +260,7 @@ motionControl
 
         domain
         {
+            type                searchableSurfaceControl;
             priority            1;
             mode                bothSides;
 
@@ -319,7 +298,7 @@ motionControl
     objOutput                   no;
 
     // Timing and memory usage.
-    timeChecks                  yes;
+    timeChecks                  no;
 
     // Number of rays in plane parallel to nearest surface. Used to detect
     // next closest surfaces. Used to work out alignment (three vectors)
@@ -380,48 +359,9 @@ motionControl
 // Do not change. See cvControls.H
 polyMeshFiltering
 {
-    // Upper limit on the size of faces to be filtered.
-    // fraction of the local target cell size
-    filterSizeCoeff                         0.5;
-
-    // Upper limit on how close two dual vertices can be before
-    // being merged, fraction of the local target cell size
-    mergeClosenessCoeff                     1e-9;
-
-    edgeMergeAngle                          30;
-
-    // To not filter: set maxNonOrtho to 1 (so check fails) and then
-    // set continueFilteringOnBadInitialPolyMesh to false.
-    continueFilteringOnBadInitialPolyMesh   true;
-
-    // When a face is "bad", what fraction should the filterSizeCoeff be
-    // reduced by.  Recursive, so for a filterCount value of fC, the
-    // filterSizeCoeff is reduced by pow(filterErrorReductionCoeff, fC)
-    filterErrorReductionCoeff               0.5;
-
-    // Maximum number of filterCount applications before a face
-    // is not attempted to be filtered
-    filterCountSkipThreshold                4;
-
-    // Maximum number of permissible iterations of the face collapse
-    // algorithm.  The value to choose will be related the maximum number
-    // of points on a face that is to be collapsed and how many faces
-    // around it need to be collapsed.
-    maxCollapseIterations                   25;
-
-    // Maximum number of times an to allow an equal faceSet to be
-    // returned from the face quality assessment before stopping iterations
-    // to break an infinitie loop.
-    maxConsecutiveEqualFaceSets             5;
-    // Remove little steps (almost perp to surface) by collapsing face.
-    surfaceStepFaceAngle                    80;
-    // Do not collapse face to edge if should become edges
-    edgeCollapseGuardFraction               0.3;
-    // Only collapse face to point if high aspect ratio
-    maxCollapseFaceToPointSideLengthCoeff   0.35;
-
-    // Write the tet-dual mesh for post-processing
-    writeTetDualMesh                        yes;
+    filterEdges                 on;
+    filterFaces                 on;
+    writeTetDualMesh            false;
 }
 
 
-- 
GitLab