From 4741594e9ed9666c467d76fa6e345980c7d5eca8 Mon Sep 17 00:00:00 2001
From: MaNyh <7vjitX6DvMk5KJguArQM>
Date: Wed, 1 Jun 2022 00:33:04 +0200
Subject: [PATCH] revive old code for load_mesh as multiBlockMesh combine does
 not return the right format

---
 ntrfc/utils/filehandling/mesh.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ntrfc/utils/filehandling/mesh.py b/ntrfc/utils/filehandling/mesh.py
index 276300c8..63e5ec13 100644
--- a/ntrfc/utils/filehandling/mesh.py
+++ b/ntrfc/utils/filehandling/mesh.py
@@ -16,7 +16,12 @@ def load_mesh(path_to_mesh):
             mesh = pv.UnstructuredGrid(cgns)
         elif str(type(cgns)).find('vtkMultiBlockDataSet') != -1:
             multiBlockMesh = pv.MultiBlock(cgns)
-            mesh = multiBlockMesh.combine()
+            mesh = pv.UnstructuredGrid()
+            for domainId in range(multiBlockMesh.GetNumberOfBlocks()):
+                domain = multiBlockMesh.GetBlock(domainId)
+                for blockId in range(domain.GetNumberOfBlocks()):
+                    block = domain.GetBlock(blockId)
+                    mesh = mesh.merge(block)
     return mesh
 
 
-- 
GitLab