BUG: PointEdgeWave: incorrect indexing in handleCollocatedPoints

This commit is contained in:
mattijs
2013-01-17 14:55:13 +00:00
parent 0f05652a98
commit 3b637a0d54

View File

@ -566,7 +566,8 @@ Foam::label Foam::PointEdgeWave<Type, TrackingData>::handleCollocatedPoints()
elems[pointI] = allPointInfo_[meshPoints[pointI]];
}
// Pull slave data onto master. No need to update transformed slots.
// Pull slave data onto master (which might or might not have any
// initialised points). No need to update transformed slots.
slavesMap.distribute(elems, false);
// Combine master data with slave data
@ -597,26 +598,34 @@ Foam::label Foam::PointEdgeWave<Type, TrackingData>::handleCollocatedPoints()
// Extract back onto mesh
forAll(meshPoints, pointI)
{
Type& elem = allPointInfo_[meshPoints[pointI]];
if (elems[pointI].valid(td_))
{
label meshPointI = meshPoints[pointI];
Type& elem = allPointInfo_[meshPointI];
bool wasValid = elem.valid(td_);
// Like updatePoint but bypass Type::updatePoint with its tolerance
// checking
if (!elem.valid(td_) || !elem.equal(elems[pointI], td_))
//if (!elem.valid(td_) || !elem.equal(elems[pointI], td_))
if (!elem.equal(elems[pointI], td_))
{
nEvals_++;
elem = elems[pointI];
// See if element now valid
if (elem.valid(td_))
if (!wasValid && elem.valid(td_))
{
--nUnvisitedPoints_;
}
// Update database of changed points
if (!changedPoint_[pointI])
if (!changedPoint_[meshPointI])
{
changedPoint_[pointI] = true;
changedPoints_[nChangedPoints_++] = pointI;
changedPoint_[meshPointI] = true;
changedPoints_[nChangedPoints_++] = meshPointI;
}
}
}
}