Skip to content
Snippets Groups Projects
Commit 5d7ab621 authored by Markus Holzer's avatar Markus Holzer
Browse files

test

parent 722bfe4d
No related branches found
No related tags found
1 merge request!81add DiffusionDirichlet boundary condition
......@@ -99,10 +99,13 @@ class NoSlip(LbBoundary):
def __call__(self, f_out, f_in, dir_symbol, inv_dir, lb_method, index_field):
return Assignment(f_in(inv_dir[dir_symbol]), f_out(dir_symbol))
def __hash__(self):
return hash(self.name)
def __eq__(self, other):
if not isinstance(other, NoSlip):
return False
return self.name == other.name
return self.__dict__ == other.__dict__
# end class NoSlip
......@@ -210,10 +213,13 @@ class UBB(LbBoundary):
return [Assignment(f_in(inv_dir[direction]),
f_out(direction) - vel_term)]
def __hash__(self):
return hash(self.name)
def __eq__(self, other):
if not isinstance(other, UBB):
return False
return self.name == other.name
return self.__dict__ == other.__dict__
# end class UBB
......@@ -263,10 +269,13 @@ class SimpleExtrapolationOutflow(LbBoundary):
return Assignment(f_in.center(inv_dir[dir_symbol]), f_out[tangential_offset](inv_dir[dir_symbol]))
def __hash__(self):
return hash(self.name)
def __eq__(self, other):
if not isinstance(other, SimpleExtrapolationOutflow):
return False
return self.name == other.name
return self.__dict__ == other.__dict__
# end class SimpleExtrapolationOutflow
......@@ -416,10 +425,13 @@ class ExtrapolationOutflow(LbBoundary):
return AssignmentCollection(boundary_assignments, subexpressions=subexpressions)
def __hash__(self):
return hash(self.name)
def __eq__(self, other):
if not isinstance(other, ExtrapolationOutflow):
return False
return self.name == other.name
return self.__dict__ == other.__dict__
# end class ExtrapolationOutflow
......@@ -475,10 +487,13 @@ class FixedDensity(LbBoundary):
return subexpressions + [Assignment(f_in(inv_dir[dir_symbol]),
2 * eq_component - f_out(dir_symbol))]
def __hash__(self):
return hash(self.name)
def __eq__(self, other):
if not isinstance(other, FixedDensity):
return False
return self.name == other.name
return self.__dict__ == other.__dict__
# end class FixedDensity
......@@ -515,10 +530,13 @@ class DiffusionDirichlet(LbBoundary):
return [Assignment(f_in(inv_dir[dir_symbol]),
2 * w_dir * self.concentration - f_out(dir_symbol))]
def __hash__(self):
return hash(self.name)
def __eq__(self, other):
if not isinstance(other, DiffusionDirichlet):
return False
return self.name == other.name
return self.__dict__ == other.__dict__
# end class DiffusionDirichlet
......@@ -544,10 +562,13 @@ class NeumannByCopy(LbBoundary):
return [Assignment(f_in(inv_dir[dir_symbol]), f_out(inv_dir[dir_symbol])),
Assignment(f_out[neighbour_offset](dir_symbol), f_out(dir_symbol))]
def __hash__(self):
return hash(self.name)
def __eq__(self, other):
if not isinstance(other, NeumannByCopy):
return False
return self.name == other.name
return self.__dict__ == other.__dict__
# end class NeumannByCopy
......@@ -582,9 +603,12 @@ class StreamInConstant(LbBoundary):
return [Assignment(f_in(inv_dir[dir_symbol]), self.constant),
Assignment(f_out[neighbour_offset](dir_symbol), self.constant)]
def __hash__(self):
return hash(self.name)
def __eq__(self, other):
if not isinstance(other, StreamInConstant):
return False
return self.name == other.name
return self.__dict__ == other.__dict__
# end class StreamInConstant
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment