Skip to content

Commit

Permalink
catch exception
Browse files Browse the repository at this point in the history
  • Loading branch information
joergbuchwald committed Nov 13, 2024
1 parent 5ab9f95 commit 4c3b239
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion VTUinterface/vtuIO.py
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,12 @@ def read_time_series(self, fieldname, pts=None, data_type="point", interpolation
data = {}
vtkdata = vtu.get_data_vtk(pts, data_type=data_type, interpolation_method=interpolation_method)
for field in fieldname:
data[field] = vtk_to_numpy(vtkdata.GetArray(field))
try:
data[field] = vtk_to_numpy(vtkdata.GetArray(field))
except AttributeError:
print("field not found: ", field)
print("available point fields: ", vtu.get_point_field_names())
print("available cell fields: ", vtu.get_cell_field_names())
for j, pt in enumerate(pts):
for field in fieldname:
resp_t[pt][field].append(data[field][j])
Expand Down

0 comments on commit 4c3b239

Please sign in to comment.