|
8 | 8 | from devito import (Constant, Dimension, Grid, Function, solve, TimeFunction, Eq, # noqa |
9 | 9 | Operator, SubDimension, norm, Le, Ge, Gt, Lt, Abs, sin, cos, |
10 | 10 | Min, Max, SubDomain) |
11 | | -from devito.finite_differences.differentiable import SafeInv, Weights |
| 11 | +from devito.finite_differences.differentiable import SafeInv, Weights, Mul |
12 | 12 | from devito.ir import Expression, FindNodes, ccode |
13 | 13 | from devito.symbolics import (retrieve_functions, retrieve_indexed, evalrel, # noqa |
14 | 14 | CallFromPointer, Cast, DefFunction, FieldFromPointer, |
15 | 15 | INT, FieldFromComposite, IntDiv, Namespace, Rvalue, |
16 | 16 | ReservedWord, ListInitializer, uxreplace, pow_to_mul, |
17 | 17 | retrieve_derivatives, BaseCast) |
18 | | -from devito.symbolics.unevaluation import Mul as UnevalMul |
19 | 18 | from devito.tools import as_tuple |
20 | 19 | from devito.types import (Array, Bundle, FIndexed, LocalObject, Object, |
21 | 20 | ComponentAccess, StencilDimension, Symbol as dSymbol) |
@@ -877,16 +876,19 @@ def test_assumptions(self, op, expr, assumptions, expected): |
877 | 876 | assert evalrel(op, eqn, assumptions) == expected |
878 | 877 |
|
879 | 878 |
|
880 | | -def test_issue_2577(): |
| 879 | +def test_issue_2577a(): |
881 | 880 |
|
882 | 881 | u = TimeFunction(name='u', grid=Grid((2,))) |
883 | | - eq = Eq(u.forward, UnevalMul(-1, -1., u)) |
| 882 | + x = u.grid.dimensions[0] |
| 883 | + expr = Mul(-1, -1., x, u) |
| 884 | + assert expr.args == (x, u) |
| 885 | + eq = Eq(u.forward, expr) |
884 | 886 | op = Operator(eq) |
885 | 887 |
|
886 | 888 | assert '--' not in str(op.ccode) |
887 | 889 |
|
888 | 890 |
|
889 | | -def test_issue_2577a(): |
| 891 | +def test_issue_2577b(): |
890 | 892 | class SD0(SubDomain): |
891 | 893 | name = 'sd0' |
892 | 894 |
|
|
0 commit comments