BUG: foamyHexMesh: Correct feature point pair indexing

This commit is contained in:
laurence
2013-09-26 15:25:57 +01:00
parent 28dc87ea5c
commit 6f6fdd635d
4 changed files with 29 additions and 19 deletions

View File

@ -2218,7 +2218,6 @@ void Foam::conformalVoronoiMesh::createFacesOwnerNeighbourAndPatches
if
(
vA->boundaryPoint() && vB->boundaryPoint()
&& !isProcBoundaryEdge(eit)
&& !ptPairs_.isPointPair(vA, vB)
&& !ftPtConformer_.featurePointPairs().isPointPair(vA, vB)
)

View File

@ -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>());

View File

@ -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);
}
// ************************************************************************* //

View File

@ -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);
};