optimus.source.piston

Piston sources.

Module Contents

Classes

_Piston

Functions

create_piston(frequency, radius[, source_axis, ...])

Create a plane circular piston source.

optimus.source.piston.create_piston(frequency, radius, source_axis=(1, 0, 0), number_of_point_sources_per_wavelength=6, location=(0, 0, 0), velocity=1.0)

Create a plane circular piston source.

Parameters
frequencyfloat

The frequency of the acoustic field.

radiusfloat

The radius of the piston.

source_axistuple[float]

The direction vector of the axis of the piston. Default: positive x direction

number_of_point_sources_per_wavelengthinteger

The number of point sources per wavelength used to discretise the piston source. Default: 6

locationtuple[float]

The location of the centroid of the piston. Default: global origin

velocitycomplex

Normal velocity of the piston. Default : 1 m/s

class optimus.source.piston._Piston(frequency, radius, source_axis, number_of_point_sources_per_wavelength, location, velocity)

Bases: optimus.source.common.Source

pressure_field(medium, locations)

Calculate the pressure field in the specified locations.

Parameters
mediumoptimus.material.Material

The propagating medium.

locationsnumpy.ndarray

An array of size (3,N) with the locations on which to evaluate the pressure field.

Returns
pressurenp.ndarray

An array of size (N,) with the pressure in the locations.

normal_pressure_gradient(locations, normals, medium)

Calculate the normal gradient of the pressure field in the specified locations.

Parameters
mediumoptimus.material.Material

The propagating medium.

locationsnumpy.ndarray

An array of size (3,N) with the locations on which to evaluate the pressure field.

normalsnumpy.ndarray

An array of size (3,N) with the unit normal vectors at the locations on which to evaluate the pressure field.

Returns
gradientnumpy.ndarray

An array of size (3,N) with the normal gradient of the pressure in the locations.

pressure_field_and_normal_gradient(medium, locations, normals)

Calculate the pressure field and the normal gradient of the pressure field in the specified locations.

Parameters
mediumoptimus.material.Material

The propagating medium.

locationsnumpy.ndarray

An array of size (3,N) with the locations on which to evaluate the pressure field.

normalsnumpy.ndarray

An array of size (3,N) with the unit normal vectors at the locations on which to evaluate the pressure field.

Returns
pressurenumpy.ndarray

An array of size (N,) with the pressure in the locations.

gradientnumpy.ndarray

An array of size (3,N) with the normal gradient of the pressure in the locations.

calc_surface_traces(medium, space_dirichlet=None, space_neumann=None, dirichlet_trace=True, neumann_trace=True)

Calculate the surface traces of the source field on the mesh.

Parameters
mediumoptimus.material.Material

The propagating medium.

space_dirichlet, space_neumannbempp.api.FunctionSpace

The discrete spaces on the surface grid.

dirichlet_trace, neumann_tracebool

Calculate the Dirichlet or Neumann trace of the field.

Returns
tracebempp.api.GridFunctions

The surface traces.