Skip to content
Snippets Groups Projects
Commit 302b4443 authored by mattijs's avatar mattijs
Browse files

ENH: mappedPatchBase: support topo changes. Fixes #1676

parent 04fc5295
Branches
Tags
No related merge requests found
...@@ -145,6 +145,14 @@ inline bool Foam::mappedPatchBase::sameRegion() const ...@@ -145,6 +145,14 @@ inline bool Foam::mappedPatchBase::sameRegion() const
inline const Foam::mapDistribute& Foam::mappedPatchBase::map() 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()) if (mapPtr_.empty())
{ {
calcMapping(); calcMapping();
...@@ -159,7 +167,15 @@ inline const Foam::AMIPatchToPatchInterpolation& Foam::mappedPatchBase::AMI ...@@ -159,7 +167,15 @@ inline const Foam::AMIPatchToPatchInterpolation& Foam::mappedPatchBase::AMI
bool forceUpdate bool forceUpdate
) const ) 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(); calcAMI();
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment