Disable cse_global on create_lb_collision_rule for Sympy < 1.2
I have this weird problem with cse_global
and the fluctuating LB. It works fine with SymPy 1.2 and produces wrong temperatures with SymPy 1.1.1. I have bisected it down to this change: https://github.com/sympy/sympy/pull/13221. My patch disables cse_global
if it's enabled and displays a warning on the incriminating SymPy version. I used Mathematica to plug the subexpressions back into the main expressions and get the same thing with both SymPy versions, so I have no idea what the actual problem is. Thus I can't rule out that it only occurs with the fluctuating LB. Until we know for sure, it seems safest to just disable cse_global
on that old SymPy version entirely.
Merge request reports
Activity
added 1 commit
- 46dfc3f2 - Disable cse_global on create_lb_collision_rule for Sympy < 1.2
I think we need to investigate this in more detail, where the problem comes from. Your comment suggests that the sympy cse performs correctly, since inserting the terms back gives them same result.. is that correct?
Perhaps there is an error in the code generation backend that occurs only in certain cases, that the CSE produces
Your comment suggests that the sympy cse performs correctly, since inserting the terms back gives them same result.. is that correct?
That is correct.
Perhaps there is an error in the code generation backend that occurs only in certain cases, that the CSE produces
That sounds like a reasonable explanation. However, nothing about The expressions produced looks unusual, so I don‘t know why they work in one case and fail in the other.
Can you please take a look at this?
lbmpy_tests/test_fluctuating_lb.py
from !16 (merged) clearly shows the error.Edited by Michael KuronThis was caused by bug fixed in pystencils@721fdf45
when this fix is merged we can close this
mentioned in merge request !17 (merged)
mentioned in issue pystencils#19 (closed)