From 30d1677cd26cc51c6793af6a3d98abcba15e0b95 Mon Sep 17 00:00:00 2001
From: Cristian C Lalescu <Cristian.Lalescu@mpcdf.mpg.de>
Date: Thu, 17 Sep 2020 17:40:47 +0200
Subject: [PATCH] adds comment

---
 cpp/full_code/pressure_stats.cpp | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/cpp/full_code/pressure_stats.cpp b/cpp/full_code/pressure_stats.cpp
index 499dd406..902db331 100644
--- a/cpp/full_code/pressure_stats.cpp
+++ b/cpp/full_code/pressure_stats.cpp
@@ -148,7 +148,13 @@ int pressure_stats<rnumber>::work_on_current_iteration(void)
     else
         stat_group = 0;
 
-    /// define local "compute scalar stats" function
+    /// define local "compute scalar stats" lambda function
+    /// it can't be a simple function, C++ doesn't allow that.
+    /// however, we want a simple function here because this whole block
+    /// consists of code that must be identical when applied to different
+    /// versions of the velocity field (i.e. vel field differently filtered).
+    /// luckily, C++11 allows lambda functions.
+    /// we must explicitly pass the "this" and "stat_group" names to the lambda function.
     auto compute_stats_for_cvelocity = [this, stat_group](std::string stat_prefix)
     {
         /// set scalar to 0
-- 
GitLab