diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseI.H b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseI.H index 00f508a8f3059f9e61c5b56808a6527dcd6c27a2..93e8c7c7de87a4aeb12a7c84ac88a60df3ad6edb 100644 --- a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseI.H +++ b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseI.H @@ -145,6 +145,14 @@ inline bool Foam::mappedPatchBase::sameRegion() const inline const Foam::mapDistribute& Foam::mappedPatchBase::map() const { + const polyMesh& thisMesh = patch_.boundaryMesh().mesh(); + bool topoChange = sampleMesh().topoChanging() || thisMesh.topoChanging(); + + if (topoChange) + { + mapPtr_.clear(); + } + if (mapPtr_.empty()) { calcMapping(); @@ -159,7 +167,15 @@ inline const Foam::AMIPatchToPatchInterpolation& Foam::mappedPatchBase::AMI bool forceUpdate ) const { - if (forceUpdate || AMIPtr_.empty()) + const polyMesh& thisMesh = patch_.boundaryMesh().mesh(); + bool topoChange = sampleMesh().topoChanging() || thisMesh.topoChanging(); + + if (topoChange || forceUpdate) + { + AMIPtr_.clear(); + } + + if (AMIPtr_.empty()) { calcAMI(); }