Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit ba86052

Browse files
committed
Fixed dimensions of normal vector for line_dipole
1 parent 34614f5 commit ba86052

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

sfs/mono/source.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -396,10 +396,12 @@ def line_dipole(omega, x0, n0, grid, c=None):
396396
"""
397397
k = util.wavenumber(omega, c)
398398
x0 = util.asarray_1d(x0)
399-
x0 = x0[:2] # ignore z-component
399+
n0 = util.asarray_1d(n0)
400+
x0 = x0[:2] # ignore z-components
400401
n0 = n0[:2]
401402
grid = util.XyzComponents(grid)
402403
dx = grid[:2] - x0
404+
403405
r = np.linalg.norm(dx)
404406
p = 1j*k/4 * special.hankel2(1, k * r) * np.inner(dx, n0) / r
405407
return _duplicate_zdirection(p, grid)

0 commit comments

Comments
 (0)