Small bugfix in polyRef.C

When doing pointConsistentRefinement, I've been inserting all mesh points
instead of just the ones sharing a cell which will be refined.
This commit is contained in:
Vuko Vukcevic 2018-01-22 08:58:07 +01:00 committed by Vuko Vukcevic
parent 40ec2b3644
commit 9e0614a5b5

View file

@ -1604,12 +1604,15 @@ Foam::label Foam::polyRef::pointConsistentRefinement
// Collect points // Collect points
forAll (cellPoints, cellI) forAll (cellPoints, cellI)
{ {
// Get current points if (refineCell.get(cellI))
const labelList& curPoints = cellPoints[cellI];
forAll (curPoints, pointI)
{ {
pointsToConsider.insert(curPoints[pointI]); // This cell is marked for refinement get current points
const labelList& curPoints = cellPoints[cellI];
forAll (curPoints, pointI)
{
pointsToConsider.insert(curPoints[pointI]);
}
} }
} }
@ -1628,7 +1631,7 @@ Foam::label Foam::polyRef::pointConsistentRefinement
// Get the cells for this point // Get the cells for this point
const labelList& curCells = pointCells[pointI]; const labelList& curCells = pointCells[pointI];
// Find maximum refinement level for this points // Find maximum refinement level for this point
forAll (curCells, cellI) forAll (curCells, cellI)
{ {
const label curCellI = curCells[cellI]; const label curCellI = curCells[cellI];
@ -1660,7 +1663,7 @@ Foam::label Foam::polyRef::pointConsistentRefinement
const label pointI = iter.key(); const label pointI = iter.key();
// Get the cells for this point // Get the cells for this point
const labelList& curCells = pointCells[iter.key()]; const labelList& curCells = pointCells[pointI];
// Loop through these point cells and set cells for refinement which // Loop through these point cells and set cells for refinement which
// would end up having refinement level smaller than maximum level - 1 // would end up having refinement level smaller than maximum level - 1
@ -1678,17 +1681,6 @@ Foam::label Foam::polyRef::pointConsistentRefinement
refineCell.set(curCellI, 1); refineCell.set(curCellI, 1);
++nChanged; ++nChanged;
} }
else
{
FatalErrorIn
(
"label polyRef::pointConsistentRefinement"
"(PackedList<1>& refineCells) const"
) << "Cell is marked for refinement, but the 4:1 point"
<< " consistency cannot be ensured." << nl
<< "Something went wrong before this step."
<< endl;
}
} }
} }
} }