From 5790e28db9b52af7f8889cbae3494588eb21691c Mon Sep 17 00:00:00 2001 From: Michael Kuron <m.kuron@gmx.de> Date: Fri, 6 Dec 2019 20:20:02 +0100 Subject: [PATCH] Fix FiniteDifferenceStaggeredStencilDerivation on Sympy 1.1 --- pystencils/fd/derivation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pystencils/fd/derivation.py b/pystencils/fd/derivation.py index af1f4e387..af65c62b2 100644 --- a/pystencils/fd/derivation.py +++ b/pystencils/fd/derivation.py @@ -306,7 +306,7 @@ class FiniteDifferenceStaggeredStencilDerivation: center = [tuple(p + pos) for p in points].index((0, 0, 0)[:dim]) 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 - 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: weights = best[0] assert weights -- GitLab