Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix triplot for parallel #3762

Merged
merged 1 commit into from
Sep 11, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions firedrake/pyplot/mpl.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,12 @@ def triplot(mesh, axes=None, interior_kw={}, boundary_kw={}):
V = VectorFunctionSpace(mesh, element.family(), 1)
coordinates = assemble(Interpolate(coordinates, V))

coords = toreal(coordinates.dat.data_ro, "real")
coords = toreal(coordinates.dat.data_ro_with_halos, "real")
result = []
interior_kw = dict(interior_kw)
# If the domain isn't a 3D volume, draw the interior.
if tdim <= 2:
cell_node_map = coordinates.cell_node_map().values
cell_node_map = coordinates.cell_node_map().values_with_halo
idx = (tuple(range(tdim + 1)) if not quad else (0, 1, 3, 2)) + (0,)
vertices = coords[cell_node_map[:, idx]]

Expand All @@ -141,12 +141,12 @@ def facet_data(typ):
if typ == "interior":
facets = mesh.interior_facets
node_map = coordinates.interior_facet_node_map()
node_map = node_map.values[:, :node_map.arity//2]
local_facet_ids = facets.local_facet_dat.data_ro[:, :1].reshape(-1)
node_map = node_map.values_with_halo[:, :node_map.arity//2]
local_facet_ids = facets.local_facet_dat.data_ro_with_halos[:, :1].reshape(-1)
elif typ == "exterior":
facets = mesh.exterior_facets
local_facet_ids = facets.local_facet_dat.data_ro
node_map = coordinates.exterior_facet_node_map().values
local_facet_ids = facets.local_facet_dat.data_ro_with_halos
node_map = coordinates.exterior_facet_node_map().values_with_halo
else:
raise ValueError("Unhandled facet type")
mask = np.zeros(node_map.shape, dtype=bool)
Expand Down
Loading