optimus.model.common

Common functionality for the models.

Module Contents

Classes

Model

Functions

_vector_to_gridfunction(vector, spaces)

Convert an array with values representing the coefficients

_check_validity_formulation(formulation, ...)

Check if the specified formulation and preconditioner is a valid choice.

_process_osrc_parameters(preconditioner_parameters)

Process the parameters for the OSRC preconditioner.

class optimus.model.common.Model(source, geometry, material_exterior, material_interior, formulation, preconditioner)
abstract solve()

Solve the model. Needs to be overwritten by specific model.

_preprocess_domains()

Preprocess the input variables for the geometry and materials.

Returns
n_bounded_domainsint

The number of bounded subdomains.

optimus.model.common._vector_to_gridfunction(vector, spaces)

Convert an array with values representing the coefficients of one or several discrete spaces into Bempp grid functions.

Parameters
vectornumpy.ndarray

Vector of coefficients.

spacestuple[bempp.api.FunctionSpace]

The function spaces.

Returns
gridfunctionstuple[bempp.api.GridFunction]

The list of grid functions.

optimus.model.common._check_validity_formulation(formulation, formulation_parameters, preconditioner, preconditioner_parameters)

Check if the specified formulation and preconditioner is a valid choice.

Parameters
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
formulation_namestr

The name of the boundary integral formulation.

preconditioner_namestr

The name of the operator preconditioner.

model_parametersdict

The parameters for the preconditioned boundary integral formulation.

optimus.model.common._process_osrc_parameters(preconditioner_parameters)

Process the parameters for the OSRC preconditioner.

Parameters
preconditioner_parametersdict

The parameters of the preconditioner.

Returns
osrc_parametersdict

The parameters of the OSRC preconditioner.