Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Frederik Hennig
lbmpy
Commits
b556372a
Commit
b556372a
authored
Sep 29, 2021
by
Frederik Hennig
Browse files
Reverted API name change
parent
3842b69c
Pipeline
#34471
passed with stages
in 40 minutes and 13 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
lbmpy/macroscopic_value_kernels.py
View file @
b556372a
...
...
@@ -8,11 +8,11 @@ from lbmpy.advanced_streaming.utility import get_accessor, Timestep
def
pdf_initialization_assignments
(
lb_method
,
density
,
velocity
,
pdfs
,
streaming_pattern
=
'pull'
,
timestep
=
Timestep
.
BOTH
,
streaming_pattern
=
'pull'
,
previous_
timestep
=
Timestep
.
BOTH
,
set_pre_collision_pdfs
=
False
):
"""Assignments to initialize the pdf field with equilibrium"""
if
isinstance
(
pdfs
,
Field
):
accessor
=
get_accessor
(
streaming_pattern
,
timestep
)
accessor
=
get_accessor
(
streaming_pattern
,
previous_
timestep
)
if
set_pre_collision_pdfs
:
field_accesses
=
accessor
.
read
(
pdfs
,
lb_method
.
stencil
)
else
:
...
...
@@ -32,10 +32,10 @@ def pdf_initialization_assignments(lb_method, density, velocity, pdfs,
def
macroscopic_values_getter
(
lb_method
,
density
,
velocity
,
pdfs
,
streaming_pattern
=
'pull'
,
timestep
=
Timestep
.
BOTH
,
streaming_pattern
=
'pull'
,
previous_
timestep
=
Timestep
.
BOTH
,
use_pre_collision_pdfs
=
False
):
if
isinstance
(
pdfs
,
Field
):
accessor
=
get_accessor
(
streaming_pattern
,
timestep
)
accessor
=
get_accessor
(
streaming_pattern
,
previous_
timestep
)
if
use_pre_collision_pdfs
:
field_accesses
=
accessor
.
read
(
pdfs
,
lb_method
.
stencil
)
else
:
...
...
lbmpy_tests/advanced_streaming/test_fully_periodic_flow.py
View file @
b556372a
...
...
@@ -105,14 +105,14 @@ def test_fully_periodic_flow(target, stencil, streaming_pattern):
setter
=
macroscopic_values_setter
(
lb_method
,
density
,
velocity
,
pdfs
,
streaming_pattern
=
streaming_pattern
,
timestep
=
zeroth_timestep
)
streaming_pattern
=
streaming_pattern
,
previous_
timestep
=
zeroth_timestep
)
setter_kernel
=
create_kernel
(
setter
,
ghost_layers
=
1
,
target
=
target
).
compile
()
getter_kernels
=
[]
for
t
in
timesteps
:
getter
=
macroscopic_values_getter
(
lb_method
,
density_field
,
velocity_field
,
pdfs
,
streaming_pattern
=
streaming_pattern
,
timestep
=
t
)
streaming_pattern
=
streaming_pattern
,
previous_
timestep
=
t
)
getter_kernels
.
append
(
create_kernel
(
getter
,
ghost_layers
=
1
,
target
=
target
).
compile
())
# Periodicity
...
...
lbmpy_tests/advanced_streaming/test_periodic_pipe_with_force.py
View file @
b556372a
...
...
@@ -106,14 +106,14 @@ class PeriodicPipeFlow:
setter
=
macroscopic_values_setter
(
self
.
lb_method
,
self
.
density
,
self
.
velocity
,
self
.
pdfs
,
streaming_pattern
=
self
.
streaming_pattern
,
timestep
=
self
.
zeroth_timestep
)
streaming_pattern
=
self
.
streaming_pattern
,
previous_
timestep
=
self
.
zeroth_timestep
)
self
.
init_kernel
=
create_kernel
(
setter
,
ghost_layers
=
1
,
target
=
self
.
target
).
compile
()
self
.
getter_kernels
=
[]
for
t
in
self
.
timesteps
:
getter
=
macroscopic_values_getter
(
self
.
lb_method
,
self
.
density_field
,
self
.
velocity_field
,
self
.
pdfs
,
streaming_pattern
=
self
.
streaming_pattern
,
timestep
=
t
)
streaming_pattern
=
self
.
streaming_pattern
,
previous_
timestep
=
t
)
self
.
getter_kernels
.
append
(
create_kernel
(
getter
,
ghost_layers
=
1
,
target
=
self
.
target
).
compile
())
# Periodicity
...
...
lbmpy_tests/centeredcumulant/test_flow_around_sphere.py
View file @
b556372a
...
...
@@ -104,7 +104,7 @@ def flow_around_sphere(stencil, galilean_correction, L_LU, total_steps):
init_eqs
=
pdf_initialization_assignments
(
lb_method
,
1.0
,
initial_velocity
,
pdf_field
,
streaming_pattern
=
streaming_pattern
,
timestep
=
timesteps
[
0
])
previous_
timestep
=
timesteps
[
0
])
init_kernel
=
create_kernel
(
init_eqs
,
target
=
target
).
compile
()
output
=
{
...
...
lbmpy_tests/centeredcumulant/test_periodic_pipe_flow.ipynb
View file @
b556372a
...
...
@@ -99,18 +99,18 @@
self.velocity = (u_x,) * self.dim
self.velocity_field = self.dh.add_array('u', self.dim)
setter = macroscopic_values_setter(
self.lb_method, self.density, self.velocity, self.pdfs,
streaming_pattern=self.streaming_pattern, timestep=self.zeroth_timestep)
streaming_pattern=self.streaming_pattern,
previous_
timestep=self.zeroth_timestep)
self.init_kernel = create_kernel(setter, ghost_layers=1, target=self.target).compile()
self.getter_kernels = []
for t in self.timesteps:
getter = macroscopic_values_getter(
self.lb_method, self.density_field, self.velocity_field, self.pdfs,
streaming_pattern=self.streaming_pattern, timestep=t)
streaming_pattern=self.streaming_pattern,
previous_
timestep=t)
self.getter_kernels.append(create_kernel(getter, ghost_layers=1, target=self.target).compile())
# Periodicity
self.periodicity_handler = LBMPeriodicityHandling(
self.stencil, self.dh, self.pdfs.name, streaming_pattern=self.streaming_pattern)
...
...
@@ -225,11 +225,11 @@
ps.plot.colorbar()
```
%%%% Output: execute_result
<matplotlib.colorbar.Colorbar at 0x7f
a
a51
244c4
0>
<matplotlib.colorbar.Colorbar at 0x7f
d9
a51
311c
0>
%%%% Output: display_data

...
...
@@ -286,11 +286,11 @@
ps.plot.colorbar()
```
%%%% Output: execute_result
<matplotlib.colorbar.Colorbar at 0x7f
aa5077ed3
0>
<matplotlib.colorbar.Colorbar at 0x7f
d9a40bd5e
0>
%%%% Output: display_data

