Skip to content

Commit

Permalink
dsl: Dispatch to sympy.Add not both Add and EvalDerivative
Browse files Browse the repository at this point in the history
  • Loading branch information
ZoeLeibowitz committed Jul 10, 2024
1 parent c4c1bc3 commit 767c639
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions devito/petsc/solve.py
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 767c639

Please sign in to comment.