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