Skip to content

Commit

Permalink
mappedPatchBase: Fix for patches with a single face
Browse files Browse the repository at this point in the history
Resolves bug report https://bugs.openfoam.org/view.php?id=4152

Patch contributed by Timo Niemi, VTT.
  • Loading branch information
Will Bainbridge committed Sep 17, 2024
1 parent 2853f9d commit 4bcbc28
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/meshTools/mappedPatches/mappedPatchBase/mappedPatchBase.C
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 4bcbc28

Please sign in to comment.