Skip to content

Commit

Permalink
builtins: fix gaussian kernel for non-square
Browse files Browse the repository at this point in the history
  • Loading branch information
mloubout committed Jul 31, 2024
1 parent 39486c9 commit bc057cd
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions devito/builtins/initializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,9 +145,9 @@ def create_gaussian_weights(sigma, lw):
weights = [w/w.sum() for w in (np.exp(-0.5/s**2*(np.linspace(-l, l, 2*l+1))**2)
for s, l in zip(sigma, lw))]
processed = []
for w in weights:
for (w, l) in zip(weights, lw):
temp = list(w)
while len(temp) < 2*max(lw)+1:
while len(temp) < 2*l+1:
temp.insert(0, 0)
temp.append(0)
processed.append(np.array(temp))
Expand Down
2 changes: 1 addition & 1 deletion devito/finite_differences/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ def numeric_weights(function, deriv_order, indices, x0):
coeff_priority = {'taylor': 1, 'standard': 1}


def generate_indices(expr, dim, order, side=None, matvec=None, x0=None, nweights=None):
def generate_indices(expr, dim, order, side=None, matvec=None, x0=None, nweights=0):
"""
Indices for the finite-difference scheme.
Expand Down

0 comments on commit bc057cd

Please sign in to comment.