mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: foamyHexMesh: Correct feature point pair indexing
This commit is contained in:
@ -2218,7 +2218,6 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
|
||||
if
|
||||
(
|
||||
vA->boundaryPoint() && vB->boundaryPoint()
|
||||
&& !isProcBoundaryEdge(eit)
|
||||
&& !ptPairs_.isPointPair(vA, vB)
|
||||
&& !ftPtConformer_.featurePointPairs().isPointPair(vA, vB)
|
||||
)
|
||||
|
||||
@ -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>());
|
||||
|
||||
@ -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);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -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);
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user