Skip to content
Snippets Groups Projects
Commit 3eb17be4 authored by Martin Bauer's avatar Martin Bauer
Browse files

Python field export: gather function changed

parent c24a7946
Branches
Tags
No related merge requests found
...@@ -79,15 +79,17 @@ def copyArrayToField(dstField, srcArray, slice=[slice(None,None,None) ]*3, withG ...@@ -79,15 +79,17 @@ def copyArrayToField(dstField, srcArray, slice=[slice(None,None,None) ]*3, withG
def extend(cppFieldModule): 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) field = cppFieldModule.gather(blocks, blockDataName, sliceObj, targetRank=-1 if allGather else 0)
if field is not None: if field is not None:
field = npArrayFromWaLBerlaField(field) field = npArrayFromWaLBerlaField(field)
field.flags.writeable = False field.flags.writeable = False
yield field return field
else:
return None
cppFieldModule.toArray = npArrayFromWaLBerlaField cppFieldModule.toArray = npArrayFromWaLBerlaField
cppFieldModule.adaptorToArray = arrayFromWaLBerlaAdaptor cppFieldModule.adaptorToArray = arrayFromWaLBerlaAdaptor
cppFieldModule.copyArrayToField = copyArrayToField cppFieldModule.copyArrayToField = copyArrayToField
cppFieldModule.gatherGenerator = gatherGenerator cppFieldModule.gatherField = gatherField
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment