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

Skip to content

Commit 022b23d

Browse files
authored
Update wfs.py
Update functions
1 parent 5ab9f2e commit 022b23d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

sfs/fd/wfs.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ def plot(d, selection, secondary_source):
3232
3333
"""
3434
import numpy as _np
35-
from numpy.core.umath_tests import inner1d as _inner1d
3635
from scipy.special import hankel2 as _hankel2
3736

3837
from . import secondary_source_line as _secondary_source_line
@@ -91,7 +90,7 @@ def line_2d(omega, x0, n0, xs, *, c=None):
9190
k = _util.wavenumber(omega, c)
9291
ds = x0 - xs
9392
r = _np.linalg.norm(ds, axis=1)
94-
d = -1j/2 * k * _inner1d(ds, n0) / r * _hankel2(1, k * r)
93+
d = -1j/2 * k * _np.inner(ds, n0) / r * _hankel2(1, k * r)
9594
selection = _util.source_selection_line(n0, x0, xs)
9695
return d, selection, _secondary_source_line(omega, c)
9796

@@ -147,7 +146,7 @@ def _point(omega, x0, n0, xs, *, c=None):
147146
k = _util.wavenumber(omega, c)
148147
ds = x0 - xs
149148
r = _np.linalg.norm(ds, axis=1)
150-
d = 1j * k * _inner1d(ds, n0) / r ** (3 / 2) * _np.exp(-1j * k * r)
149+
d = 1j * k * _np.inner(ds, n0) / r ** (3 / 2) * _np.exp(-1j * k * r)
151150
selection = _util.source_selection_point(n0, x0, xs)
152151
return d, selection, _secondary_source_point(omega, c)
153152

@@ -234,7 +233,7 @@ def point_25d(omega, x0, n0, xs, xref=[0, 0, 0], c=None, omalias=None):
234233
preeq_25d(omega, omalias, c) *
235234
_np.sqrt(8 * _np.pi) *
236235
_np.sqrt((r * s) / (r + s)) *
237-
_inner1d(n0, ds) / s *
236+
_np.inner(n0, ds) / s *
238237
_np.exp(-1j * k * s) / (4 * _np.pi * s))
239238
selection = _util.source_selection_point(n0, x0, xs)
240239
return d, selection, _secondary_source_point(omega, c)
@@ -316,7 +315,7 @@ def point_25d_legacy(omega, x0, n0, xs, xref=[0, 0, 0], c=None, omalias=None):
316315
r = _np.linalg.norm(ds, axis=1)
317316
d = (
318317
preeq_25d(omega, omalias, c) *
319-
_np.sqrt(_np.linalg.norm(xref - x0)) * _inner1d(ds, n0) /
318+
_np.sqrt(_np.linalg.norm(xref - x0)) * _np.inner(ds, n0) /
320319
r ** (3 / 2) * _np.exp(-1j * k * r))
321320
selection = _util.source_selection_point(n0, x0, xs)
322321
return d, selection, _secondary_source_point(omega, c)
@@ -499,7 +498,7 @@ def _focused(omega, x0, n0, xs, ns, *, c=None):
499498
k = _util.wavenumber(omega, c)
500499
ds = x0 - xs
501500
r = _np.linalg.norm(ds, axis=1)
502-
d = 1j * k * _inner1d(ds, n0) / r ** (3 / 2) * _np.exp(1j * k * r)
501+
d = 1j * k * _np.inner(ds, n0) / r ** (3 / 2) * _np.exp(1j * k * r)
503502
selection = _util.source_selection_focused(ns, x0, xs)
504503
return d, selection, _secondary_source_point(omega, c)
505504

@@ -569,7 +568,7 @@ def focused_25d(omega, x0, n0, xs, ns, *, xref=[0, 0, 0], c=None,
569568
r = _np.linalg.norm(ds, axis=1)
570569
d = (
571570
preeq_25d(omega, omalias, c) *
572-
_np.sqrt(_np.linalg.norm(xref - x0)) * _inner1d(ds, n0) /
571+
_np.sqrt(_np.linalg.norm(xref - x0)) * _np.inner(ds, n0) /
573572
r ** (3 / 2) * _np.exp(1j * k * r))
574573
selection = _util.source_selection_focused(ns, x0, xs)
575574
return d, selection, _secondary_source_point(omega, c)
@@ -705,3 +704,4 @@ def soundfigure_3d(omega, x0, n0, figure, npw=[0, 0, 1], *, c=None):
705704
d += selection * figure[n, m] * d_component
706705

707706
return d, _util.source_selection_all(len(d)), secondary_source
707+

0 commit comments

Comments
 (0)