Skip to content
Snippets Groups Projects
Commit 866a9d1b authored by Martin Bauer's avatar Martin Bauer
Browse files

Generalized flag handling & support for flag dependent quantities

- flags can be force when setting boundaries, this is helpful for:
- setting up quantities (e.g. relaxation rate..) dependent on current
  flag configuration
- bit operation fix when pickling: function has to have the same name
  as the python object
parent 24de0cf4
Branches
Tags
No related merge requests found
......@@ -278,8 +278,10 @@ def create_lb_collision_rule(lb_method=None, optimization={}, **kwargs):
if params['velocity_input'] is not None:
eqs = [Assignment(cqc.zeroth_order_moment_symbol, sum(lb_method.pre_collision_pdf_symbols))]
velocity_field = params['velocity_input']
eqs += [Assignment(u_sym, velocity_field(i)) for i, u_sym in enumerate(cqc.first_order_moment_symbols)]
velocity_input = params['velocity_input']
if isinstance(velocity_input, Field):
velocity_input = velocity_input.center_vector
eqs += [Assignment(u_sym, velocity_input[i]) for i, u_sym in enumerate(cqc.first_order_moment_symbols)]
eqs = AssignmentCollection(eqs, [])
collision_rule = lb_method.get_collision_rule(conserved_quantity_equations=eqs)
else:
......
......@@ -37,8 +37,8 @@ def boundary_handling(boundary_handling_obj, slice_obj=None, boundary_name_to_co
'FixedDensity': '#009e73',
}
boundary_names = []
flag_values = []
boundary_names = ['domain']
flag_values = [boundary_handling_obj.flag_interface.domain_flag]
for boundary_obj in boundary_handling_obj.boundary_objects:
boundary_names.append(boundary_obj.name)
flag_values.append(boundary_handling_obj.get_flag(boundary_obj))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment