[docs]defsource_selection_point(n0,x0,xs):"""Secondary source selection for a point source. Eq.(15) from :cite:`Spors2008` """n0=util.asarray_of_rows(n0)x0=util.asarray_of_rows(x0)xs=util.asarray_1d(xs)ds=x0-xsreturninner1d(ds,n0)>=defs.selection_tolerance

[docs]defsource_selection_line(n0,x0,xs):"""Secondary source selection for a line source. compare Eq.(15) from :cite:`Spors2008` """returnsource_selection_point(n0,x0,xs)

[docs]defsdm_2d_line(omega,x0,n0,xs,c=None):"""Line source by two-dimensional SDM. The secondary sources have to be located on the x-axis (y0=0). Derived from :cite:`Spors2009`, Eq.(9), Eq.(4):: D(x0,k) = """x0=util.asarray_of_rows(x0)n0=util.asarray_of_rows(n0)xs=util.asarray_1d(xs)k=util.wavenumber(omega,c)ds=x0-xsr=np.linalg.norm(ds,axis=1)return-1j/2*k*xs[1]/r*hankel2(1,k*r)

[docs]defsdm_2d_plane(omega,x0,n0,n=[0,1,0],c=None):"""Plane wave by two-dimensional SDM. The secondary sources have to be located on the x-axis (y0=0). Derived from :cite:`Ahrens2012`, Eq.(3.73), Eq.(C.5), Eq.(C.11):: D(x0,k) = kpw,y * e^(-j*kpw,x*x) """x0=util.asarray_of_rows(x0)n0=util.asarray_of_rows(n0)n=util.normalize_vector(n)k=util.wavenumber(omega,c)returnk*n[1]*np.exp(-1j*k*n[0]*x0[:,0])

[docs]defsdm_25d_plane(omega,x0,n0,n=[0,1,0],xref=[0,0,0],c=None):"""Plane wave by 2.5-dimensional SDM. The secondary sources have to be located on the x-axis (y0=0). Eq.(3.79) from :cite:`Ahrens2012`:: D_2.5D(x0,w) = """x0=util.asarray_of_rows(x0)n0=util.asarray_of_rows(n0)n=util.normalize_vector(n)xref=util.asarray_1d(xref)k=util.wavenumber(omega,c)return4j*np.exp(-1j*k*n[1]*xref[1])/hankel2(0,k*n[1]*xref[1])* \
np.exp(-1j*k*n[0]*x0[:,0])

[docs]defsdm_25d_point(omega,x0,n0,xs,xref=[0,0,0],c=None):"""Point source by 2.5-dimensional SDM. The secondary sources have to be located on the x-axis (y0=0). Driving funcnction from :cite:`Spors2010`, Eq.(24):: D(x0,k) = """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-xsr=np.linalg.norm(ds,axis=1)return1/2*1j*k*np.sqrt(xref[1]/(xref[1]-xs[1]))* \
xs[1]/r*hankel2(1,k*r)