Commit 231adc92 authored by Frederik Hennig's avatar Frederik Hennig
Browse files

Fixed the order of steps in the periodic pipe test case

parent 1a97248c
Pipeline #27242 passed with stage
in 17 minutes and 55 seconds
......@@ -107,7 +107,7 @@ class PeriodicPipeFlow:
# Periodicity
self.periodicity_handler = PeriodicityHandling(
stencil, self.dh, self.pdfs.name,
self.stencil, self.dh, self.pdfs.name,
streaming_pattern=self.streaming_pattern, zeroth_timestep=self.zeroth_timestep)
# Boundary Handling
......@@ -129,14 +129,13 @@ class PeriodicPipeFlow:
self.dh.run_kernel(self.init_kernel)
def step(self):
# Boundaries
self.bh(between_timesteps=self.between_timesteps[self.t_modulus])
# Order matters! First communicate, then boundaries, otherwise
# periodicity handling overwrites reflected populations
# Periodicty
self.periodicity_handler(self.timesteps[self.t_modulus])
# Macroscopic Values
self.dh.run_kernel(self.getter_kernels[self.t_modulus])
# Boundaries
self.bh(between_timesteps=self.between_timesteps[self.t_modulus])
# Here, the next time step begins
self.t_modulus = (self.t_modulus + 1) % len(self.timesteps)
......@@ -148,6 +147,9 @@ class PeriodicPipeFlow:
if not self.inplace:
self.dh.swap(self.pdfs.name, self.pdfs_tmp.name)
# Macroscopic Values
self.dh.run_kernel(self.getter_kernels[self.t_modulus])
def run(self, iterations):
for _ in range(iterations):
self.step()
......@@ -181,5 +183,6 @@ def test_periodic_pipe(stencil, streaming_pattern):
prev_pattern = key[1]
assert_allclose(
u, prev_u,
rtol=1, atol=1e-16,
err_msg=f'Velocity field for {streaming_pattern} differed from {prev_pattern}!')
all_results[(stencil, streaming_pattern)] = u
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