diff --git a/src/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C b/src/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C index 756df8f00e..05372e2cd0 100644 --- a/src/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C +++ b/src/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.C @@ -192,30 +192,7 @@ void Foam::conformalVoronoiMesh::insertEdgePointGroups geometryToConformTo_.features()[featuresHit[i]] ); - label edgeI = edgeHits[i].index(); - - featureEdgeMesh::edgeStatus edStatus = feMesh.getEdgeStatus(edgeI); - - if (edStatus == featureEdgeMesh::EXTERNAL) - { - insertExternalEdgePointGroup(feMesh, edgeHits[i]); - } - else if (edStatus == featureEdgeMesh::INTERNAL) - { - insertInternalEdgePointGroup(feMesh, edgeHits[i]); - } - else if (edStatus == featureEdgeMesh::FLAT) - { - insertFlatEdgePointGroup(feMesh, edgeHits[i]); - } - else if (edStatus == featureEdgeMesh::OPEN) - { - insertOpenEdgePointGroup(feMesh, edgeHits[i]); - } - else if (edStatus == featureEdgeMesh::MULTIPLE) - { - insertMultipleEdgePointGroup(feMesh, edgeHits[i]); - } + insertEdgePointGroup(feMesh, edgeHits[i]); } if (fName != fileName::null) @@ -232,6 +209,39 @@ void Foam::conformalVoronoiMesh::insertEdgePointGroups } +void Foam::conformalVoronoiMesh::insertEdgePointGroup +( + const featureEdgeMesh& feMesh, + const pointIndexHit& edHit +) +{ + label edgeI = edHit.index(); + + featureEdgeMesh::edgeStatus edStatus = feMesh.getEdgeStatus(edgeI); + + if (edStatus == featureEdgeMesh::EXTERNAL) + { + insertExternalEdgePointGroup(feMesh, edHit); + } + else if (edStatus == featureEdgeMesh::INTERNAL) + { + insertInternalEdgePointGroup(feMesh, edHit); + } + else if (edStatus == featureEdgeMesh::FLAT) + { + insertFlatEdgePointGroup(feMesh, edHit); + } + else if (edStatus == featureEdgeMesh::OPEN) + { + insertOpenEdgePointGroup(feMesh, edHit); + } + else if (edStatus == featureEdgeMesh::MULTIPLE) + { + insertMultipleEdgePointGroup(feMesh, edHit); + } +} + + void Foam::conformalVoronoiMesh::insertExternalEdgePointGroup ( const featureEdgeMesh& feMesh, @@ -287,7 +297,7 @@ void Foam::conformalVoronoiMesh::insertInternalEdgePointGroup point refPt = edgePt - ppDist*(nA + nB)/(1 + (nA & nB) + VSMALL ); // Generate reflected master to be outside. - point reflMasterPt = edgePt + 2*(edgePt - refPt); + point reflMasterPt = refPt + 2*(edgePt - refPt); // Reflect reflMasterPt in both faces. point reflectedA = reflMasterPt - 2*ppDist*nA; @@ -493,6 +503,23 @@ void Foam::conformalVoronoiMesh::insertConcaveFeaturePoints() void Foam::conformalVoronoiMesh::insertMixedFeaturePoints() { Info<< " Mixed feature points not implemented." << endl; + + // const PtrList& feMeshes(geometryToConformTo_.features()); + + // forAll(feMeshes, i) + // { + // const featureEdgeMesh& feMesh(feMeshes[i]); + + // for + // ( + // label pI = feMesh.mixedStart(); + // pI < feMesh.nonFeatureStart(); + // pI++ + // ) + // { + + // } + // } } @@ -1414,12 +1441,14 @@ void Foam::conformalVoronoiMesh::conformToSurface() label iterationNo = 0; - label maxIterations = 8; - Info << " MAX INTERATIONS HARD CODED TO "<< maxIterations << endl; + label maxIterations = 5; + Info << " MAX ITERATIONS HARD CODED TO "<< maxIterations << endl; - label totalHits = 0; + // Set totalHits to a positive value to enter the while loop on the first + // iteration + label totalHits = 1; - do + while (totalHits > 0 && iterationNo < maxIterations) { Info<< " EDGE DISTANCE COEFFS HARD-CODED." << endl; scalar edgeSearchDistCoeffSqr = sqr(1.25); @@ -1539,8 +1568,7 @@ void Foam::conformalVoronoiMesh::conformToSurface() } iterationNo++; - - } while (totalHits > 0 && iterationNo < maxIterations); + } } diff --git a/src/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H b/src/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H index e5fe7b4ac3..601716fbde 100644 --- a/src/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H +++ b/src/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMesh.H @@ -172,6 +172,13 @@ class conformalVoronoiMesh const fileName fName = fileName::null ); + //- Call the appropriate function to conform to an edge + void insertEdgePointGroup + ( + const featureEdgeMesh& feMesh, + const pointIndexHit& edHit + ); + //- Insert points to conform to an external edge void insertExternalEdgePointGroup (