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

ENH: overset: disallow hole donors. See #810.

parent 70801d7f
......@@ -170,6 +170,7 @@ void Foam::cellCellStencil::globalCellCells
(
const globalIndex& gi,
const polyMesh& mesh,
const boolList& isValidDonor,
const labelList& selectedCells,
labelListList& cellCells,
pointListList& cellCellCentres
......@@ -206,6 +207,14 @@ void Foam::cellCellStencil::globalCellCells
nbrCellCentres
);
boolList nbrIsValidDonor;
syncTools::swapBoundaryCellList
(
mesh,
isValidDonor,
nbrIsValidDonor
);
// 2. Collect cell and all its neighbours
......@@ -224,8 +233,11 @@ void Foam::cellCellStencil::globalCellCells
label compacti = 0;
// First entry is cell itself
if (isValidDonor[celli])
{
stencil[compacti] = globalCellIDs[celli];
stencilPoints[compacti++] = cellCentres[celli];
}
// Other entries are cell neighbours
forAll(cFaces, i)
......@@ -235,10 +247,12 @@ void Foam::cellCellStencil::globalCellCells
label own = faceOwner[facei];
label nbrCelli;
point nbrCc;
bool isValid = false;
if (bFacei >= 0)
{
nbrCelli = nbrGlobalCellIDs[bFacei];
nbrCc = nbrCellCentres[bFacei];
isValid = nbrIsValidDonor[bFacei];
}
else
{
......@@ -246,15 +260,19 @@ void Foam::cellCellStencil::globalCellCells
{
nbrCelli = gi.toGlobal(own);
nbrCc = cellCentres[own];
isValid = isValidDonor[own];
}
else
{
label nei = faceNeighbour[facei];
nbrCelli = gi.toGlobal(nei);
nbrCc = cellCentres[nei];
isValid = isValidDonor[nei];
}
}
if (isValid)
{
SubList<label> current(stencil, compacti);
if (!current.found(nbrCelli))
{
......@@ -262,6 +280,7 @@ void Foam::cellCellStencil::globalCellCells
stencilPoints[compacti++] = nbrCc;
}
}
}
stencil.setSize(compacti);
stencilPoints.setSize(compacti);
}
......
......@@ -195,6 +195,7 @@ public:
(
const globalIndex& gi,
const polyMesh& mesh,
const boolList& isValidDonor,
const labelList& selectedCells,
labelListList& cellCells,
pointListList& cellCellCentres
......
......@@ -1434,6 +1434,16 @@ void Foam::cellCellStencils::inverseDistance::createStencil
// Special value for unused points
const vector greatPoint(GREAT, GREAT, GREAT);
boolList isValidDonor(mesh_.nCells(), true);
forAll(cellTypes_, celli)
{
if (cellTypes_[celli] == HOLE)
{
isValidDonor[celli] = false;
}
}
// Has acceptor been handled already?
bitSet doneAcceptor(interpolationCells_.size());
......@@ -1513,6 +1523,7 @@ void Foam::cellCellStencils::inverseDistance::createStencil
(
globalCells,
mesh_,
isValidDonor,
donorCells,
donorCellCells,
donorCellCentres
......
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