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
Map<label> markedPoints(4*this->size());
// Important:
// ~~~~~~~~~~
// In <= 1.5 the meshPoints would be in increasing order but this gives
// problems in processor point synchronisation where we have to find out
// how the opposite side would have allocated points.
// Note:
// ~~~~~
// 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
// how the opposite side would have allocated points. We'll use unsorted
// version to avoid certain ordering problems
dynamicLabelList meshPoints(2*this->size());
forAll(*this, facei)
{
const Face& curPoints = this->operator[](facei);
forAll(curPoints, pointi)
{
markedPoints.insert(curPoints[pointi], -1);
}
}
// Create the storage and store the meshPoints. Mesh points are
// the ones marked by the usage loop above
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)
if (markedPoints.insert(curPoints[pointi], meshPoints.size()))
{
markedPoints.find(pointPatch[pointi])() = pointi;
meshPoints.append(curPoints[pointi]);
}
}
}
forAll(*this, faceI)
{
const Face& curPoints = this->operator[](faceI);
forAll (curPoints, pointI)
{
markedPoints.insert(curPoints[pointI], -1);
}
}
// Transfer to straight list (reuses storage)
meshPointsPtr_ = new labelList(meshPoints, true);
// Create local faces. Note that we start off from copy of original face
// list (even though vertices are overwritten below). This is done so