porepy.numerics.linear_solvers module

Module for the Linear Solver class, which is used to solve the linear system when using the model classes for linear systems. Note that the setup object has its own system to assemble and solve the system; this is just a wrapper around that, mostly for compliance with the nonlinear case, see numerics.nonlinear.nonlinear_solvers.

class LinearSolver(params=None)[source]

Bases: object

Wrapper around models that solves linear problems, and calls the methods in the model class before and after solving the problem.

Parameters

params (Optional[dict]) –

solve(setup)[source]

Solve a linear problem defined by the current state of the model.

Parameters

setup (subclass of pp.AbstractModel) – Model to be solved.

Returns

Norm of the error. boolean: True if the linear solver converged.

Return type

float