Skip to content

Commit 9b154f9

Browse files
committed
bug fix for plot with a distributed mesh
1 parent bd758cb commit 9b154f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

elastodynamicsx/solutions/modalbasis.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,8 @@ def plot(self, function_space:'dolfinx.fem.function_space', which='all', **kwarg
7676
grid = pyvista.UnstructuredGrid(topology, cell_types, geom)
7777
for i, eigM in zip(indexes, eigenmodes):
7878
nbpts = grid.number_of_points
79-
grid['eigenmode_'+str(i)] = elastodynamicsx.plot.get_3D_array_from_nparray(np.array(eigM), nbpts)
79+
with eigM.localForm() as loc_eigM: # Necessary for correct handling of ghosts in parallel
80+
grid['eigenmode_'+str(i)] = elastodynamicsx.plot.get_3D_array_from_nparray(loc_eigM.array, nbpts)
8081

8182
nbcols = int(np.ceil(np.sqrt(indexes.size)))
8283
nbrows = int(np.ceil(indexes.size/nbcols))

0 commit comments

Comments
 (0)