From 9128f3c51d52911f2207c6dea109ecafd300cfc5 Mon Sep 17 00:00:00 2001 From: simbilod Date: Mon, 25 Nov 2024 00:42:47 -0800 Subject: [PATCH] fix physical parsing --- meshwell/visualization.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/meshwell/visualization.py b/meshwell/visualization.py index 73b04df..3c06d34 100644 --- a/meshwell/visualization.py +++ b/meshwell/visualization.py @@ -121,7 +121,7 @@ def plot2D( i += j # Skip if physicals specified and this group not in them if physicals is not None and "gmsh:physical" in mesh.cell_data_dict: - if id_to_name[group] not in physicals: + if not any(name in physicals for name in id_to_name[group]): continue # Get cells for this physical group if ( @@ -135,7 +135,7 @@ def plot2D( group_cells = mesh.cells_dict["line"] # Get color for this group (cycle through colors if more groups than colors) - color = colors[i % len(colors)] + color = colors[i + 1 % len(colors)] # Get group name for legend group_name = ", ".join(id_to_name[group]) if group in id_to_name else "mesh"