Skip to content

Commit b949953

Browse files
EdCauntmloubout
authored andcommitted
tests: Add additional test
1 parent af3b475 commit b949953

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

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, Number, 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
@@ -884,3 +884,23 @@ def test_issue_2577():
884884
op = Operator(eq)
885885

886886
assert '--' not in str(op.ccode)
887+
888+
889+
def test_issue_2577a():
890+
class SD0(SubDomain):
891+
name = 'sd0'
892+
893+
def define(self, dimensions):
894+
x, = dimensions
895+
return {x: ('middle', 1, 1)}
896+
897+
grid = Grid(shape=(11,))
898+
899+
sd0 = SD0(grid=grid)
900+
901+
u = Function(name='u', grid=grid, space_order=2)
902+
903+
eq_u = Eq(u, -(u*u).dxc, subdomain=sd0)
904+
905+
op = Operator(eq_u)
906+
assert '--' not in str(op.ccode)

0 commit comments

Comments
 (0)