From f4bb731687acfe003080e9614c117795d69c71aa Mon Sep 17 00:00:00 2001 From: Patrick Shriwise Date: Thu, 21 Jul 2022 22:29:51 -0500 Subject: [PATCH] Keep outgoing datasets in a list until VTK file is written --- openmc/mesh.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/openmc/mesh.py b/openmc/mesh.py index 601d0ac948..d88f6e363f 100644 --- a/openmc/mesh.py +++ b/openmc/mesh.py @@ -1722,6 +1722,7 @@ class UnstructuredMesh(MeshBase): grid.InsertNextCell(elem.GetCellType(), elem.GetPointIds()) # check that datasets are the correct size + datasets_out = [] if datasets is not None: for name, data in datasets.items(): if data.shape != (self.dimension,): @@ -1739,6 +1740,7 @@ class UnstructuredMesh(MeshBase): # add data to the mesh for name, data in datasets.items(): + datasets_out.append(data) arr = vtk.vtkDoubleArray() arr.SetName(name) arr.SetNumberOfTuples(data.size)