optimus.model.acoustics

Acoustic models.

Module Contents

Classes

Pmchwt

Analytical

Functions

create_default_model(source, geometry, exterior, interior)

Create an acoustics model with default settings.

create_acoustic_model(source, geometry, exterior, interior)

Create a preconditioned boundary integral equation for acoustic wave propagation. For multiple domains, a list of geometries and interior materials need

create_boundary_integral_operators(space_domain, ...)

Create boundary integral operators of the Helmholtz equation.

create_inverse_mass_matrix(space)

Create the inverse mass matrix of the function space.

create_osrc_operators(space, wavenumber, parameters[, ...])

Create OSRC operators of the Helmholtz equation.

optimus.model.acoustics.create_default_model(source, geometry, exterior, interior)

Create an acoustics model with default settings.

For multiple domains, a list of geometries and interior materials need to be specified, with equal length. They are matched by order.

Parameters
sourceoptimus.Source

The Optimus representation of a source field.

geometryoptimus.Geometry

The Optimus representation of the geometry, with the grid of the scatterers. For multiple domains, provide a list of geometries.

exterioroptimus.Material

The Optimus representation of the material for the unbounded exterior region.

interioroptimus.Material

The Optimus representation of the material for the bounded scatterer. For multiple domains, provide a list of materials.

Returns
modeloptimus.Model

The Optimus representation of the the BEM model of acoustic wave propagation in the interior and exterior domains.

optimus.model.acoustics.create_acoustic_model(source, geometry, exterior, interior, formulation='pmchwt', formulation_parameters=None, preconditioner='mass', preconditioner_parameters=None)

Create a preconditioned boundary integral equation for acoustic wave propagation. For multiple domains, a list of geometries and interior materials need to be specified, with equal length. They are matched by order.

Parameters
sourceoptimus.Source

The Optimus representation of a source field.

geometryoptimus.Geometry

The Optimus representation of the geometry, with the grid of the scatterers. For multiple domains, provide a list of geometries.

exterioroptimus.Material

The Optimus representation of the material for the unbounded exterior region.

interioroptimus.Material

The Optimus representation of the material for the bounded scatterer. For multiple domains, provide a list of materials.

formulationstr

The type of boundary integral formulation.

formulation_parametersdict

The parameters for the boundary integral formulation.

preconditionerstr

The type of operator preconditioner.

preconditioner_parametersdict

The parameters for the operator preconditioner.

Returns
modeloptimus.Model

The Optimus representation of the the BEM model of acoustic wave propagation in the interior and exterior domains.

class optimus.model.acoustics.Pmchwt(source, geometry, material_exterior, material_interior, preconditioner, parameters=None)

Bases: optimus.model.common.Model

solve()

Solve the PMCHWT model.

_create_function_spaces()

Create the function spaces for the boundary integral operators. Continuous P1 elements will always be used for the Helmholtz equation.

_create_continuous_operator()

Create the continuous boundary integral operators of the system.

_create_preconditioner()

Assemble the operator preconditioner for the linear system.

_create_rhs_vector()

Assemble the right-hand-side vector of the linear system.

_create_discrete_system()

Discretise the system.

_solve_linear_system()

Solve the linear system of boundary integral equations.

_solution_vector_to_gridfunction()

Convert the solution vector in grid functions.

class optimus.model.acoustics.Analytical(source, geometry, material_exterior, material_interior)

Bases: optimus.model.common.Model

_setup_source()

Checks for the source being a planewave.

_setup_geometry()

Check if geometry is set to a single sphere.

_setup_material_interior()

Check for single material.

solve(n_iter=100)

Compute analytical coefficients.

Parameters
n_iterint

number of coefficients terms to be computed

optimus.model.acoustics.create_boundary_integral_operators(space_domain, space_range, wavenumber, single_layer=False, double_layer=False, adjoint_double_layer=False, hypersingular=False)

Create boundary integral operators of the Helmholtz equation.

Parameters
space_domain, space_rangebempp.api.FunctionSpace

The function space for the domain and range of the Galerkin discretisation.

wavenumbercomplex

The wavenumber of the Green’s function.

single_layerbool

Return the continuous single layer boundary integral operator.

double_layerbool

Return the continuous double layer boundary integral operator.

adjoint_double_layerbool

Return the continuous adjoint double layer boundary integral operator.

hypersingularbool

Return the continuous hypersingular layer boundary integral operator.

Returns
operatorslist[bempp.api.operators.boundary.Helmholtz]

A list of boundary integral operators of the Helmholtz equation

optimus.model.acoustics.create_inverse_mass_matrix(space)

Create the inverse mass matrix of the function space.

Parameters
spacebempp.api.FunctionSpace

The function space for the domain and range of the Galerkin discretisation.

Returns
matrixlinear operator

The linear operator with the sparse LU factorisation of the inverse mass matrix.

optimus.model.acoustics.create_osrc_operators(space, wavenumber, parameters, dtn=False, ntd=False)

Create OSRC operators of the Helmholtz equation.

Parameters
spacebempp.api.FunctionSpace

The function space for the domain and range of the Galerkin discretisation.

wavenumbercomplex

The wavenumber of the Green’s function.

parametersdict

The parameters of the OSRC operators.

dtnbool

Return the OSRC approximated DtN map.

ntdbool

Return the OSRC approximated NtD map.

Returns
operatorslist[bempp.api.operators.boundary.Helmholtz]

A list of OSRC operators of the Helmholtz equation