Bugfix on creating PrimitivePatch::meshPointsPtr_

We must not enforce the order of points on processor patches when collecting
patch points from faces because this occasionally causes ordering errors on two
sides (e.g. in DLB).
This commit is contained in:
Vuko Vukcevic 2019-06-14 14:36:09 +02:00
parent d9cfdea84f
commit 57d3af8960

View file

@ -73,53 +73,28 @@ calcMeshData() const
// number of faces in the patch // number of faces in the patch
Map<label> markedPoints(4*this->size()); Map<label> markedPoints(4*this->size());
// Important: // Important:
// ~~~~~~~~~~ // ~~~~~~~~~~
// In <= 1.5 the meshPoints would be in increasing order but this gives // In <= 1.5 the meshPoints would be in increasing order but this gives
// problems in processor point synchronisation where we have to find out // problems in processor point synchronisation where we have to find out
// how the opposite side would have allocated points. // how the opposite side would have allocated points. We'll use unsorted
// version to avoid certain ordering problems
// Note: dynamicLabelList meshPoints(2*this->size());
// ~~~~~
// This is all garbage. All -ext versions will preserve strong ordering
// HJ, 17/Aug/2010
//- 1.5 code:
// If the point is used, set the mark to 1
forAll(*this, facei) forAll(*this, facei)
{ {
const Face& curPoints = this->operator[](facei); const Face& curPoints = this->operator[](facei);
forAll(curPoints, pointi) forAll(curPoints, pointi)
{ {
markedPoints.insert(curPoints[pointi], -1); if (markedPoints.insert(curPoints[pointi], meshPoints.size()))
{
meshPoints.append(curPoints[pointi]);
}
} }
} }
// Create the storage and store the meshPoints. Mesh points are // Transfer to straight list (reuses storage)
// the ones marked by the usage loop above meshPointsPtr_ = new labelList(meshPoints, true);
meshPointsPtr_ = new labelList(markedPoints.toc());
labelList& pointPatch = *meshPointsPtr_;
// Sort the list to preserve compatibility with the old ordering
sort(pointPatch);
// For every point in map give it its label in mesh points
forAll(pointPatch, pointi)
{
markedPoints.find(pointPatch[pointi])() = pointi;
}
forAll(*this, faceI)
{
const Face& curPoints = this->operator[](faceI);
forAll (curPoints, pointI)
{
markedPoints.insert(curPoints[pointI], -1);
}
}
// Create local faces. Note that we start off from copy of original face // Create local faces. Note that we start off from copy of original face
// list (even though vertices are overwritten below). This is done so // list (even though vertices are overwritten below). This is done so