This module contains convenience functions for creating new instances of classes from the bempp.core module without the need of repeatedly specifying the numerical types used to represent particular kinds of data (BasisFunctionType and ResultType). It also provides functions implementing the algebra of H-matrices.
Create and return a discrete boundary operator representing an approximate inverse of an H-matrix.
A discrete boundary operator stored in the form of an H-matrix.
Approximation accuracy.
Returns a DiscreteBoundaryOperator_ValueType object representing an approximate inverse of the operator supplied in the ‘operator’ argument, stored in the form of an approximate H-matrix LU decomposition. ValueType is set to operator.valueType().
Create and return a discrete boundary operator representing an approximate sum of two discrete boundary operators stored as H-matrices.
First operand; a discrete boundary operator stored in the form of an H-matrix.
Second operand; a discrete boundary operator stored in the form of an H-matrix.
Approximation accuracy. (TODO: explain better)
Maximum rank of blocks that should be considered low-rank in the H-matrix to be constructed.
Returns a newly constructed DiscreteBoundaryOperator_ValueType object storing an H-matrix approximately equal to sum of the H-matrices stored in the two operands. ValueType is set to op1.valueType() (which must be equal to op2.valueType()).
Return the adjoint of a BoundaryOperator.
Note The BoundaryOperator must act on real-valued basis functions, otherwise an exception is thrown.
Determine whether points lie inside a grid (assumed to be closed).
Deprecated. Superseded by acaOperatorApproximateLuInverse().
Create and return an AcaOptions object with default settings.
Create and return an AccuracyOptions object with default settings.
Create and return an AccuracyOptionsEx object with default settings.
Create and return an AssemblyOptions object with default settings.
Deprecated. Superseded by createBlockedOperatorStructure().
Create and return a BlockedBoundaryOperator object.
A blocked boundary operator is an operator that consists of several blocks arranged in a matrix, each of which is an “elementary” boundary operator represented by a BoundaryOperator object.
structure (BlockedOperatorStructure or nested list)
An object determining the boundary operators to be put in specific blocks of the newly constructed blocked boundary operator. Can be either a BlockedBoundaryOperator object or simply a nested (2D) list. In the latter case, empty blocks can be marked with None.
All the boundary operators from a single column of ‘structure’ must have the same domain, and all the operators from a single row of ‘structure’ must have the same range and space dual to range. No row and no column of ‘structure’ must be completely empty (contain only uninitialized BoundaryOperator objects). If these conditions are not satisfied, an exception is thrown.
Returns a newly constructed BlockedBoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the ‘structure’ argument and equal to either float32, float64, complex64 or complex128.
Example:
Assume that A, B and C are boundary operators. We want to create the blocked operator
[A B]
Z = [C 0],
where 0 is an empty block.
Variant 1:
from bempp import lib
context = lib.createContext(...)
structure = lib.createBlockedOperatorStructure(context)
structure.setBlock(0, 0, A)
structure.setBlock(0, 1, B)
structure.setBlock(1, 0, C)
Z = lib.createBlockedBoundaryOperator(context, structure)
Variant 2:
from bempp import lib
context = lib.createContext(...)
Z = lib.createBlockedBoundaryOperator(context, [[A, B], [C, None]])
Create and return a BlockedOperatorStructure object.
BlockedOperatorStructure is a helper class used in construction of blocked boundary operators. It represents a matrix of boundary operators. To construct a blocked boundary operator, store individual boundary operators in appropriate rows and columns of a BlockedOperatorStructure object, repeatedly calling its setBlock() method, and pass this object to the createBlockedBoundaryOperator() function for validation.
A Context object. The values returned by context.basisFunctionType() and context.resultType() will determine the precise type of the newly constructed BlockedOperatorStructure object.
Returns a newly constructed BlockedOperatorStructure_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the ‘context’ argument and equal to either float32, float64, complex64 or complex128.
Create and return a Context object.
A Context determines the mechanics of the assembly of weak forms and the evaluation of potentials.
Quadrature strategy to be used for the calculation of integrals occurring e.g. in the weak forms of boundary operators or in the definition of potential operators.
Further options influencing the weak-form assembly process.
Returns a newly constructed Context_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the quadStrategy argument and equal to either float32, float64, complex64 or complex128.
Create and return a DefaultDirectSolver object.
The DefaultDirectSolver class acts as an interface to the direct solver from LAPACK. It lets you solve the equation A f = g for the function f, with A being a boundary operator and g a grid function.
list convertible to a BlockedBoundaryOperator)
The boundary operator A standing on the left-hand-side of the equation to be solved.
Returns a newly constructed DefaultDirectSolver_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the boundaryOperator argument and equal to either float32, float64, complex64 or complex128.
Create and return a DefaultIterativeSolver object.
The DefaultIterativeSolver class acts as an interface to Belos, the iterative solver package from Trilinos. It lets you solve the equation A f = g for the function f, with A being a boundary operator and g a grid function.
list convertible to a BlockedBoundaryOperator)
The boundary operator A standing on the left-hand-side of the equation to be solved.
Convergence test mode. Can be either “test_convergence_in_dual_to_range” (default) or “test_convergence_in_range”. See below.
Convergence can be tested either in the range space of the operator A or in the space dual to the range. A standard Galerkin discretisation of the form Ax = b maps into the space dual to the range of the operator. If you choose to test in the range space, the equation pinv(M)Ax = pinv(M)b is solved, where M is the mass matrix mapping from the range space into its dual and pinv(M) is its pseudoinverse.
Returns a newly constructed DefaultIterativeSolver_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the boundaryOperator argument and equal to either float32, float64, complex64 or complex128.
Create and return an EvaluationOptions object with default settings.
Return a GridFactory object
Create and return a GridFunction object with values determined by a Python function or by an input vector of coefficients or projections.
Assembly context from which a quadrature strategy can be retrieved.
Function space to expand the grid function in.
Function space dual to ‘space’.
Indicates whether the grid function depends on the unit vector normal to the grid or not.
Function object whose values on ‘space.grid()’ will be used to construct the new grid function. If ‘surfaceNormalDependent’ is set to False (default), ‘function’ will be passed a single argument containing a 1D array of the coordinates of a point lying on the grid ‘space.grid()’. If ‘surfaceNormalDependent’ is set to True, the function will be passed one more argument, a 1D array containing the components of the unit vector normal to ‘space.grid()’ at the point given in the first argument. In both cases ‘function’ should return its value at the given point, in the form of a scalar or a 1D array with dimension equal to ‘space.codomainDimension()’.
A vector of the coefficients of the function in the basis of space ‘space’.
A vector of projections of the function on the basis of space ‘dualSpace’.
mode (‘approximate’ or ‘interpolate’)
If both the ‘space’ and ‘dualSpace’ are given, they must be defined on the same grid and have the same codomain dimension.
This function can be called with three different sets of parameters.
Variant 1: construction of a grid function from a Python function:
createGridFunction(context, space, dualSpace, function,
surfaceNormalDependent)
if the best approximation of the function in the chosen space should be found by projecting it on the chosen dual space, or
- createGridFunction(context, space, function=function,
- surfaceNormalDependent=surfaceNormalDependent, mode=’interpolate’)
if the function’s expansion in the chosen space should be found by interpolating it on an appropriate set of points.
Variant 2: construction of a grid function from the vector of its coefficients in the basis of the space ‘space’:
createGridFunction(context, space, coefficients=coefficients)
Variant 3: construction of a grid function from the vector of its projections on the basis functions of the space ‘dualSpace’:
createGridFunction(context, space, dualSpace, projections=projections)
Example scalar-valued function defined in a 3D space that can be passed to ‘createGridFunction’ with ‘surfaceNormalDependent = False’:
def fun1(point):
x, y, z = point
r = np.sqrt(x**2 + y**2 + z**2)
return 2 * x * z / r**5 - y / r**3
Example scalar-valued function defined in a 3D space that can be passed to ‘createGridFunction’ with ‘surfaceNormalDependent = True’:
import cmath
def fun2(point, normal):
x, y, z = point
nx, ny, nz = normal
k = 5
return cmath.exp(1j * k * x) * (nx - 1)
Create and return an adjoint double-layer-potential boundary operator for the Helmholtz equation in 3D.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
nabla^2 u + k^2 u = 0.
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
If set to False (default), the standard exp() function will be used to evaluate the exponential factor occurring in the kernel. If set to True, the exponential factor will be evaluated by piecewise-cubic interpolation of values calculated in advance on a regular grid. This normally speeds up calculations, but might result in a loss of accuracy. This is an experimental feature: use it at your own risk.
If useInterpolation is set to True, this parameter determines the number of points per “effective wavelength” (defined as 2 pi / abs(waveNumber)) used to construct the interpolation grid. The default value (5000) is normally enough to reduce the relative or absolute error, whichever is smaller, below 100 * machine precision. If useInterpolation is set to False, this parameter is ignored.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a double-layer-potential boundary operator for the Helmholtz equation in 3D.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
nabla^2 u + k^2 u = 0.
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
If set to False (default), the standard exp() function will be used to evaluate the exponential factor occurring in the kernel. If set to True, the exponential factor will be evaluated by piecewise-cubic interpolation of values calculated in advance on a regular grid. This normally speeds up calculations, but might result in a loss of accuracy. This is an experimental feature: use it at your own risk.
If useInterpolation is set to True, this parameter determines the number of points per “effective wavelength” (defined as 2 pi / abs(waveNumber)) used to construct the interpolation grid. The default value (5000) is normally enough to reduce the relative or absolute error, whichever is smaller, below 100 * machine precision. If useInterpolation is set to False, this parameter is ignored.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a double-layer potential operator for the Helmholtz equation in 3D.
A Context object used to control the evaluation of integrals occurring in the definition of the potential operator.
nabla^2 u + k^2 u = 0.
Returns a newly constructed PotentialOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Note about BEM++ terminology: a potential operator acts on functions defined on a surface S and produces functions defined at any point of the space surrounding S, but not necessarily on S itself. In contrast, a boundary operator acts on on functions defined on a surface S and produces functions defined on the same surface S.
Create and return a potential operator used to calculate part of the far-field pattern for a radiating solution of the Helmholtz equation in 3D.
See the C++ documentation for mathematical background.
A Context object used to control the evaluation of integrals occurring in the definition of the potential operator.
nabla^2 u + k^2 u = 0.
Returns a newly constructed PotentialOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Note about BEM++ terminology: a potential operator acts on functions defined on a surface S and produces functions defined at any point of the space surrounding S, but not necessarily on S itself. In contrast, a boundary operator acts on on functions defined on a surface S and produces functions defined on the same surface S.
Create and return a potential operator used to calculate part of the far-field pattern for a radiating solution of the Helmholtz equation in 3D.
See the C++ documentation for mathematical background.
A Context object used to control the evaluation of integrals occurring in the definition of the potential operator.
nabla^2 u + k^2 u = 0.
Returns a newly constructed PotentialOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Note about BEM++ terminology: a potential operator acts on functions defined on a surface S and produces functions defined at any point of the space surrounding S, but not necessarily on S itself. In contrast, a boundary operator acts on on functions defined on a surface S and produces functions defined on the same surface S.
Create and return a hypersingular boundary operator for the Helmholtz equation in 3D.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
nabla^2 u + k^2 u = 0.
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
If set to False (default), the standard exp() function will be used to evaluate the exponential factor occurring in the kernel. If set to True, the exponential factor will be evaluated by piecewise-cubic interpolation of values calculated in advance on a regular grid. This normally speeds up calculations, but might result in a loss of accuracy. This is an experimental feature: use it at your own risk.
If useInterpolation is set to True, this parameter determines the number of points per “effective wavelength” (defined as 2 pi / abs(waveNumber)) used to construct the interpolation grid. The default value (5000) is normally enough to reduce the relative or absolute error, whichever is smaller, below 100 * machine precision. If useInterpolation is set to False, this parameter is ignored.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a single-layer-potential boundary operator for the Helmholtz equation in 3D.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
nabla^2 u + k^2 u = 0.
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
If set to False (default), the standard exp() function will be used to evaluate the exponential factor occurring in the kernel. If set to True, the exponential factor will be evaluated by piecewise-cubic interpolation of values calculated in advance on a regular grid. This normally speeds up calculations, but might result in a loss of accuracy. This is an experimental feature: use it at your own risk.
If useInterpolation is set to True, this parameter determines the number of points per “effective wavelength” (defined as 2 pi / abs(waveNumber)) used to construct the interpolation grid. The default value (5000) is normally enough to reduce the relative or absolute error, whichever is smaller, below 100 * machine precision. If useInterpolation is set to False, this parameter is ignored.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a single-layer potential operator for the Helmholtz equation in 3D.
A Context object used to control the evaluation of integrals occurring in the definition of the potential operator.
nabla^2 u + k^2 u = 0.
Returns a newly constructed PotentialOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Note about BEM++ terminology: a potential operator acts on functions defined on a surface S and produces functions defined at any point of the space surrounding S, but not necessarily on S itself. In contrast, a boundary operator acts on on functions defined on a surface S and produces functions defined on the same surface S.
Create and return a (generalized) identity operator.
Let X and Y be two function spaces defined on the same grid and represented by Space objects supplied in the arguments ‘domain’ and ‘range’. If X is a superset of Y (in the mathematical sense), the object returned by this function represents the orthogonal projection operator from X to Y. If X is a subset of Y, the returned object represents the inclusion operator from X to Y. If X is equal to Y, the returned object represents the standard identity operator.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
All the three spaces (‘domain’, ‘range’ and ‘dualToRange’) must be defined on the same grid.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return an adjoint double-layer-potential boundary operator for the Laplace equation in 3D.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a double-layer-potential boundary operator for the Laplace equation in 3D.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a double-layer potential operator for the Laplace equation in 3D.
A Context object used to control the evaluation of integrals occurring in the definition of the potential operator.
Returns a newly constructed PotentialOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Note about BEM++ terminology: a potential operator acts on functions defined on a surface S and produces functions defined at any point of the space surrounding S, but not necessarily on S itself. In contrast, a boundary operator acts on on functions defined on a surface S and produces functions defined on the same surface S.
Create and return a hypersingular boundary operator for the Laplace equation in 3D.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a single-layer-potential boundary operator for the Laplace equation in 3D.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a single-layer potential operator for the Laplace equation in 3D.
A Context object used to control the evaluation of integrals occurring in the definition of the potential operator.
Returns a newly constructed PotentialOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Note about BEM++ terminology: a potential operator acts on functions defined on a surface S and produces functions defined at any point of the space surrounding S, but not necessarily on S itself. In contrast, a boundary operator acts on on functions defined on a surface S and produces functions defined on the same surface S.
Create and return a Laplace-Beltrami operator in 3D.
The weak form of this operator is
int_S (grad_S phi^* . grad_S psi) dS
where grad_S is the surface gradient operator, ^* denotes complex conjugation, and phi and psi are the test and trial functions, respectively.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
All the three spaces (‘domain’, ‘range’ and ‘dualToRange’) must be defined on the same grid.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a double-layer-potential boundary operator for the Maxwell equation in 3D.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
Wave number.
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
If set to False (default), the standard exp() function will be used to evaluate the exponential factor occurring in the kernel. If set to True, the exponential factor will be evaluated by piecewise-cubic interpolation of values calculated in advance on a regular grid. This normally speeds up calculations, but might result in a loss of accuracy. This is an experimental feature: use it at your own risk.
If useInterpolation is set to True, this parameter determines the number of points per “effective wavelength” (defined as 2 pi / abs(waveNumber)) used to construct the interpolation grid. The default value (5000) is normally enough to reduce the relative or absolute error, whichever is smaller, below 100 * machine precision. If useInterpolation is set to False, this parameter is ignored.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a double-layer potential operator for the Maxwell equation in 3D.
A Context object used to control the evaluation of integrals occurring in the definition of the potential operator.
Wave number.
Returns a newly constructed PotentialOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Note about BEM++ terminology: a potential operator acts on functions defined on a surface S and produces functions defined at any point of the space surrounding S, but not necessarily on S itself. In contrast, a boundary operator acts on on functions defined on a surface S and produces functions defined on the same surface S.
Create and return a potential operator used to calculate part of the far-field pattern for a radiating solution of the Maxwell equations in 3D.
See the C++ documentation for mathematical background.
A Context object used to control the evaluation of integrals occurring in the definition of the potential operator.
Wave number.
Returns a newly constructed PotentialOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Note about BEM++ terminology: a potential operator acts on functions defined on a surface S and produces functions defined at any point of the space surrounding S, but not necessarily on S itself. In contrast, a boundary operator acts on on functions defined on a surface S and produces functions defined on the same surface S.
Create and return a potential operator used to calculate part of the far-field pattern for a radiating solution of the Maxwell equations in 3D.
See the C++ documentation for mathematical background.
A Context object used to control the evaluation of integrals occurring in the definition of the potential operator.
Wave number.
Returns a newly constructed PotentialOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Note about BEM++ terminology: a potential operator acts on functions defined on a surface S and produces functions defined at any point of the space surrounding S, but not necessarily on S itself. In contrast, a boundary operator acts on on functions defined on a surface S and produces functions defined on the same surface S.
Create and return an identity operator with weak form defined under an antisymmetric pseudo-inner product.
This class represents an operator I_M whose weak form (under the standard inner product) is
<u, I_M v> = int_S u^* . (v imes n) dS,
where n is the outward unit vector normal to the surface S at a given point.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
All the three spaces (‘domain’, ‘range’ and ‘dualToRange’) must be defined on the same grid.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a single-layer-potential boundary operator for the Maxwell equation in 3D.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
Wave number, i.e. the number k in the Maxwell equation.
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
If set to False (default), the standard exp() function will be used to evaluate the exponential factor occurring in the kernel. If set to True, the exponential factor will be evaluated by piecewise-cubic interpolation of values calculated in advance on a regular grid. This normally speeds up calculations, but might result in a loss of accuracy. This is an experimental feature: use it at your own risk.
If useInterpolation is set to True, this parameter determines the number of points per “effective wavelength” (defined as 2 pi / abs(waveNumber)) used to construct the interpolation grid. The default value (5000) is normally enough to reduce the relative or absolute error, whichever is smaller, below 100 * machine precision. If useInterpolation is set to False, this parameter is ignored.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a single-layer potential operator for the Maxwell equation in 3D.
A Context object used to control the evaluation of integrals occurring in the definition of the potential operator.
Wave number.
Returns a newly constructed PotentialOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Note about BEM++ terminology: a potential operator acts on functions defined on a surface S and produces functions defined at any point of the space surrounding S, but not necessarily on S itself. In contrast, a boundary operator acts on on functions defined on a surface S and produces functions defined on the same surface S.
Create and return an adjoint double-layer-potential boundary operator for the modified Helmholtz equation in 3D.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
nabla^2 u - k^2 u = 0.
Only real wave numbers are allowed if context.resultType() is a real type (float32 or float64).
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
If set to False (default), the standard exp() function will be used to evaluate the exponential factor occurring in the kernel. If set to True, the exponential factor will be evaluated by piecewise-cubic interpolation of values calculated in advance on a regular grid. This normally speeds up calculations, but might result in a loss of accuracy. This is an experimental feature: use it at your own risk.
If useInterpolation is set to True, this parameter determines the number of points per “effective wavelength” (defined as 2 pi / abs(waveNumber)) used to construct the interpolation grid. The default value (5000) is normally enough to reduce the relative or absolute error, whichever is smaller, below 100 * machine precision. If useInterpolation is set to False, this parameter is ignored.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a double-layer-potential boundary operator for the modified Helmholtz equation in 3D.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
nabla^2 u - k^2 u = 0.
Only real wave numbers are allowed if context.resultType() is a real type (float32 or float64).
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
If set to False (default), the standard exp() function will be used to evaluate the exponential factor occurring in the kernel. If set to True, the exponential factor will be evaluated by piecewise-cubic interpolation of values calculated in advance on a regular grid. This normally speeds up calculations, but might result in a loss of accuracy. This is an experimental feature: use it at your own risk.
If useInterpolation is set to True, this parameter determines the number of points per “effective wavelength” (defined as 2 pi / abs(waveNumber)) used to construct the interpolation grid. The default value (5000) is normally enough to reduce the relative or absolute error, whichever is smaller, below 100 * machine precision. If useInterpolation is set to False, this parameter is ignored.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a double-layer potential operator for the modified Helmholtz equation in 3D.
A Context object used to control the evaluation of integrals occurring in the definition of the potential operator.
-nabla^2 u + k^2 u = 0.
Returns a newly constructed PotentialOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Note about BEM++ terminology: a potential operator acts on functions defined on a surface S and produces functions defined at any point of the space surrounding S, but not necessarily on S itself. In contrast, a boundary operator acts on on functions defined on a surface S and produces functions defined on the same surface S.
Create and return a hypersingular boundary operator for the modified Helmholtz equation in 3D.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
nabla^2 u - k^2 u = 0.
Only real wave numbers are allowed if context.resultType() is a real type (float32 or float64).
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
If set to False (default), the standard exp() function will be used to evaluate the exponential factor occurring in the kernel. If set to True, the exponential factor will be evaluated by piecewise-cubic interpolation of values calculated in advance on a regular grid. This normally speeds up calculations, but might result in a loss of accuracy. This is an experimental feature: use it at your own risk.
If useInterpolation is set to True, this parameter determines the number of points per “effective wavelength” (defined as 2 pi / abs(waveNumber)) used to construct the interpolation grid. The default value (5000) is normally enough to reduce the relative or absolute error, whichever is smaller, below 100 * machine precision. If useInterpolation is set to False, this parameter is ignored.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a single-layer-potential boundary operator for the modified Helmholtz equation in 3D.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
nabla^2 u - k^2 u = 0.
Only real wave numbers are allowed if context.resultType() is a real type (float32 or float64).
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
If set to False (default), the standard exp() function will be used to evaluate the exponential factor occurring in the kernel. If set to True, the exponential factor will be evaluated by piecewise-cubic interpolation of values calculated in advance on a regular grid. This normally speeds up calculations, but might result in a loss of accuracy. This is an experimental feature: use it at your own risk.
If useInterpolation is set to True, this parameter determines the number of points per “effective wavelength” (defined as 2 pi / abs(waveNumber)) used to construct the interpolation grid. The default value (5000) is normally enough to reduce the relative or absolute error, whichever is smaller, below 100 * machine precision. If useInterpolation is set to False, this parameter is ignored.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a single-layer potential operator for the modified Helmholtz equation in 3D.
A Context object used to control the evaluation of integrals occurring in the definition of the potential operator.
-nabla^2 u + k^2 u = 0.
Returns a newly constructed PotentialOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Note about BEM++ terminology: a potential operator acts on functions defined on a surface S and produces functions defined at any point of the space surrounding S, but not necessarily on S itself. In contrast, a boundary operator acts on on functions defined on a surface S and produces functions defined on the same surface S.
Create and return a null (zero-valued) operator.
A Context object to control the assembly of the weak form of the newly constructed operator.
Function space to be taken as the domain of the operator.
Function space to be taken as the range of the operator.
Function space to be taken as the dual to the range of the operator.
Textual label of the operator. If set to None (default), a unique label will be generated automatically.
Returns a newly constructed BoundaryOperator_BasisFunctionType_ResultType object, with BasisFunctionType and ResultType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a NumericalQuadratureStrategy object.
A quadrature strategy provides functions constructing local assemblers used to discretize boundary operators and user-defined functions. A particular quadrature strategy determines how the integrals involved in this discretization are evaluated.
The local assemblers constructed by this class use numerical quadrature to evaluate the necessary integrals. Singular integrals are transformed into regular ones as described in S. Sauter, Ch. Schwab, “Boundary Element Methods” (2010). Quadrature accuracy can be influenced by the ‘accuracyOptions’ parameter.
Type used to represent the values of the (components of the) basis functions into which arguments of operators discretized with this strategy will be expanded.
Type used to represent the values of integrals.
Determines quadrature orders used to approximate different types of integrals. If set to None, default quadrature orders are used.
The following combinations of basisFunctionType and resultType are allowed:
basisFunctionType | resultType |
---|---|
“float32” | “float32” or “complex64” |
“float64” | “float64” or “complex128” |
“complex64” | “complex64” |
“complex128” | “complex128” |
Typically, you should choose basisFunctionType = “float64” and resultType = “float64” for calculations with real-valued operators (such as those related to the Laplace equation) or basisFunctionType = “float64” and resultType = “complex128” for calculations with complex-valued operators (such as those related to the Helmlholtz equation).
Create and return a space of scalar functions defined on the dual of a grid (or its segment) and constant on each element of the dual grid.
A Context object that will determine the type used to represent the values of the basis functions of the newly constructed space.
Returns a newly constructed Space_BasisFunctionType object, with BasisFunctionType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a space of scalar functions defined on a grid (or its segment) and constant on each element of this grid.
A Context object that will determine the type used to represent the values of the basis functions of the newly constructed space.
Grid on which the functions from the newly constructed space will be defined.
(Optional) Segment of the grid on which the space should be defined. If set to None (default), the whole grid will be used.
Returns a newly constructed Space_BasisFunctionType object, with BasisFunctionType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a space of piecewise constant functions defined over a barycentric refinement of a grid.
A Context object that will determine the type used to represent the values of the basis functions of the newly constructed space.
Grid on which the functions from the newly constructed space will be defined.
(Optional) Segment of the grid on which the space should be defined. If set to None (default), the whole grid will be used.
Returns a newly constructed Space_BasisFunctionType object, with BasisFunctionType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a space of globally continuous scalar functions defined on a grid (or its segment) and linear on each element of this grid.
A Context object that will determine the type used to represent the values of the basis functions of the newly constructed space.
Grid on which the functions from the newly constructed space will be defined.
(Optional) Segment of the grid on which the space should be defined. If set to None (default), the whole grid will be used.
Returns a newly constructed Space_BasisFunctionType object, with BasisFunctionType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a space of globally continuous scalar functions defined on grid (or its segment) and linear on each element of this grid. It produces the same global dofs as createPiecewiseLinearContinuousScalarSpace, but the local dofs live on a barycentric refinement of the original grid. Hence, this space is compatible with other spaces defined over barycentric refinements.
A Context object that will determine the type used to represent the values of the basis functions of the newly constructed space.
Grid on which the functions from the newly constructed space will be defined.
(Optional) Segment of the grid on which the space should be defined. If set to None (default), the whole grid will be used.
Returns a newly constructed Space_BasisFunctionType object, with BasisFunctionType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a space of scalar functions defined on a grid (or its segment) and linear on each element of this grid (but not forced to be continuous at element boundaries).
A Context object that will determine the type used to represent the values of the basis functions of the newly constructed space.
Grid on which the functions from the newly constructed space will be defined.
(Optional) Segment of the grid on which the space should be defined. If set to None (default), the whole grid will be used.
(Optional) If set to False (default), the space will include all basis functions associated with vertices belonging to the chosen segment, regardless of whether the elements on which these functions are defined belong themselves to the segment. As a result, the resulting space will be (in the mathematical sense) a superset of a PiecewiseLinearContinuousScalarSpace defined on the same segment. If set to True, the space will only include basis functions defined on elements belonging to the chosen segment.
Returns a newly constructed Space_BasisFunctionType object, with BasisFunctionType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a space of globally discontinuous scalar functions defined on grid (or its segment) and linear on each element of this grid. It is the discontinuous version of “createPiecwiseLinearContinuousScalarSpaceBarycentric”.
A Context object that will determine the type used to represent the values of the basis functions of the newly constructed space.
Grid on which the functions from the newly constructed space will be defined.
(Optional) Segment of the grid on which the space should be defined. If set to None (default), the whole grid will be used.
Returns a newly constructed Space_BasisFunctionType object, with BasisFunctionType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a space of globally continuous scalar functions defined on a grid (or its segment) and having a polynomial representation of a given order on each element of this grid.
A Context object that will determine the type used to represent the values of the basis functions of the newly constructed space.
Grid on which the functions from the newly constructed space will be defined.
Order of the polynomial basis defined on each element.
(Optional) Segment of the grid on which the space should be defined. If set to None (default), the whole grid will be used.
Returns a newly constructed Space_BasisFunctionType object, with BasisFunctionType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a space of scalar functions defined on a grid (or its segment) and having a polynomial representation of a given order on each element of this grid (but not forced to be continuous at element boundaries).
A Context object that will determine the type used to represent the values of the basis functions of the newly constructed space.
Grid on which the functions from the newly constructed space will be defined.
Order of the polynomial basis defined on each element.
(Optional) Segment of the grid on which the space should be defined. If set to None (default), the whole grid will be used.
(Optional) If set to False (default), the space will include those and only those basis functions that are necessary to make the newly constructed space a superset (in the mathematical sense) of a PiecewisePolynomialContinuousScalarSpace defined on the chosen segment. Otherwise the space will include only the functions defined on elements belonging to the segment.
Returns a newly constructed Space_BasisFunctionType object, with BasisFunctionType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a space of lowest order Raviart-Thomas vector functions with normal components continuous on boundaries between elements.
A Context object that will determine the type used to represent the values of the basis functions of the newly constructed space.
Grid on which the functions from the newly constructed space will be defined.
(Optional) Segment of the grid on which the space should be defined. If set to None (default), the whole grid will be used.
(Optional) If set to False (default), degrees of freedom will not be placed on edges lying on boundaries of the grid. This is usually the desired behaviour for simulations of open perfectly conducting surfaces (sheets). If set to True, degrees of freedom will be placed on all edges belonging to the chosen segment of the grid.
Returns a newly constructed Space_BasisFunctionType object, with BasisFunctionType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create and return a space consisting of the single function equal to 1 on all elements of the grid.
A Context object that will determine the type used to represent the values of the basis functions of the newly constructed space.
Grid on which the function from the newly constructed space will be defined.
Returns a newly constructed Space_BasisFunctionType object, with BasisFunctionType determined automatically from the context argument and equal to either float32, float64, complex64 or complex128.
Create a block diagonal preconditioner from a list of operators.
A list of DiscreteBoundaryOperator objects op1, op2, ..., opn.
Returns a block diagonal preconditioner P = diag(op1, op2, ..., opn).
Return a discrete operator object stored as a dense matrix mat.
A two-dimensional array to be wrapped by the discrete operator.
Returns a newly constructed DiscreteBoundaryOperator_ValueType object wrapping the matrix mat.
Create a preconditioner from a discrete boundary operator.
A discrete operator, which acts as preconditioner, e.g. an ACA approximate LU decomposition or a sparse inverse.
Returns a preconditioner.
Return a discrete operator object that evaluates the inverse of op applied to a vector by constructing the LU decomposition. For this operation op must represent a sparse matrix operator.
A discrete boundary operator stored as sparse matrix
Returns a newly constructed DiscreteBoundaryOperator_ValueType object which stores the LU decomposition of op and evaluates the inverse of op applied to a vector.
Calculate the L^2-norm of the difference between a grid function and a function defined as a Python callable.
A grid function.
A Python callable object whose values on ‘gridFunction.grid()’ will be compared against those of the grid function. If ‘surfaceNormalDependent’ is set to False (default), ‘exactFunction’ will be passed a single argument containing a 1D array of the coordinates of a point lying on the grid ‘gridFunction.grid()’. If ‘surfaceNormalDependent’ is set to True, the function will be passed one more argument, a 1D array containing the components of the unit vector normal to ‘gridFunction.grid()’ at the point given in the first argument. In both cases ‘exactFunction’ should return its value at the given point, in the form of a scalar or a 1D array with dimension equal to ‘space.codomainDimension()’.
Quadrature stategy to be used to evaluate integrals involved in the L^2-norm.
Additional options controlling function evaluation.
Indicates whether ‘exactFunction’ depends on the unit vector normal to the grid or not.
Returns a tuple (absError, relError), where absError is the L^2-norm of the difference between ‘gridFunction’ and ‘exactFunction’ and relError is equal to absError divided by the L^2-norm of ‘exactFunction’
See the documentation of createGridFunction() for example definitions of Python functions that can be passed to the ‘exactFunction’ argument.
Export a grid function to a Gmsh file.
The grid function to be exported.
Label for the data series in the Gmsh file.
Name of the file to be created.
Export a grid function to a VTK file.
The grid function to be exported.
Determines whether data are attaches to vertices or cells.
Label used to identify the function in the VTK file.
Base name of the output files. It should not contain any directory part or filename extensions.
Output directory. Can be set to None (default), in which case the files are output in the current directory.
Output type. See the Dune reference manual for more details.
Deprecated. Superseded by createGridFunction().
Deprecated. Superseded by createGridFunction().
Multiply a discrete boundary operator stored as an H-matrix by a scalar.
A discrete boundary operator stored in the form of an H-matrix.
Scalar with which the supplied operator should be multiplied.
Returns a newly constructed DiscreteBoundaryOperator_ValueType object storing an H-matrix equal to the H-matrix stored in ‘operator’ and multiplied by ‘multiplier’. ValueType is set to operator.valueType().