...
...
@@ -349,11 +349,11 @@
ps.plot.colorbar()
```
%%%% Output: execute_result
<matplotlib.colorbar.Colorbar at 0x7f
aa506476a
0>
<matplotlib.colorbar.Colorbar at 0x7f
d99ddf0e2
0>
%%%% Output: display_data

...
...
lbmpy_tests/test_compiled_in_boundaries.ipynb
View file @
b556372a
...
...
@@ -48,11 +48,11 @@
update_rule_aa_odd = update_rule_with_push_boundaries(cr_odd, pdfs, boundaries, streaming_pattern, Timestep.ODD)
getter_assignments = macroscopic_values_getter(update_rule_aa_even.method, velocity=u.center_vector,
pdfs=pdfs, density=None,
streaming_pattern=streaming_pattern,
timestep=Timestep.EVEN)
previous_
timestep=Timestep.EVEN)
getter_kernel = ps.create_kernel(getter_assignments, target=dh.default_target).compile()
even_kernel = ps.create_kernel(update_rule_aa_even, target=dh.default_target, ghost_layers=1).compile()
odd_kernel = ps.create_kernel(update_rule_aa_odd, target=dh.default_target, ghost_layers=1).compile()
```
...
...
@@ -83,11 +83,11 @@
plt.colorbar()
```
%%%% Output: execute_result
<matplotlib.colorbar.Colorbar at 0x7f
7c316778e
0>
<matplotlib.colorbar.Colorbar at 0x7f
0cfc8f5b5
0>
%%%% Output: display_data

...
...
@@ -106,10 +106,10 @@
plt.colorbar()
```
%%%% Output: execute_result
<matplotlib.colorbar.Colorbar at 0x7f
7c30fd9d6
0>
<matplotlib.colorbar.Colorbar at 0x7f
0cfca3ceb
0>
%%%% Output: display_data

...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a 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