Skip to content

Commit

Permalink
Update mesh_util.py (#548)
Browse files Browse the repository at this point in the history
  • Loading branch information
waltersma authored Jul 18, 2023
1 parent 1c6f118 commit e7934ea
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/ansys/meshing/prime/lucid/mesh_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,7 @@ def create_zones_from_labels(
faces_of_label = {}
labels_of_face = {}
label_zone_definitions = {}
lists_of_labels = []
face_zones = []
all_topo = []
for part in self._model.parts:
Expand Down Expand Up @@ -240,11 +241,13 @@ def create_zones_from_labels(
[labels_of_face[face].append(label) for face in faces]
for face in labels_of_face:
name_exists = False
for zone_name in label_zone_definitions:
if set(zone_name) == set(labels_of_face[face]):
for label_list in lists_of_labels:
zone_name = '_'.join(labels_of_face[face])
if set(label_list) == set(labels_of_face[face]):
name_exists = True
label_zone_definitions[zone_name].append(face)
if not name_exists:
lists_of_labels.append(labels_of_face[face])
label_zone_definitions['_'.join(labels_of_face[face])] = [face]
# remove empty labels
if "" in label_zone_definitions:
Expand Down

0 comments on commit e7934ea

Please sign in to comment.