scipy_gmres.py

OpenMDAO LinearSolver that uses Scipy’s GMRES to solve for derivatives.

class openmdao.solvers.scipy_gmres.ScipyGMRES[source]

Bases: openmdao.solvers.solver_base.LinearSolver

Scipy’s GMRES Solver. This is a serial solver, so it should never be used in an MPI setting.

mult(arg)[source]

GMRES Callback: applies Jacobian matrix. Mode is determined by the system.

Args:

arg : ndarray

Incoming vector

Returns:

ndarray : Matrix vector product of arg with jacobian

solve(rhs_mat, system, mode)[source]

Solves the linear system for the problem in self.system. The full solution vector is returned.

Args:

rhs_mat : dict of ndarray

Dictionary containing one ndarry per top level quantity of interest. Each array contains the right-hand side for the linear solve.

system : System

Parent System object.

mode : string

Derivative mode, can be ‘fwd’ or ‘rev’.

Returns:

dict of ndarray : Solution vectors