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
pycodegen
lbmpy
Commits
a416915f
Commit
a416915f
authored
Jan 16, 2020
by
Martin Bauer
Browse files
Fixes for new simplifications
parent
9b169d14
Pipeline
#21086
canceled with stage
in 54 minutes
Changes
4
Pipelines
1
Expand all
Hide whitespace changes
Inline
Side-by-side
doc/notebooks/demo_create_method_from_scratch.ipynb
View file @
a416915f
This diff is collapsed.
Click to expand it.
lbmpy/methods/cumulantbased.py
View file @
a416915f
...
...
@@ -109,7 +109,8 @@ class CumulantBasedLbMethod(AbstractLbMethod):
return
sp
.
Matrix
([
eq
.
rhs
for
eq
in
equilibrium
.
main_assignments
])
def
get_collision_rule
(
self
,
conserved_quantity_equations
=
None
,
moment_subexpressions
=
False
,
pre_collision_subexpressions
=
True
,
post_collision_subexpressions
=
False
):
pre_collision_subexpressions
=
True
,
post_collision_subexpressions
=
False
,
keep_rrs_symbolic
=
None
):
return
self
.
_get_collision_rule_with_relaxation_matrix
(
sp
.
diag
(
*
self
.
relaxation_rates
),
conserved_quantity_equations
,
moment_subexpressions
,
pre_collision_subexpressions
,
...
...
lbmpy/methods/entropic_eq_srt.py
View file @
a416915f
...
...
@@ -77,7 +77,7 @@ class EntropicEquilibriumSRT(AbstractLbMethod):
cr
.
simplification_hints
[
'relaxation_rates'
]
=
[]
return
cr
def
get_collision_rule
(
self
,
conserved_quantity_equations
=
None
):
def
get_collision_rule
(
self
,
conserved_quantity_equations
=
None
,
keep_rrs_symbolic
=
None
):
return
self
.
_get_collision_rule_with_relaxation_rate
(
self
.
_relaxationRate
,
conserved_quantity_equations
=
conserved_quantity_equations
)
...
...
lbmpy_tests/test_srt_trt_simplifications.py
View file @
a416915f
...
...
@@ -14,7 +14,7 @@ from lbmpy.stencils import get_stencil
def
check_method
(
method
,
limits_default
,
limits_cse
):
strategy
=
create_simplification_strategy
(
method
)
strategy_with_cse
=
create_simplification_strategy
(
method
)
strategy_with_cse
=
cse_in_opposing_directions
(
strategy_with_cse
)
strategy_with_cse
.
add
(
cse_in_opposing_directions
)
collision_rule
=
method
.
get_collision_rule
()
ops_default
=
strategy
(
collision_rule
).
operation_count
...
...
@@ -64,4 +64,4 @@ def test_simplifications_trt_d3q19_force_compressible():
o1
,
o2
=
sp
.
symbols
(
"omega_1 omega_2"
)
force_model
=
Guo
([
sp
.
Rational
(
1
,
3
),
sp
.
Rational
(
1
,
2
),
sp
.
Rational
(
1
,
5
)])
method
=
create_trt_with_magic_number
(
get_stencil
(
"D3Q19"
),
o1
,
compressible
=
False
,
force_model
=
force_model
)
check_method
(
method
,
[
2
69
,
28
2
,
1
],
[
24
2
,
17
6
,
1
])
check_method
(
method
,
[
2
70
,
28
3
,
1
],
[
24
3
,
17
7
,
1
])
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