Commit 46dfc3f2 authored by Michael Kuron's avatar Michael Kuron
Browse files

Disable cse_global on create_lb_collision_rule for Sympy < 1.2

parent 9254f55f
......@@ -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)
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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment