|
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, |
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) |
@@ -861,16 +860,19 @@ def test_assumptions(self, op, expr, assumptions, expected): |
861 | 860 | assert evalrel(op, eqn, assumptions) == expected |
862 | 861 |
|
863 | 862 |
|
864 | | -def test_issue_2577(): |
| 863 | +def test_issue_2577a(): |
865 | 864 |
|
866 | 865 | u = TimeFunction(name='u', grid=Grid((2,))) |
867 | | - eq = Eq(u.forward, UnevalMul(-1, -1., u)) |
| 866 | + x = u.grid.dimensions[0] |
| 867 | + expr = Mul(-1, -1., x, u) |
| 868 | + assert expr.args == (x, u) |
| 869 | + eq = Eq(u.forward, expr) |
868 | 870 | op = Operator(eq) |
869 | 871 |
|
870 | 872 | assert '--' not in str(op.ccode) |
871 | 873 |
|
872 | 874 |
|
873 | | -def test_issue_2577a(): |
| 875 | +def test_issue_2577b(): |
874 | 876 | class SD0(SubDomain): |
875 | 877 | name = 'sd0' |
876 | 878 |
|
|
0 commit comments