bempp.api.linalg

Linear solvers.

Documentation of the functionality of this module and examples can be found at https://bempp.com/handbook/api/solvers.html

Submodules

Package Contents

Functions

gmres(A, b[, tol, restart, maxiter, use_strong_form, ...])

Perform GMRES solve via interface to scipy.

cg(A, b[, tol, maxiter, use_strong_form, ...])

Perform CG solve via interface to scipy.

lu(A, b[, lu_factor])

Perform an LU solve.

bempp.api.linalg.gmres(A, b, tol=1e-05, restart=None, maxiter=None, use_strong_form=False, return_residuals=False, return_iteration_count=False)

Perform GMRES solve via interface to scipy.

This function behaves like the scipy.sparse.linalg.gmres function. But instead of a linear operator and a vector b it takes a boundary operator and a grid function or a blocked operator and a list of grid functions. The result is returned as a grid function or as a list of grid functions in the correct spaces.

bempp.api.linalg.cg(A, b, tol=1e-05, maxiter=None, use_strong_form=False, return_residuals=False, return_iteration_count=False)

Perform CG solve via interface to scipy.

This function behaves like the scipy.sparse.linalg.cg function. But instead of a linear operator and a vector b it takes a boundary operator and a grid function. The result is returned as a grid function in the correct space.

bempp.api.linalg.lu(A, b, lu_factor=None)

Perform an LU solve.

This function takes an operator and a grid function, converts the operator into a dense matrix and solves the system via LU decomposition. The result is again returned as a grid function.

Parameters

Abempp.api.BoundaryOperator

The left-hand side boundary operator

bbempp.api.GridFunction

The right-hand side grid function

lu_decomptuple

Optionally pass the tuple (lu, piv) obtained by the scipy method scipy.linalg.lu_factor