From 368e06e611b694824c63a9cf23a7bcda8dc46cee Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 10 Dec 2013 16:58:57 +0000 Subject: [PATCH 01/21] STYLE: Minor code formatting --- .../surfaceInterpolation/schemes/CoBlended/CoBlended.H | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H index e8ed67a9d8..8d420950b0 100644 --- a/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H +++ b/src/finiteVolume/interpolation/surfaceInterpolation/schemes/CoBlended/CoBlended.H @@ -170,7 +170,7 @@ public: ( surfaceInterpolationScheme::New(mesh, faceFlux, is) ), - faceFlux_(faceFlux) + faceFlux_(faceFlux) { if (Co1_ < 0 || Co2_ < 0 || Co1_ >= Co2_) { From 06e3f4fad1f8d43f26cdc0ae76f5c208ec5172e1 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 11 Dec 2013 16:08:00 +0000 Subject: [PATCH 02/21] STYLE: splitMeshRegions: removed comment out code --- .../mesh/manipulation/splitMeshRegions/splitMeshRegions.C | 2 -- 1 file changed, 2 deletions(-) diff --git a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C index 9771757c9e..6d7b9fe688 100644 --- a/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C +++ b/applications/utilities/mesh/manipulation/splitMeshRegions/splitMeshRegions.C @@ -1078,7 +1078,6 @@ labelList addRegionPatches mesh.boundaryMesh() ); - //interfacePatches[interI] = addPatch(mesh, patch1); interfacePatches[interI] = fvMeshTools::addPatch ( mesh, @@ -1100,7 +1099,6 @@ labelList addRegionPatches point::zero, // offset mesh.boundaryMesh() ); - //addPatch(mesh, patch2); fvMeshTools::addPatch ( mesh, From 8a19a5545e2c73ce8055a432484764bc519bac20 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 11 Dec 2013 16:33:35 +0000 Subject: [PATCH 03/21] STYLE: SurfaceFilmModel: unused include file --- .../SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C | 1 - .../SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H | 2 -- 2 files changed, 3 deletions(-) diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C index 8d1729361e..51272f3560 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.C @@ -26,7 +26,6 @@ License #include "SurfaceFilmModel.H" #include "surfaceFilmModel.H" #include "mathematicalConstants.H" -#include "mappedPatchBase.H" using namespace Foam::constant; diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H index 0f0a4d4196..9098782204 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H @@ -55,8 +55,6 @@ namespace regionModels } } -class mappedPatchBase; - /*---------------------------------------------------------------------------*\ Class SurfaceFilmModel Declaration \*---------------------------------------------------------------------------*/ From a67830e919a0fe81a2b16497b280d04083a1b0fe Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 11 Dec 2013 16:34:36 +0000 Subject: [PATCH 04/21] STYLE: refinementFeatures: typo --- .../autoHexMesh/refinementFeatures/refinementFeatures.C | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesh/autoMesh/autoHexMesh/refinementFeatures/refinementFeatures.C b/src/mesh/autoMesh/autoHexMesh/refinementFeatures/refinementFeatures.C index f3d969e691..a5109bc3c8 100644 --- a/src/mesh/autoMesh/autoHexMesh/refinementFeatures/refinementFeatures.C +++ b/src/mesh/autoMesh/autoHexMesh/refinementFeatures/refinementFeatures.C @@ -303,7 +303,7 @@ Foam::refinementFeatures::refinementFeatures Info<< "Detected " << featurePoints.size() << " featurePoints out of " << pointEdges.size() - << " on feature " << eMesh.name() << endl; + << " points on feature " << eMesh.name() << endl; buildTrees(i, featurePoints); } @@ -372,7 +372,7 @@ Foam::refinementFeatures::refinementFeatures Info<< "Detected " << featurePoints.size() << " featurePoints out of " << points.size() - << " on feature " << eMesh.name() + << " points on feature " << eMesh.name() << " when using feature cos " << minCos << endl; buildTrees(i, featurePoints); From 9a446b3cbc9341e0e9bf06867921fd5c5e3ee345 Mon Sep 17 00:00:00 2001 From: mattijs Date: Wed, 11 Dec 2013 16:34:56 +0000 Subject: [PATCH 05/21] ENH: autoHexMesh: switchable island detection --- .../medialAxisMeshMover.C | 137 ++++++++++++++---- .../medialAxisMeshMover.H | 1 + 2 files changed, 110 insertions(+), 28 deletions(-) diff --git a/src/mesh/autoMesh/autoHexMesh/externalDisplacementMeshMover/medialAxisMeshMover.C b/src/mesh/autoMesh/autoHexMesh/externalDisplacementMeshMover/medialAxisMeshMover.C index eb223c8841..b2a142accf 100644 --- a/src/mesh/autoMesh/autoHexMesh/externalDisplacementMeshMover/medialAxisMeshMover.C +++ b/src/mesh/autoMesh/autoHexMesh/externalDisplacementMeshMover/medialAxisMeshMover.C @@ -66,7 +66,6 @@ Foam::labelList Foam::medialAxisMeshMover::getFixedValueBCs if (isA >(patchFld)) { adaptPatchIDs.append(patchI); - //Info<< "Detected adapt patch " << patchFld.patch().name() << endl; } } return adaptPatchIDs; @@ -1259,6 +1258,7 @@ handleFeatureAngleLayerTerminations void Foam::medialAxisMeshMover::findIsolatedRegions ( const scalar minCosLayerTermination, + const bool detectExtrusionIsland, const PackedBoolList& isMasterPoint, const PackedBoolList& isMasterEdge, const labelList& meshEdges, @@ -1268,6 +1268,8 @@ void Foam::medialAxisMeshMover::findIsolatedRegions ) const { const indirectPrimitivePatch& pp = adaptPatchPtr_(); + const labelListList& pointFaces = pp.pointFaces(); + Info<< typeName << " : Removing isolated regions ..." << endl; @@ -1292,40 +1294,110 @@ void Foam::medialAxisMeshMover::findIsolatedRegions syncPatchDisplacement(minThickness, patchDisp, extrudeStatus); - // Do not extrude from point where all neighbouring - // faces are not grown - // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - boolList extrudedFaces(pp.size(), true); - forAll(pp.localFaces(), faceI) - { - const face& f = pp.localFaces()[faceI]; - forAll(f, fp) - { - if (extrudeStatus[f[fp]] == autoLayerDriver::NOEXTRUDE) - { - extrudedFaces[faceI] = false; - break; - } - } - } - const labelListList& pointFaces = pp.pointFaces(); + // Detect either: + // - point where all surrounding points are not extruded + // (detectExtrusionIsland) + // or + // - point where all the faces surrounding it are not fully + // extruded boolList keptPoints(pp.nPoints(), false); - forAll(keptPoints, patchPointI) - { - const labelList& pFaces = pointFaces[patchPointI]; - forAll(pFaces, i) + if (detectExtrusionIsland) + { + // Do not extrude from point where all neighbouring + // points are not grown + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + labelList islandPoint(pp.size(), -1); + forAll(pp, faceI) { - label faceI = pFaces[i]; - if (extrudedFaces[faceI]) + const face& f = pp.localFaces()[faceI]; + + forAll(f, fp) { - keptPoints[patchPointI] = true; - break; + label patchPointI = f[fp]; + + if (extrudeStatus[f[fp]] != autoLayerDriver::NOEXTRUDE) + { + if (islandPoint[faceI] == -1) + { + // First point to extrude + islandPoint[faceI] = patchPointI; + } + else + { + // Second or more point to extrude + islandPoint[faceI] = -2; + } + } + } + } + + // islandPoint: + // -1 : no point extruded + // -2 : >= 2 points extruded + // >=0: label of point extruded + + // Check all surrounding faces that I am the islandPoint + boolList keptPoints(pp.nPoints(), false); + forAll(pointFaces, patchPointI) + { + if (extrudeStatus[patchPointI] != autoLayerDriver::NOEXTRUDE) + { + const labelList& pFaces = pointFaces[patchPointI]; + + forAll(pFaces, i) + { + label faceI = pFaces[i]; + if (islandPoint[faceI] != patchPointI) + { + keptPoints[patchPointI] = true; + break; + } + } } } } + else + { + // Do not extrude from point where all neighbouring + // faces are not grown + // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + + boolList extrudedFaces(pp.size(), true); + forAll(pp.localFaces(), faceI) + { + const face& f = pp.localFaces()[faceI]; + forAll(f, fp) + { + if (extrudeStatus[f[fp]] == autoLayerDriver::NOEXTRUDE) + { + extrudedFaces[faceI] = false; + break; + } + } + } + + const labelListList& pointFaces = pp.pointFaces(); + + forAll(keptPoints, patchPointI) + { + const labelList& pFaces = pointFaces[patchPointI]; + + forAll(pFaces, i) + { + label faceI = pFaces[i]; + if (extrudedFaces[faceI]) + { + keptPoints[patchPointI] = true; + break; + } + } + } + } + syncTools::syncPointList ( @@ -1344,8 +1416,8 @@ void Foam::medialAxisMeshMover::findIsolatedRegions { if (unmarkExtrusion(patchPointI, patchDisp, extrudeStatus)) { - nPointCounter++; - nChanged++; + nPointCounter++; + nChanged++; } } } @@ -1701,6 +1773,13 @@ void Foam::medialAxisMeshMover::calculateDisplacement mesh().globalData().nTotalPoints() ); + //- Use strick extrusionIsland detection + const Switch detectExtrusionIsland = coeffDict.lookupOrDefault