Commit 913d2040 authored by Martin Bauer's avatar Martin Bauer
Browse files

Optional parameters to be passed to update rule (entropic, smagorinsky...)

parent f3e4e123
Pipeline #15320 passed with stage
in 38 seconds
...@@ -24,7 +24,7 @@ cpp_printer = CustomSympyPrinter(dialect='c') ...@@ -24,7 +24,7 @@ cpp_printer = CustomSympyPrinter(dialect='c')
REFINEMENT_SCALE_FACTOR = sp.Symbol("level_scale_factor") REFINEMENT_SCALE_FACTOR = sp.Symbol("level_scale_factor")
def generate_lattice_model(generation_context, class_name, lb_method, refinement_scaling=None, def generate_lattice_model(generation_context, class_name, lb_method, refinement_scaling=None, update_rule_params={},
**create_kernel_params): **create_kernel_params):
# usually a numpy layout is chosen by default i.e. xyzf - which is bad for waLBerla where at least the spatial # usually a numpy layout is chosen by default i.e. xyzf - which is bad for waLBerla where at least the spatial
...@@ -36,7 +36,8 @@ def generate_lattice_model(generation_context, class_name, lb_method, refinement ...@@ -36,7 +36,8 @@ def generate_lattice_model(generation_context, class_name, lb_method, refinement
raise ValueError("Lattice Models can only be generated for CPUs. To generate LBM on GPUs use sweeps directly") raise ValueError("Lattice Models can only be generated for CPUs. To generate LBM on GPUs use sweeps directly")
is_float = not generation_context.double_accuracy is_float = not generation_context.double_accuracy
params, opt_params = update_with_default_parameters({'lb_method': lb_method}, optimization) update_rule_params['lb_method'] = lb_method
params, opt_params = update_with_default_parameters(update_rule_params, optimization)
stencil_name = get_stencil_name(lb_method.stencil) stencil_name = get_stencil_name(lb_method.stencil)
if not stencil_name: if not stencil_name:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment