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:
parent
40ec2b3644
commit
9e0614a5b5
1 changed files with 10 additions and 18 deletions
|
@ -1604,7 +1604,9 @@ Foam::label Foam::polyRef::pointConsistentRefinement
|
||||||
// Collect points
|
// Collect points
|
||||||
forAll (cellPoints, cellI)
|
forAll (cellPoints, cellI)
|
||||||
{
|
{
|
||||||
// Get current points
|
if (refineCell.get(cellI))
|
||||||
|
{
|
||||||
|
// This cell is marked for refinement get current points
|
||||||
const labelList& curPoints = cellPoints[cellI];
|
const labelList& curPoints = cellPoints[cellI];
|
||||||
|
|
||||||
forAll (curPoints, pointI)
|
forAll (curPoints, pointI)
|
||||||
|
@ -1612,6 +1614,7 @@ Foam::label Foam::polyRef::pointConsistentRefinement
|
||||||
pointsToConsider.insert(curPoints[pointI]);
|
pointsToConsider.insert(curPoints[pointI]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Maximum cell refinement level for each point
|
// Maximum cell refinement level for each point
|
||||||
labelList maxRefLevel(mesh_.nPoints(), 0);
|
labelList maxRefLevel(mesh_.nPoints(), 0);
|
||||||
|
@ -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;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue