diff --git a/meshmode/discretization/connection/same_mesh.py b/meshmode/discretization/connection/same_mesh.py index 4c64728b3..88b2f6177 100644 --- a/meshmode/discretization/connection/same_mesh.py +++ b/meshmode/discretization/connection/same_mesh.py @@ -33,7 +33,7 @@ def make_same_mesh_connection(actx, to_discr, from_discr): IdentityDiscretizationConnection, DirectDiscretizationConnection) - if from_discr.mesh is not to_discr.mesh: + if from_discr.mesh != to_discr.mesh: raise ValueError("from_discr and to_discr must be based on " "the same mesh") diff --git a/meshmode/mesh/__init__.py b/meshmode/mesh/__init__.py index 2cbaa608c..16112aa88 100644 --- a/meshmode/mesh/__init__.py +++ b/meshmode/mesh/__init__.py @@ -1177,6 +1177,8 @@ def facial_adjacency_groups(self) -> Sequence[Sequence[FacialAdjacencyGroup]]: def __eq__(self, other): return ( + self is other + or ( type(self) == type(other) and np.array_equal(self.vertices, other.vertices) and self.groups == other.groups @@ -1184,7 +1186,7 @@ def __eq__(self, other): and self.element_id_dtype == other.element_id_dtype and self._nodal_adjacency == other._nodal_adjacency and self._facial_adjacency_groups == other._facial_adjacency_groups - and self.is_conforming == other.is_conforming) + and self.is_conforming == other.is_conforming)) def __ne__(self, other): return not self.__eq__(other)