I want to make npy matrix from unstructured vtu data, and the following is the code for it.
file_name = 'data/0_0000.vtu'
reader = vtk.vtkXMLUnstructuredGridReader()
reader.SetFileName(file_name)
reader.Update()
polydata = reader.GetOutput()
points = polydata.GetPoints()
array1 = vtk_to_numpy(points.GetData())
cells = polydata.GetCells()
array2 = vtk_to_numpy(cells.GetData())
velocity = vtk_to_numpy(polydata.GetCellData().GetArray("velocity"))
But after I ran this code, it only convert the data partially, not fully. The vtu file contains more than 30000 cells but somehow only 4000 cells were converted.
Could anyone help me to solve this problem?
Thanks!