devito
devito copied to clipboard
Symbolic coefficents with the term function.dxr generates an error
The coefficient furthest to the right is not being replaced when using the right sided finite difference term 'Function'.dxr with symbolic coefficients. Hence the presence of the w symbol causing the error.
from devito import * import numpy as npextent = (10., 10.) shape = (11, 11)grid = Grid(extent=extent, shape=shape) f = Function(name='f', grid=grid, space_order=3, coefficients = 'symbolic') x, y = grid.dimensions weights = np.array([-0.6, 0.1, 0.6, 5]) u_x_coeffs = Coefficient(1, f, x, weights)coeffs = Substitutions(u_x_coeffs)f.data[:,:] = 1 eq = Eq(f, f.dxr, coefficients = coeffs) op = Operator([eq] ) op.apply() print(eq.evaluate)
Hi, thanks for the report. Could you write a short test reproducing this error?
some guidelines here
ah, I think you have one on Slack, just paste that maybe?
Thanks Fabio, sorry I didn't update the example earlier. I've added a test case for the error.