Beispiel #1
0
 def __eq__(self, other):
     return (isinstance(other, Integral)
             and self._integral_type == other._integral_type
             and self._ufl_domain == other._ufl_domain
             and self._subdomain_id == other._subdomain_id
             and self._integrand == other._integrand
             and self._metadata == other._metadata and id_or_none(
                 self._subdomain_data) == id_or_none(other._subdomain_data))
Beispiel #2
0
 def __eq__(self, other):
     "Checks if two Measures are equal."
     return (isinstance(other, Measure) and
             self._integral_type == other._integral_type and
             self._subdomain_id == other._subdomain_id and
             self._domain == other._domain and
             id_or_none(self._subdomain_data) == id_or_none(other._subdomain_data) and
             metadata_equal(self._metadata, other._metadata))
Beispiel #3
0
 def __eq__(self, other):
     return (isinstance(other, Integral) and
             self._integral_type == other._integral_type and
             self._ufl_domain == other._ufl_domain and
             self._subdomain_id == other._subdomain_id and
             self._integrand == other._integrand and
             self._metadata == other._metadata and
             id_or_none(self._subdomain_data) == id_or_none(other._subdomain_data))
Beispiel #4
0
 def __hash__(self):
     # Assuming few collisions by ignoring hash(self._metadata)
     # (a dict is not hashable but we assume it is immutable in practice)
     hashdata = (hash(self._integrand), self._integral_type,
                 hash(self._ufl_domain), self._subdomain_id,
                 id_or_none(self._subdomain_data))
     return hash(hashdata)
Beispiel #5
0
 def __hash__(self):
     "Return a hash value for this Measure."
     hashdata = (self._integral_type,
                 self._subdomain_id,
                 hash(self._domain),
                 metadata_hashdata(self._metadata),
                 id_or_none(self._subdomain_data))
     return hash(hashdata)
Beispiel #6
0
 def __hash__(self):
     # Assuming few collisions by ignoring hash(self._metadata) (a
     # dict is not hashable but we assume it is immutable in
     # practice)
     hashdata = (hash(self._integrand),
                 self._integral_type,
                 hash(self._ufl_domain),
                 self._subdomain_id,
                 id_or_none(self._subdomain_data))
     return hash(hashdata)