Skip to content

Commit

Permalink
change wfs_25d_point as default to Delft/Unified WFS
Browse files Browse the repository at this point in the history
  • Loading branch information
fs446 committed Mar 11, 2019
1 parent 118ecee commit 56b5ca5
Showing 1 changed file with 0 additions and 86 deletions.
86 changes: 0 additions & 86 deletions sfs/mono/drivingfunction.py
Original file line number Diff line number Diff line change
Expand Up @@ -104,42 +104,6 @@ def _wfs_point(omega, x0, n0, xs, c=None):


def wfs_25d_point(omega, x0, n0, xs, xref=[0, 0, 0], c=None, omalias=None):
r"""Point source by 2.5-dimensional WFS.
.. math::
D(\x_0,\w) = \sqrt{\i\wc |\x_\text{ref}-\x_0|}
\frac{\scalarprod{\x_0-\x_\text{s}}{\n_0}}
{|\x_0-\x_\text{s}|^\frac{3}{2}}
\e{-\i\wc |\x_0-\x_\text{s}|}
Examples
--------
.. plot::
:context: close-figs
d, selection, secondary_source = sfs.mono.drivingfunction.wfs_25d_point(
omega, array.x, array.n, xs)
plot(d, selection, secondary_source)
"""
x0 = util.asarray_of_rows(x0)
n0 = util.asarray_of_rows(n0)
xs = util.asarray_1d(xs)
xref = util.asarray_1d(xref)
k = util.wavenumber(omega, c)
ds = x0 - xs
r = np.linalg.norm(ds, axis=1)
d = (
wfs_25d_preeq(omega, omalias, c) *
np.sqrt(np.linalg.norm(xref - x0)) * inner1d(ds, n0) /
r ** (3 / 2) * np.exp(-1j * k * r))
selection = util.source_selection_point(n0, x0, xs)
return d, selection, secondary_source_point(omega, c)


def wfs_25d_point_Unified_WIP(omega, x0, n0, xs, xref=[0, 0, 0], c=None,
omalias=None):
r"""Driving function for 2.5-dimensional WFS of a virtual point source.
Parameters
Expand Down Expand Up @@ -458,34 +422,6 @@ def nfchoa_25d_point(omega, x0, r0, xs, max_order=None, c=None):
return d / (2 * np.pi * r0), selection, secondary_source_point(omega, c)


def nfchoa_25d_point_HF(omega, x0, r0, xs, max_order=None, c=None,
DirichletKernelFlag=True):
x0 = util.asarray_of_rows(x0)
k = util.wavenumber(omega, c)
xs = util.asarray_1d(xs)
phi, _, r = util.cart2sph(*xs)
phi0 = util.cart2sph(*x0.T)[0]
M = _max_order_circular_harmonics(len(x0), max_order)
d = 0

if DirichletKernelFlag==True:
for m in range(-M, M + 1):
d += np.exp(-1j * k * r) / np.exp(-1j * k * r0) * \
r0 / r * \
np.exp(-1j * m * (phi0 - phi))
d = d / (2 * np.pi * r0)
else: #this is the analytic solution for m=oo and requires an exact
# stationary phase source within phi0, i.e. phi==phi0 in exactly one
# index
d = np.exp(-1j * k * r) / np.exp(-1j * k * r0) * \
r0 / r / r0 * \
len(x0)/2/np.pi * \
(phi==phi0) #choose exactly one sec source
selection = util.source_selection_all(len(x0))
return d, selection, secondary_source_point(omega, c)



def nfchoa_25d_plane(omega, x0, r0, n=[0, 1, 0], max_order=None, c=None):
r"""Plane wave by 2.5-dimensional NFC-HOA.
Expand Down Expand Up @@ -525,28 +461,6 @@ def nfchoa_25d_plane(omega, x0, r0, n=[0, 1, 0], max_order=None, c=None):
return 2*1j / r0 * d, selection, secondary_source_point(omega, c)


def nfchoa_25d_plane_HF(omega, x0, r0, n=[0, 1, 0], max_order=None, c=None,
DirichletKernelFlag=True):
x0 = util.asarray_of_rows(x0)
k = util.wavenumber(omega, c)
n = util.normalize_vector(n)
phi, _, r = util.cart2sph(*n)
phi0 = util.cart2sph(*x0.T)[0]
M = _max_order_circular_harmonics(len(x0), max_order)
d = 0

if DirichletKernelFlag == True:
for m in range(-M, M + 1):
d += np.exp(1j*np.pi*m) * np.exp(1j*m*(phi0 - phi))
d *= (2/r0) * (r0/np.exp(-1j*k*r0))
else:
d = 1/r0 * 4*np.pi*r0 / np.exp(-1j*k*r0) * \
len(x0)/2/np.pi * \
(phi==(phi0-np.pi)) #choose exactly one sec source
selection = util.source_selection_all(len(x0))
return d, selection, secondary_source_point(omega, c)


def sdm_2d_line(omega, x0, n0, xs, c=None):
"""Line source by two-dimensional SDM.
Expand Down

0 comments on commit 56b5ca5

Please sign in to comment.