From efc4649f128873a0ab131902369d4e76d27ab954 Mon Sep 17 00:00:00 2001 From: Andrew Heather <> Date: Fri, 25 Nov 2022 10:03:39 +0000 Subject: [PATCH] BUG: corrected mappedPatchBase error for multiworld introduced by 945405c32d --- .../mappedPolyPatch/mappedPatchBase.C | 5 ++++- .../mappedPolyPatch/mappedPatchBaseI.H | 15 ++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C index 96fe5fb199..2daa2cb6dd 100644 --- a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C +++ b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBase.C @@ -1048,7 +1048,10 @@ void Foam::mappedPatchBase::calcMapping() const } updateMeshTime().setUpToDate(); - updateSampleMeshTime().setUpToDate(); + if (sameWorld()) + { + updateSampleMeshTime().setUpToDate(); + } } diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseI.H b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseI.H index 9f753e9efa..c2dbee34be 100644 --- a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseI.H +++ b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseI.H @@ -252,9 +252,18 @@ inline bool Foam::mappedPatchBase::upToDate() const { const polyMesh& thisMesh = patch_.boundaryMesh().mesh(); - return - (sameWorld() && sampleMesh().upToDatePoints(updateSampleMeshTime())) - && thisMesh.upToDatePoints(updateMeshTime()); + if (sameWorld()) + { + return + sampleMesh().upToDatePoints(updateSampleMeshTime()) + && thisMesh.upToDatePoints(updateMeshTime()); + } + else + { + // If not the same world we do not know what the other side is doing + // so only check our local side + return thisMesh.upToDatePoints(updateMeshTime()); + } }