:py:mod:`bempp.api.linalg` ========================== .. py:module:: bempp.api.linalg .. autoapi-nested-parse:: Linear solvers. Documentation of the functionality of this module and examples can be found at https://bempp.com/handbook/api/solvers.html Submodules ---------- .. toctree:: :titlesonly: :maxdepth: 1 direct_solvers/index.rst iterative_solvers/index.rst Package Contents ---------------- Functions ~~~~~~~~~ .. autoapisummary:: bempp.api.linalg.gmres bempp.api.linalg.cg bempp.api.linalg.lu .. py:function:: 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. .. py:function:: 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. .. py:function:: 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 ---------- A : bempp.api.BoundaryOperator The left-hand side boundary operator b : bempp.api.GridFunction The right-hand side grid function lu_decomp : tuple Optionally pass the tuple (lu, piv) obtained by the scipy method scipy.linalg.lu_factor