mappedPatchBase: Fix for patches with a single face

Resolves bug report https://bugs.openfoam.org/view.php?id=4152

Patch contributed by Timo Niemi, VTT.
This commit is contained in:
Will Bainbridge
2024-09-17 19:44:28 +01:00
parent 2853f9ddfd
commit 4bcbc28400

View File

@ -168,6 +168,19 @@ void Foam::mappedPatchBase::calcMapping() const
allNearest[alli].data = Foam::sqr(great);
}
}
else if (nbrPolyPatch().size() == 1)
{
const pointField nbrPoints(nbrPatchFaceCentres());
forAll(allPoints, alli)
{
const point& p = allPoints[alli];
allNearest[alli].proci = Pstream::myProcNo();
allNearest[alli].elementi = 0;
allNearest[alli].data = magSqr(nbrPoints[0] - p);
}
}
else
{
const pointField nbrPoints(nbrPatchFaceCentres());