Skip to content

Commit 58751d0

Browse files
committed
add explicit part_id attribute to InterPartAdjacencyGroup
1 parent 5fefcea commit 58751d0

File tree

3 files changed

+10
-2
lines changed

3 files changed

+10
-2
lines changed

meshmode/distributed.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ def make_remote_group_infos(
173173
inter_part_adj_groups=[
174174
fagrp for fagrp in local_vol_mesh.facial_adjacency_groups[igrp]
175175
if isinstance(fagrp, InterPartAdjacencyGroup)
176-
and fagrp.boundary_tag.part_id == remote_part_id],
176+
and fagrp.part_id == remote_part_id],
177177
vol_elem_indices=np.concatenate([
178178
actx.to_numpy(batch.from_element_indices)
179179
for batch in bdry_conn.groups[igrp].batches]),
@@ -450,7 +450,7 @@ def get_connected_parts(mesh: Mesh) -> "Set[PartID]":
450450
assert mesh.facial_adjacency_groups is not None
451451

452452
return {
453-
grp.boundary_tag.part_id
453+
grp.part_id
454454
for fagrp_list in mesh.facial_adjacency_groups
455455
for grp in fagrp_list
456456
if isinstance(grp, InterPartAdjacencyGroup)}

meshmode/mesh/__init__.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,10 @@ class InterPartAdjacencyGroup(BoundaryAdjacencyGroup):
784784
The boundary tag identifier of this group. Will be an instance of
785785
:class:`~meshmode.mesh.BTAG_PARTITION`.
786786
787+
.. attribute:: part_id
788+
789+
The identifier of the neighboring part.
790+
787791
.. attribute:: elements
788792
789793
Group-local element numbers.
@@ -819,13 +823,15 @@ class InterPartAdjacencyGroup(BoundaryAdjacencyGroup):
819823
.. versionadded:: 2017.1
820824
"""
821825

826+
part_id: PartID
822827
neighbors: np.ndarray
823828
neighbor_faces: np.ndarray
824829
aff_map: AffineMap
825830

826831
def __eq__(self, other):
827832
return (
828833
super().__eq__(other)
834+
and np.array_equal(self.part_id, other.part_id)
829835
and np.array_equal(self.neighbors, other.neighbors)
830836
and np.array_equal(self.neighbor_faces, other.neighbor_faces)
831837
and self.aff_map == other.aff_map)
@@ -837,6 +843,7 @@ def as_python(self):
837843
return self._as_python(
838844
igroup=self.igroup,
839845
boundary_tag=_boundary_tag_as_python(self.boundary_tag),
846+
part_id=self.part_id,
840847
elements=_numpy_array_as_python(self.elements),
841848
element_faces=_numpy_array_as_python(self.element_faces),
842849
neighbors=_numpy_array_as_python(self.neighbors),

meshmode/mesh/processing.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -374,6 +374,7 @@ def _create_self_to_other_adjacency_groups(
374374
InterPartAdjacencyGroup(
375375
igroup=igrp,
376376
boundary_tag=BTAG_PARTITION(neighbor_part_id),
377+
part_id=neighbor_part_id,
377378
elements=elements,
378379
element_faces=element_faces,
379380
neighbors=neighbors,

0 commit comments

Comments
 (0)