Skip to content
Snippets Groups Projects
Commit 5790e28d authored by Michael Kuron's avatar Michael Kuron :mortar_board:
Browse files

Fix FiniteDifferenceStaggeredStencilDerivation on Sympy 1.1

parent ed864c0e
No related merge requests found
...@@ -306,7 +306,7 @@ class FiniteDifferenceStaggeredStencilDerivation: ...@@ -306,7 +306,7 @@ class FiniteDifferenceStaggeredStencilDerivation:
center = [tuple(p + pos) for p in points].index((0, 0, 0)[:dim]) center = [tuple(p + pos) for p in points].index((0, 0, 0)[:dim])
best = [b for b in best if b[center] != 0] best = [b for b in best if b[center] != 0]
if len(best) > 1: # if there are still multiple, they are equivalent, so we average if len(best) > 1: # if there are still multiple, they are equivalent, so we average
weights = sp.Add(*[sp.Matrix(b) for b in best]) / len(best) weights = [sum([b[i] for b in best]) / len(best) for i in range(len(weights))]
else: else:
weights = best[0] weights = best[0]
assert weights assert weights
......
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