You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
If you try to use the absolute value of an index (for example when implementing a free-surface as in the acoustic examples) with a function that is staggered, the staggering is not correctly accounted for during compilation, resulting in a float being used as an index in the generated c code. This causes module compilation to fail.
MFE:
import devito as dv
grid = dv.Grid(shape=(11, 11), extent=(10., 10.))
x, y = grid.dimensions
f = dv.TimeFunction(name='f', grid=grid, space_order=2, staggered=x)
eq = dv.Eq(f.forward, f.dx)
lhs, rhs = eq.evaluate.args
funcs = dv.symbolics.retrieve_functions(rhs)
mapper = {}
for f in funcs:
# Get the x index
xind = f.indices[1]
if (xind - x).as_coeff_Mul()[0] < 0:
mapper.update({f: f.subs({xind: dv.symbolics.INT(abs(xind))})})
eq2 = dv.Eq(lhs, rhs.subs(mapper))
dv.Operator(eq2)(t_M=1)
If you try to use the absolute value of an index (for example when implementing a free-surface as in the acoustic examples) with a function that is staggered, the staggering is not correctly accounted for during compilation, resulting in a float being used as an index in the generated c code. This causes module compilation to fail.
MFE:
Which returns:
to the stderr and:
to the stdout
The text was updated successfully, but these errors were encountered: