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
bbffc6cb
Commit
bbffc6cb
authored
5 years ago
by
Stephan Seitz
Browse files
Options
Downloads
Patches
Plain Diff
Add custom timeloop_creation_function for LatticeBoltzmannStep
parent
ef7c7239
No related branches found
No related tags found
1 merge request
!20
Add custom timeloop_creation_function for LatticeBoltzmannStep
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
lbmpy/lbstep.py
+5
-2
5 additions, 2 deletions
lbmpy/lbstep.py
with
5 additions
and
2 deletions
lbmpy/lbstep.py
+
5
−
2
View file @
bbffc6cb
...
@@ -22,7 +22,10 @@ class LatticeBoltzmannStep:
...
@@ -22,7 +22,10 @@ class LatticeBoltzmannStep:
velocity_data_name
=
None
,
density_data_name
=
None
,
density_data_index
=
None
,
velocity_data_name
=
None
,
density_data_name
=
None
,
density_data_index
=
None
,
compute_velocity_in_every_step
=
False
,
compute_density_in_every_step
=
False
,
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
,
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 ---
# --- Parameter normalization ---
if
data_handling
is
not
None
:
if
data_handling
is
not
None
:
...
@@ -243,7 +246,7 @@ class LatticeBoltzmannStep:
...
@@ -243,7 +246,7 @@ class LatticeBoltzmannStep:
def
get_time_loop
(
self
):
def
get_time_loop
(
self
):
self
.
pre_run
()
# make sure GPU arrays are allocated
self
.
pre_run
()
# make sure GPU arrays are allocated
fixed_loop
=
T
ime
L
oop
(
steps
=
2
)
fixed_loop
=
self
.
_t
ime
l
oop
_creation_function
(
steps
=
2
)
fixed_loop
.
add_pre_run_function
(
self
.
pre_run
)
fixed_loop
.
add_pre_run_function
(
self
.
pre_run
)
fixed_loop
.
add_post_run_function
(
self
.
post_run
)
fixed_loop
.
add_post_run_function
(
self
.
post_run
)
fixed_loop
.
add_single_step_function
(
self
.
time_step
)
fixed_loop
.
add_single_step_function
(
self
.
time_step
)
...
...
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