Add numpy arrays to a list so they persist to the time of the VTK write

This commit is contained in:
Patrick Shriwise 2022-07-21 22:24:17 -05:00
parent 925a5f6bb6
commit 8cc815d4f2

View file

@ -248,8 +248,10 @@ class StructuredMesh(MeshBase):
# create VTK arrays for each of
# the data sets
datasets_out = []
for label, dataset in datasets.items():
dataset = np.asarray(dataset).flatten()
datasets_out.append(dataset)
if volume_normalization:
dataset /= self.volumes.flatten()
@ -692,7 +694,7 @@ class RegularMesh(StructuredMesh):
root_cell.fill = lattice
return root_cell, cells
def write_data_to_vtk(self, filename, datasets, volume_normalization=True):
"""Creates a VTK object of the mesh
@ -1605,7 +1607,7 @@ class UnstructuredMesh(MeshBase):
Raises
------
RuntimeError
when the size of a dataset doesn't match the number of cells
when the size of a dataset doesn't match the number of cells
"""
import vtk