Skip to content
Snippets Groups Projects
Commit 054e4ea3 authored by Markus Holzer's avatar Markus Holzer
Browse files

Minor clean up

parent 3be3644d
No related branches found
No related tags found
1 merge request!116Adapted to SymPy 1.10
......@@ -140,6 +140,7 @@ def replace_common_quadratic_and_constant_term(cr: LbmCollisionRule):
return cr
# TODO: This solution is from https://github.com/sympy/sympy/issues/23297. Can be removed if in SymPy master
def find_subadd(exprs, replacement_symbol_generator):
exprs = sp.Tuple(*exprs)
adds = sp.Tuple(*exprs.atoms(sp.Add))
......@@ -281,8 +282,8 @@ def substitute_moments_in_conserved_quantity_equations(ac: AssignmentCollection)
for cq_sym, moment_sym in cq_symbols_to_moments.items():
moment_eq = reduced_assignments[moment_sym]
assert moment_eq.count(cq_sym) == 0, "Expressing conserved quantity " \
f"{cq_sym} using moment {moment_sym} would introduce a circular dependency."
assert moment_eq.count(cq_sym) == 0, f"Expressing conserved quantity {cq_sym} using moment {moment_sym} " \
"would introduce a circular dependency."
cq_eq = subs_additive(reduced_assignments[cq_sym], moment_sym, moment_eq)
if cq_sym in main_asm_dict:
main_asm_dict[cq_sym] = cq_eq
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment