mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
guarantee 2:1 on non-cubic grids
This commit is contained in:
@ -2875,6 +2875,8 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
|
||||
}
|
||||
|
||||
// 2. Extend to 2:1. I don't understand yet why this is not done
|
||||
// 2. Extend to 2:1. For non-cube cells the scalar distance does not work
|
||||
// so make sure it at least provides 2:1.
|
||||
PackedList<1> refineCell(mesh_.nCells(), 0);
|
||||
forAll(allCellInfo, cellI)
|
||||
{
|
||||
@ -2887,6 +2889,25 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
|
||||
}
|
||||
faceConsistentRefinement(true, refineCell);
|
||||
|
||||
while (true)
|
||||
{
|
||||
label nChanged = faceConsistentRefinement(true, refineCell);
|
||||
|
||||
reduce(nChanged, sumOp<label>());
|
||||
|
||||
if (debug)
|
||||
{
|
||||
Pout<< "hexRef8::consistentSlowRefinement2 : Changed " << nChanged
|
||||
<< " refinement levels due to 2:1 conflicts."
|
||||
<< endl;
|
||||
}
|
||||
|
||||
if (nChanged == 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 3. Convert back to labelList.
|
||||
label nRefined = 0;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user