Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Frederik Hennig
lbmpy
Commits
231adc92
Commit
231adc92
authored
Oct 11, 2020
by
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
Changes
2
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
lbmpy_tests/advanced_streaming/boundary_debugging.ipynb
deleted
100644 → 0
View file @
1a97248c
This diff is collapsed.
Click to expand it.
lbmpy_tests/advanced_streaming/test_periodic_pipe_with_force.py
View file @
231adc92
...
...
@@ -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 Valu
es
self
.
dh
.
run_kernel
(
self
.
g
et
ter_kernel
s
[
self
.
t_modulus
])
#
Boundari
es
self
.
bh
(
between_timesteps
=
self
.
b
et
ween_timestep
s
[
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
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment