Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
lbmpy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pycodegen
lbmpy
Commits
eea295cc
Commit
eea295cc
authored
7 years ago
by
Martin Bauer
Browse files
Options
Downloads
Patches
Plain Diff
Bug fix: LatticeBoltzmannStep ignored float/double parameter
parent
7189a62e
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lbstep.py
+8
-5
8 additions, 5 deletions
lbstep.py
with
8 additions
and
5 deletions
lbstep.py
+
8
−
5
View file @
eea295cc
...
@@ -36,6 +36,8 @@ class LatticeBoltzmannStep:
...
@@ -36,6 +36,8 @@ class LatticeBoltzmannStep:
method_parameters
[
'
stencil
'
]
=
'
D2Q9
'
if
data_handling
.
dim
==
2
else
'
D3Q27
'
method_parameters
[
'
stencil
'
]
=
'
D2Q9
'
if
data_handling
.
dim
==
2
else
'
D3Q27
'
method_parameters
,
optimization
=
update_with_default_parameters
(
method_parameters
,
optimization
)
method_parameters
,
optimization
=
update_with_default_parameters
(
method_parameters
,
optimization
)
field_dtype
=
np
.
float64
if
optimization
[
'
double_precision
'
]
else
np
.
float32
del
method_parameters
[
'
kernel_type
'
]
del
method_parameters
[
'
kernel_type
'
]
if
lbm_kernel
:
if
lbm_kernel
:
...
@@ -55,18 +57,18 @@ class LatticeBoltzmannStep:
...
@@ -55,18 +57,18 @@ class LatticeBoltzmannStep:
self
.
_gpu
=
target
==
'
gpu
'
self
.
_gpu
=
target
==
'
gpu
'
layout
=
optimization
[
'
field_layout
'
]
layout
=
optimization
[
'
field_layout
'
]
self
.
_data_handling
.
add_array
(
self
.
_pdf_arr_name
,
values_per_cell
=
q
,
gpu
=
self
.
_gpu
,
layout
=
layout
,
self
.
_data_handling
.
add_array
(
self
.
_pdf_arr_name
,
values_per_cell
=
q
,
gpu
=
self
.
_gpu
,
layout
=
layout
,
latex_name
=
'
src
'
)
latex_name
=
'
src
'
,
dtype
=
field_dtype
)
self
.
_data_handling
.
add_array
(
self
.
_tmp_arr_name
,
values_per_cell
=
q
,
gpu
=
self
.
_gpu
,
cpu
=
not
self
.
_gpu
,
self
.
_data_handling
.
add_array
(
self
.
_tmp_arr_name
,
values_per_cell
=
q
,
gpu
=
self
.
_gpu
,
cpu
=
not
self
.
_gpu
,
layout
=
layout
,
latex_name
=
'
dst
'
)
layout
=
layout
,
latex_name
=
'
dst
'
,
dtype
=
field_dtype
)
if
velocity_data_name
is
None
:
if
velocity_data_name
is
None
:
self
.
_data_handling
.
add_array
(
self
.
velocity_data_name
,
values_per_cell
=
self
.
_data_handling
.
dim
,
self
.
_data_handling
.
add_array
(
self
.
velocity_data_name
,
values_per_cell
=
self
.
_data_handling
.
dim
,
gpu
=
self
.
_gpu
and
compute_velocity_in_every_step
,
gpu
=
self
.
_gpu
and
compute_velocity_in_every_step
,
layout
=
layout
,
latex_name
=
'
u
'
)
layout
=
layout
,
latex_name
=
'
u
'
,
dtype
=
field_dtype
)
if
density_data_name
is
None
:
if
density_data_name
is
None
:
self
.
_data_handling
.
add_array
(
self
.
density_data_name
,
values_per_cell
=
1
,
self
.
_data_handling
.
add_array
(
self
.
density_data_name
,
values_per_cell
=
1
,
gpu
=
self
.
_gpu
and
compute_density_in_every_step
,
gpu
=
self
.
_gpu
and
compute_density_in_every_step
,
layout
=
layout
,
latex_name
=
'
ρ
'
)
layout
=
layout
,
latex_name
=
'
ρ
'
,
dtype
=
field_dtype
)
if
compute_velocity_in_every_step
:
if
compute_velocity_in_every_step
:
method_parameters
[
'
output
'
][
'
velocity
'
]
=
self
.
_data_handling
.
fields
[
self
.
velocity_data_name
]
method_parameters
[
'
output
'
][
'
velocity
'
]
=
self
.
_data_handling
.
fields
[
self
.
velocity_data_name
]
...
@@ -78,7 +80,8 @@ class LatticeBoltzmannStep:
...
@@ -78,7 +80,8 @@ class LatticeBoltzmannStep:
if
velocity_input_array_name
is
not
None
:
if
velocity_input_array_name
is
not
None
:
method_parameters
[
'
velocity_input
'
]
=
self
.
_data_handling
.
fields
[
velocity_input_array_name
]
method_parameters
[
'
velocity_input
'
]
=
self
.
_data_handling
.
fields
[
velocity_input_array_name
]
if
method_parameters
[
'
omega_output_field
'
]
and
isinstance
(
method_parameters
[
'
omega_output_field
'
],
str
):
if
method_parameters
[
'
omega_output_field
'
]
and
isinstance
(
method_parameters
[
'
omega_output_field
'
],
str
):
method_parameters
[
'
omega_output_field
'
]
=
data_handling
.
add_array
(
method_parameters
[
'
omega_output_field
'
])
method_parameters
[
'
omega_output_field
'
]
=
data_handling
.
add_array
(
method_parameters
[
'
omega_output_field
'
],
dtype
=
field_dtype
)
self
.
kernel_params
=
kernel_params
.
copy
()
self
.
kernel_params
=
kernel_params
.
copy
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment