Commit 0fe10dcf authored by mattijs's avatar mattijs
Browse files

guarantee 2:1 on non-cubic grids

parent 29d67c32
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment