@@ -62,6 +62,12 @@ def point(omega, x0, n0, grid, c=None):
6262def point_velocity (omega , x0 , n0 , grid , c = None ):
6363 """Velocity of a point source.
6464
65+ Returns
66+ -------
67+ XyzComponents
68+ Particle velocity at positions given by `grid`.
69+ See :class:`sfs.util.XyzComponents`.
70+
6571 """
6672 k = util .wavenumber (omega , c )
6773 x0 = util .asarray_1d (x0 )
@@ -70,7 +76,7 @@ def point_velocity(omega, x0, n0, grid, c=None):
7076 r = np .linalg .norm (offset )
7177 v = point (omega , x0 , n0 , grid , c = c )
7278 v *= (1 + 1j * k * r ) / (defs .rho0 * defs .c * 1j * k * r )
73- return [v * o / r for o in offset ]
79+ return util . XyzComponents ( [v * o / r for o in offset ])
7480
7581
7682def point_modal (omega , x0 , n0 , grid , L , N = None , deltan = 0 , c = None ):
@@ -87,6 +93,7 @@ def point_modal(omega, x0, n0, grid, L, N=None, deltan=0, c=None):
8793 compatibility).
8894 grid : triple of numpy.ndarray
8995 The grid that is used for the sound field calculations.
96+ See :func:`sfs.util.xyz_grid`.
9097 L : (3,) array_like
9198 Dimensionons of the rectangular room.
9299 N : (3,) array_like or int, optional
@@ -157,6 +164,7 @@ def point_modal_velocity(omega, x0, n0, grid, L, N=None, deltan=0, c=None):
157164 compatibility).
158165 grid : triple of numpy.ndarray
159166 The grid that is used for the sound field calculations.
167+ See :func:`sfs.util.xyz_grid`.
160168 L : (3,) array_like
161169 Dimensionons of the rectangular room.
162170 N : (3,) array_like or int, optional
@@ -172,8 +180,9 @@ def point_modal_velocity(omega, x0, n0, grid, L, N=None, deltan=0, c=None):
172180
173181 Returns
174182 -------
175- numpy.ndarray
183+ XyzComponents
176184 Particle velocity at positions given by `grid`.
185+ See :class:`sfs.util.XyzComponents`.
177186
178187 """
179188 k = util .wavenumber (omega , c )
@@ -214,9 +223,7 @@ def point_modal_velocity(omega, x0, n0, grid, L, N=None, deltan=0, c=None):
214223 vx = vx - 8 * 1j / (ksquared - km ) * p0
215224 vy = vy - 8 * 1j / (ksquared - km ) * p1
216225 vz = vz - 8 * 1j / (ksquared - km ) * p2
217-
218-
219- return vx , vy , vz
226+ return util .XyzComponents ([vx , vy , vz ])
220227
221228
222229def line (omega , x0 , n0 , grid , c = None ):
@@ -261,6 +268,12 @@ def line(omega, x0, n0, grid, c=None):
261268def line_velocity (omega , x0 , n0 , grid , c = None ):
262269 """Velocity of line source parallel to the z-axis.
263270
271+ Returns
272+ -------
273+ XyzComponents
274+ Particle velocity at positions given by `grid`.
275+ See :class:`sfs.util.XyzComponents`.
276+
264277 """
265278 k = util .wavenumber (omega , c )
266279 x0 = util .asarray_1d (x0 )
@@ -277,7 +290,7 @@ def line_velocity(omega, x0, n0, grid, c=None):
277290 if len (grid ) > 2 :
278291 v .append (np .zeros_like (v [0 ]))
279292
280- return [_duplicate_zdirection (vi , grid ) for vi in v ]
293+ return util . XyzComponents ( [_duplicate_zdirection (vi , grid ) for vi in v ])
281294
282295
283296def line_dipole (omega , x0 , n0 , grid , c = None ):
@@ -330,15 +343,21 @@ def plane(omega, x0, n0, grid, c=None):
330343
331344
332345def plane_velocity (omega , x0 , n0 , grid , c = None ):
333- """Vecolity of a plane wave.
346+ """Velocity of a plane wave.
334347
335348 ::
336349
337350 V(x, w) = 1/(rho c) e^(-i w/c n x) n
338351
352+ Returns
353+ -------
354+ XyzComponents
355+ Particle velocity at positions given by `grid`.
356+ See :class:`sfs.util.XyzComponents`.
357+
339358 """
340359 v = plane (omega , x0 , n0 , grid , c = c ) / (defs .rho0 * defs .c )
341- return [v * n for n in n0 ]
360+ return util . XyzComponents ( [v * n for n in n0 ])
342361
343362
344363def _duplicate_zdirection (p , grid ):
0 commit comments