From 302b4443e862a565e031e8ac2437fbf9d9fb0543 Mon Sep 17 00:00:00 2001 From: mattijs Date: Mon, 20 Apr 2020 08:25:03 +0100 Subject: [PATCH] ENH: mappedPatchBase: support topo changes. Fixes #1676 --- .../mappedPolyPatch/mappedPatchBaseI.H | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseI.H b/src/meshTools/mappedPatches/mappedPolyPatch/mappedPatchBaseI.H index 00f508a8f3..93e8c7c7de 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(); }