From 8f7ad9130ab77f93cdc0c861342e7027f354aad7 Mon Sep 17 00:00:00 2001
From: Andrew Heather <a.heather@opencfd.co.uk>
Date: Fri, 30 Sep 2016 11:47:38 +0100
Subject: [PATCH] ENH: wallDist - suppress calc if updateInterval is zero

---
 src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C b/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C
index 7d53f566b2d..d13c2bed1a0 100644
--- a/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C
+++ b/src/finiteVolume/fvMesh/wallDist/wallDist/wallDist.C
@@ -197,7 +197,11 @@ const Foam::volVectorField& Foam::wallDist::n() const
 
 bool Foam::wallDist::movePoints()
 {
-    if ((mesh_.time().timeIndex() % updateInterval_) == 0)
+    if
+    (
+        (updateInterval_ != 0)
+     && ((mesh_.time().timeIndex() % updateInterval_) == 0)
+    )
     {
         requireUpdate_ = true;
     }
@@ -227,6 +231,11 @@ bool Foam::wallDist::movePoints()
 void Foam::wallDist::updateMesh(const mapPolyMesh& mpm)
 {
     pdm_->updateMesh(mpm);
+
+    // Force update if performing topology change
+    // Note: needed?
+    // - field would have been mapped, so if using updateInterval option (!= 1)
+    //   live with error associated of not updating and use mapped values?
     requireUpdate_ = true;
     movePoints();
 }
-- 
GitLab