solve_cgs#

sectionproperties.analysis.solver.solve_cgs(k: csc_matrix, f: ndarray[Any, dtype[float64]], m: LinearOperator | None = None, tol: float = 1e-05) ndarray[Any, dtype[float64]][source]#

Solves a linear system using the CGS iterative method.

Parameters:
  • k (csc_matrix) – N x N matrix of the linear system

  • f (ndarray[Any, dtype[float64]]) – N x 1 right hand side of the linear system

  • m (LinearOperator | None) – Preconditioner for the linear matrix approximating the inverse of k

  • tol (float) – Tolerance for the solver to achieve. The algorithm terminates when either the relative or the absolute residual is below tol

Returns:

The solution vector to the linear system of equations

Raises:

RuntimeError – If the CGS iterative method does not converge

Return type:

ndarray[Any, dtype[float64]]