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
Maja Warlich
lbmpy
Commits
46dfc3f2
Commit
46dfc3f2
authored
Nov 18, 2019
by
Michael Kuron
Browse files
Disable cse_global on create_lb_collision_rule for Sympy < 1.2
parent
9254f55f
Changes
1
Hide whitespace changes
Inline
Side-by-side
lbmpy/creationfunctions.py
View file @
46dfc3f2
...
...
@@ -349,7 +349,13 @@ def create_lb_collision_rule(lb_method=None, optimization={}, **kwargs):
collision_rule
=
cse_in_opposing_directions
(
collision_rule
)
if
cse_global
:
from
pystencils.simp
import
sympy_cse
collision_rule
=
sympy_cse
(
collision_rule
)
sp_ver
=
sp
.
__version__
.
split
(
'.'
)
if
int
(
sp_ver
[
0
])
>
1
or
int
(
sp_ver
[
1
])
>
1
:
collision_rule
=
sympy_cse
(
collision_rule
)
else
:
import
warnings
warnings
.
warn
(
'SymPy versions below 1.2 may perform common subexpression elimination incorrectly on LB'
'collision rules. Ignoring cse_global.'
)
if
params
[
'output'
]
and
params
[
'kernel_type'
]
==
'stream_pull_collide'
:
cqc
=
lb_method
.
conserved_quantity_computation
...
...
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