From 767c639af886836e460960e911f557bfa29cae10 Mon Sep 17 00:00:00 2001 From: ZoeLeibowitz Date: Wed, 10 Jul 2024 11:31:30 +0100 Subject: [PATCH] dsl: Dispatch to sympy.Add not both Add and EvalDerivative --- devito/petsc/solve.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/devito/petsc/solve.py b/devito/petsc/solve.py index 5bdad59b43..3815a03037 100644 --- a/devito/petsc/solve.py +++ b/devito/petsc/solve.py @@ -1,6 +1,7 @@ from functools import singledispatch from sympy import simplify +import sympy from devito.finite_differences.differentiable import Add, Mul, EvalDerivative, diffify from devito.finite_differences.derivative import Derivative @@ -127,8 +128,7 @@ def centre_stencil(expr, target): return expr if expr == target else 0 -@centre_stencil.register(Add) -@centre_stencil.register(EvalDerivative) +@centre_stencil.register(sympy.Add) def _(expr, target): if not expr.has(target): return 0