Skip to content

Commit 0180bad

Browse files
committed
tests: Add additional test
1 parent 1bc1672 commit 0180bad

1 file changed

Lines changed: 21 additions & 1 deletion

File tree

tests/test_symbolics.py

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
from sympy import Expr, Symbol
88
from devito import (Constant, Dimension, Grid, Function, solve, TimeFunction, Eq, # noqa
99
Operator, SubDimension, norm, Le, Ge, Gt, Lt, Abs, sin, cos,
10-
Min, Max)
10+
Min, Max, SubDomain)
1111
from devito.finite_differences.differentiable import SafeInv, Weights
1212
from devito.ir import Expression, FindNodes, ccode
1313
from devito.symbolics import (retrieve_functions, retrieve_indexed, evalrel, # noqa
@@ -868,3 +868,23 @@ def test_issue_2577():
868868
op = Operator(eq)
869869

870870
assert '--' not in str(op.ccode)
871+
872+
873+
def test_issue_2577a():
874+
class SD0(SubDomain):
875+
name = 'sd0'
876+
877+
def define(self, dimensions):
878+
x, = dimensions
879+
return {x: ('middle', 1, 1)}
880+
881+
grid = Grid(shape=(11,))
882+
883+
sd0 = SD0(grid=grid)
884+
885+
u = Function(name='u', grid=grid, space_order=2)
886+
887+
eq_u = Eq(u, -(u*u).dxc, subdomain=sd0)
888+
889+
op = Operator(eq_u)
890+
assert '--' not in str(op.ccode)

0 commit comments

Comments
 (0)