mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
BUG: meshToMesh: protect neighbours on top of destination
This commit is contained in:
@ -65,15 +65,31 @@ void Foam::meshToMesh::calculateInverseDistanceWeights() const
|
|||||||
|
|
||||||
// if the nearest cell is a boundary cell or there is a direct hit,
|
// if the nearest cell is a boundary cell or there is a direct hit,
|
||||||
// pick up the value
|
// pick up the value
|
||||||
if
|
label directCelli = -1;
|
||||||
(
|
if (m < directHitTol || neighbours.empty())
|
||||||
m < directHitTol // Direct hit
|
|
||||||
|| neighbours.empty()
|
|
||||||
)
|
|
||||||
{
|
{
|
||||||
invDistCoeffs[celli].setSize(1);
|
directCelli = celli;
|
||||||
invDistCoeffs[celli][0] = 1.0;
|
}
|
||||||
V_ += fromMesh_.V()[cellAddressing_[celli]];
|
else
|
||||||
|
{
|
||||||
|
forAll(neighbours, ni)
|
||||||
|
{
|
||||||
|
scalar nm = mag(target - centreFrom[neighbours[ni]]);
|
||||||
|
if (nm < directHitTol)
|
||||||
|
{
|
||||||
|
directCelli = neighbours[ni];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
if (directCelli != -1)
|
||||||
|
{
|
||||||
|
// Direct hit
|
||||||
|
invDistCoeffs[directCelli].setSize(1);
|
||||||
|
invDistCoeffs[directCelli][0] = 1.0;
|
||||||
|
V_ += fromMesh_.V()[cellAddressing_[directCelli]];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user