From 9478ffb8fb8f8dc2e4c54ebe522d197a03633152 Mon Sep 17 00:00:00 2001
From: Markus Holzer <markus.holzer@fau.de>
Date: Thu, 9 Mar 2023 10:55:43 +0100
Subject: [PATCH] Use int64 instead of int32 and small fix

---
 python/waLBerla_tests/test_field.py           | 2 +-
 src/python_coupling/export/FieldExport.impl.h | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/python/waLBerla_tests/test_field.py b/python/waLBerla_tests/test_field.py
index c748e4265..6e3324b17 100644
--- a/python/waLBerla_tests/test_field.py
+++ b/python/waLBerla_tests/test_field.py
@@ -52,7 +52,7 @@ class FieldModuleTest(unittest.TestCase):
     def test_gather(self):
         blocks = createUniformBlockGrid(blocks=(10, 4, 3), cellsPerBlock=(2, 2, 2),
                                         periodic=(True, True, True), oneBlockPerProcess=False)
-        wlb.field.addToStorage(blocks, "test", dtype=np.int32, fSize=3)
+        wlb.field.addToStorage(blocks, "test", dtype=np.int64, fSize=3)
 
         for block in blocks:
             offset_in_global_domain = blocks.transformLocalToGlobal(block, wlb.Cell(0, 0, 0))[:]
diff --git a/src/python_coupling/export/FieldExport.impl.h b/src/python_coupling/export/FieldExport.impl.h
index ad9449849..55d2e9394 100644
--- a/src/python_coupling/export/FieldExport.impl.h
+++ b/src/python_coupling/export/FieldExport.impl.h
@@ -360,7 +360,7 @@ class AddToStorageExporter
  public:
    AddToStorageExporter(const shared_ptr< StructuredBlockForest >& blocks, const std::string& name, py::object& dtype, uint_t fs,
                         uint_t gl, Layout layout, real_t initValue, uint_t alignment)
-      : blocks_(blocks), name_(name), dtype_(dtype), fs_(fs), gl_(gl), layout_(layout), initValue_(initValue), alignment_(alignment), found_(false)
+      : blocks_(blocks), name_(name), dtype_(dtype), fs_(fs), gl_(gl), layout_(layout), initValue_(initValue), alignment_(alignment)
    {}
 
    template< typename FieldType >
@@ -376,8 +376,8 @@ class AddToStorageExporter
          typedef internal::GhostLayerFieldDataHandling< GhostLayerField< T, F_SIZE > > DataHandling;
          auto dataHandling = walberla::make_shared< DataHandling >(blocks_, gl_, initValue_, layout_, alignment_);
          blocks_->addBlockData(dataHandling, name_);
+         found_ = true;
       }
-      found_ = true;
    }
 
    bool successful() const { return found_; }
@@ -391,7 +391,7 @@ class AddToStorageExporter
    Layout layout_;
    real_t initValue_;
    uint_t alignment_;
-   mutable bool found_;
+   mutable bool found_{false};
 };
 
 template< typename... FieldTypes >
-- 
GitLab