Commit 940a5a2b authored by mattijs's avatar mattijs Committed by Andrew Heather
Browse files

ENH: overset: check non-local donors to see if 'better'. See #1183

parent adb83ad6
......@@ -564,7 +564,7 @@ void Foam::cellCellStencils::inverseDistance::markDonors
forAll(tgtCellMap, tgtCelli)
{
label celli = tgtCellMap[tgtCelli];
if (allStencil[celli].empty())
if (srcOverlapProcs.size())
{
treeBoundBox subBb(cellBb(mesh_, celli));
subBb.min() -= smallVec_;
......
......@@ -322,6 +322,7 @@ void Foam::cellCellStencils::trackingInverseDistance::markDonors
PstreamBuffers& pBufs,
const List<treeBoundBoxList>& meshBb,
const PtrList<voxelMeshSearch>& meshSearches,
const labelList& allCellTypes,
const label srcI,
const label tgtI,
......@@ -344,16 +345,22 @@ void Foam::cellCellStencils::trackingInverseDistance::markDonors
forAll(tgtCellMap, tgtCelli)
{
label srcCelli = meshSearch.findCell(tgtCc[tgtCelli]);
if (srcCelli != -1)
if (srcCelli != -1 && allCellTypes[srcCellMap[srcCelli]] != HOLE)
{
label globalDonor = globalCells_.toGlobal(srcCellMap[srcCelli]);
label celli = tgtCellMap[tgtCelli];
// TBD: check for multiple donors. Maybe better one? For
// now check 'nearer' mesh
if (betterDonor(tgtI, allDonor[celli], srcI))
{
allStencil[celli].setSize(1);
allStencil[celli][0] = globalDonor;
allStencil[celli][0] =
globalCells_.toGlobal(srcCellMap[srcCelli]);
allDonor[celli] = srcI;
}
}
}
}
// 2. Send over tgtMesh bits that overlap src and do calculation on
......@@ -393,9 +400,11 @@ void Foam::cellCellStencils::trackingInverseDistance::markDonors
forAll(tgtCellMap, tgtCelli)
{
label celli = tgtCellMap[tgtCelli];
if (allStencil[celli].empty())
if (srcOverlapProcs.size())
{
const treeBoundBox subBb(cellBb(mesh_, celli));
treeBoundBox subBb(cellBb(mesh_, celli));
subBb.min() -= smallVec_;
subBb.max() += smallVec_;
forAll(srcOverlapProcs, i)
{
......@@ -434,7 +443,7 @@ void Foam::cellCellStencils::trackingInverseDistance::markDonors
forAll(samples, sampleI)
{
label srcCelli = meshSearch.findCell(samples[sampleI]);
if (srcCelli != -1)
if (srcCelli != -1 && allCellTypes[srcCellMap[srcCelli]] != HOLE)
{
donors[sampleI] = globalCells_.toGlobal(srcCellMap[srcCelli]);
}
......@@ -469,7 +478,7 @@ void Foam::cellCellStencils::trackingInverseDistance::markDonors
label celli = tgtCellMap[cellIDs[donorI]];
// TBD: check for multiple donors. Maybe better one?
if (allStencil[celli].empty())
if (betterDonor(tgtI, allDonor[celli], srcI))
{
allStencil[celli].setSize(1);
allStencil[celli][0] = globalDonor;
......@@ -798,6 +807,7 @@ bool Foam::cellCellStencils::trackingInverseDistance::update()
pBufs,
meshBb,
meshSearches,
allCellTypes, // to exclude hole donors
tgti,
srci,
......@@ -809,6 +819,7 @@ bool Foam::cellCellStencils::trackingInverseDistance::update()
pBufs,
meshBb,
meshSearches,
allCellTypes, // to exclude hole donors
srci,
tgti,
......
......@@ -108,6 +108,7 @@ protected:
PstreamBuffers& pBufs,
const List<treeBoundBoxList>& meshBb,
const PtrList<voxelMeshSearch>& meshSearches,
const labelList& allCellTypes,
const label srcI,
const label tgtI,
......
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