Skip to content

Commit

Permalink
pyvista UniformGrid -> ImageData
Browse files Browse the repository at this point in the history
pyvists 0.43.0 renames UniformGrid to ImageData. See pyvista/pyvista#4518 for details.
Renamed all instances of this for compatability with pyvista 0.43.
Works with pyvista back to and including 0.40.
  • Loading branch information
harrybraviner committed Dec 8, 2023
1 parent e8d2004 commit d7b3b74
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def save_fields_vtk(timestep, fields, output_dir='.', prefix='fields'):
if value.ndim == 2:
dimensions = dimensions + (1,)

grid = pv.UniformGrid(dimensions=dimensions)
grid = pv.ImageData(dimensions=dimensions)

# Add the fields to the grid
for key, value in fields.items():
Expand Down Expand Up @@ -157,7 +157,7 @@ def live_volume_randering(timestep, field):
if field.ndim != 3:
raise ValueError("The input field must be 3D!")
dimensions = field.shape
grid = pv.UniformGrid(dimensions=dimensions)
grid = pv.ImageData(dimensions=dimensions)

# Add the field to the grid
grid['field'] = field.flatten(order='F')
Expand Down Expand Up @@ -207,7 +207,7 @@ def save_BCs_vtk(timestep, BCs, gridInfo, output_dir='.'):
gridDimensions = (gridInfo['nx'] + 1, gridInfo['ny'] + 1, gridInfo['nz'] + 1)
fieldDimensions = (gridInfo['nx'], gridInfo['ny'], gridInfo['nz'])

grid = pv.UniformGrid(dimensions=gridDimensions)
grid = pv.ImageData(dimensions=gridDimensions)

# Dictionary to keep track of encountered BC names
bcNamesCount = {}
Expand Down

0 comments on commit d7b3b74

Please sign in to comment.