diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C index e220556fa59a47cd8235599e6ca6b8c9bbf66926..abe115fef98aa65a3164c235a64a8c5f8adf5fd9 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshCalcDualMesh.C @@ -2218,7 +2218,6 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches if ( vA->boundaryPoint() && vB->boundaryPoint() - && !isProcBoundaryEdge(eit) && !ptPairs_.isPointPair(vA, vB) && !ftPtConformer_.featurePointPairs().isPointPair(vA, vB) ) diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshFeaturePoints.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshFeaturePoints.C index f0c4c7d74662d2227cdec83df9770b977e4b8eba..f142470106b2df432714892cc6985ea36afd9bcd 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshFeaturePoints.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/conformalVoronoiMeshFeaturePoints.C @@ -1160,23 +1160,6 @@ void Foam::conformalVoronoiMesh::insertFeaturePoints(bool distribute) Info<< nl << "Inserting feature points" << endl; - -// Map<label> oldToNewIndices = insertPoints(featureVertices_, distribute); - -// featurePtPairs_.reIndex(oldToNewIndices); - -// forAll(featureVertices_, vI) -// { -// Map<label>::const_iterator iter = -// oldToNewIndices.find(featureVertices_[vI].index()); - -// if (iter != oldToNewIndices.end()) -// { -// featureVertices_[vI].index() = iter(); -// } -// } - - const label preFeaturePointSize(number_of_vertices()); if (Pstream::parRun() && distribute) @@ -1187,7 +1170,10 @@ void Foam::conformalVoronoiMesh::insertFeaturePoints(bool distribute) const List<Vb>& ftPtVertices = ftPtConformer_.featurePointVertices(); // Insert the created points directly as already distributed. - this->DelaunayMesh<Delaunay>::insertPoints(ftPtVertices, true); + Map<label> oldToNewIndices = + this->DelaunayMesh<Delaunay>::insertPoints(ftPtVertices, true); + + ftPtConformer_.reIndexPointPairs(oldToNewIndices); label nFeatureVertices = number_of_vertices() - preFeaturePointSize; reduce(nFeatureVertices, sumOp<label>()); diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/featurePointConformer/featurePointConformer.C b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/featurePointConformer/featurePointConformer.C index 6501d72758ca8466d13e99d2480b1ee74c9765de..fa42d63e1737644cea9661048d4677c6d3b5166c 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/featurePointConformer/featurePointConformer.C +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/featurePointConformer/featurePointConformer.C @@ -609,4 +609,26 @@ void Foam::featurePointConformer::distribute } +void Foam::featurePointConformer::reIndexPointPairs +( + const Map<label>& oldToNewIndices +) +{ + forAll(featurePointVertices_, vI) + { + const label currentIndex = featurePointVertices_[vI].index(); + + Map<label>::const_iterator newIndexIter = + oldToNewIndices.find(currentIndex); + + if (newIndexIter != oldToNewIndices.end()) + { + featurePointVertices_[vI].index() = newIndexIter(); + } + } + + ftPtPairs_.reIndex(oldToNewIndices); +} + + // ************************************************************************* // diff --git a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/featurePointConformer/featurePointConformer.H b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/featurePointConformer/featurePointConformer.H index ddda0959e8b372b2a2ebb487bba74988696deabf..e3c415b7fabe3997d1b7ecb8d8b7313b2b262916 100644 --- a/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/featurePointConformer/featurePointConformer.H +++ b/applications/utilities/mesh/generation/foamyHexMesh/conformalVoronoiMesh/conformalVoronoiMesh/featurePointConformer/featurePointConformer.H @@ -176,6 +176,9 @@ public: //- Distribute the feature point vertices according to the // supplied background mesh void distribute(const backgroundMeshDecomposition& decomposition); + + //- Reindex the feature point pairs using the map. + void reIndexPointPairs(const Map<label>& oldToNewIndices); };