From 13f66313d11cdde2f96af6531f84c16ddeb03d31 Mon Sep 17 00:00:00 2001
From: mattijs <mattijs>
Date: Thu, 28 Mar 2024 14:50:34 +0000
Subject: [PATCH] BUG: redistributePar: restore. Fix AMIInterpolation. fixes
 #3125

Problem was that the zero fvMeshSubset constructed did not reset
the distributed flag.
---
 .../parallelProcessing/redistributePar/redistributePar.C        | 2 --
 .../AMIInterpolation/AMIInterpolation/AMIInterpolation.C        | 2 ++
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/applications/utilities/parallelProcessing/redistributePar/redistributePar.C b/applications/utilities/parallelProcessing/redistributePar/redistributePar.C
index 2b43537186e..23d62c26520 100644
--- a/applications/utilities/parallelProcessing/redistributePar/redistributePar.C
+++ b/applications/utilities/parallelProcessing/redistributePar/redistributePar.C
@@ -727,13 +727,11 @@ autoPtr<mapDistributePolyMesh> redistributeAndWrite
         {
             // A zero-sized mesh with boundaries.
             // This is used to create zero-sized fields.
-            const bool oldParRun = UPstream::parRun(false);
             subsetterPtr.reset(new fvMeshSubset(mesh, zero{}));
             subsetterPtr().subMesh().init(true);
             subsetterPtr().subMesh().globalData();
             subsetterPtr().subMesh().tetBasePtIs();
             subsetterPtr().subMesh().geometricD();
-            UPstream::parRun(oldParRun);
         }
 
 
diff --git a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C
index 50a48a0e91d..b71a9d4237c 100644
--- a/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C
+++ b/src/meshTools/AMIInterpolation/AMIInterpolation/AMIInterpolation.C
@@ -837,6 +837,8 @@ bool Foam::AMIInterpolation::calculate
             << "AMI: no source faces present - no addressing constructed"
             << endl;
 
+        singlePatchProc_ = UPstream::myProcNo(comm_);
+
         return false;
     }
 
-- 
GitLab