Commit 05aea796 authored by Martin Bauer's avatar Martin Bauer
Browse files

Merge branch 'custom-timeloop-creator' into 'master'

Add custom timeloop_creation_function for LatticeBoltzmannStep

See merge request !20
parents 15bb0e45 bbffc6cb
Pipeline #20912 failed with stages
in 11 minutes and 7 seconds
......@@ -22,7 +22,10 @@ class LatticeBoltzmannStep:
velocity_data_name=None, density_data_name=None, density_data_index=None,
compute_velocity_in_every_step=False, compute_density_in_every_step=False,
velocity_input_array_name=None, time_step_order='stream_collide', flag_interface=None,
alignment_if_vectorized=64, fixed_loop_sizes=True, fixed_relaxation_rates=True, **method_parameters):
alignment_if_vectorized=64, fixed_loop_sizes=True, fixed_relaxation_rates=True,
timeloop_creation_function=TimeLoop, **method_parameters):
self._timeloop_creation_function = timeloop_creation_function
# --- Parameter normalization ---
if data_handling is not None:
......@@ -243,7 +246,7 @@ class LatticeBoltzmannStep:
def get_time_loop(self):
self.pre_run() # make sure GPU arrays are allocated
fixed_loop = TimeLoop(steps=2)
fixed_loop = self._timeloop_creation_function(steps=2)
fixed_loop.add_pre_run_function(self.pre_run)
fixed_loop.add_post_run_function(self.post_run)
fixed_loop.add_single_step_function(self.time_step)
......
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