From 3eb17be460c5124a765ff22aa1cdd376debbcb93 Mon Sep 17 00:00:00 2001
From: Martin Bauer <martin.bauer@fau.de>
Date: Tue, 30 Jan 2018 14:46:23 +0100
Subject: [PATCH] Python field export: gather function changed

---
 python/waLBerla/field_extension.py | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/python/waLBerla/field_extension.py b/python/waLBerla/field_extension.py
index 3ec291da6..aa1be40cb 100644
--- a/python/waLBerla/field_extension.py
+++ b/python/waLBerla/field_extension.py
@@ -79,15 +79,17 @@ def copyArrayToField(dstField, srcArray, slice=[slice(None,None,None) ]*3, withG
 
 
 def extend(cppFieldModule):
-    def gatherGenerator(blocks, blockDataName, sliceObj, allGather=False):
+    def gatherField(blocks, blockDataName, sliceObj, allGather=False):
         field = cppFieldModule.gather(blocks, blockDataName, sliceObj, targetRank=-1 if allGather else 0)
         if field is not None:
             field = npArrayFromWaLBerlaField(field)
             field.flags.writeable = False
-            yield field
+            return field
+        else:
+            return None
 
 
     cppFieldModule.toArray          = npArrayFromWaLBerlaField
     cppFieldModule.adaptorToArray   = arrayFromWaLBerlaAdaptor
     cppFieldModule.copyArrayToField = copyArrayToField
-    cppFieldModule.gatherGenerator  = gatherGenerator
+    cppFieldModule.gatherField      = gatherField
-- 
GitLab