scipy_iter_solver.py

Define the scipy iterative solver class.

class openmdao.solvers.linear.scipy_iter_solver.ScipyIterativeSolver(*args, **kwargs)[source]

Bases: openmdao.solvers.linear.scipy_iter_solver.ScipyKrylov

Deprecated. See ScipyKrylov.

SOLVER = 'LN: SCIPY'
__init__(*args, **kwargs)[source]

Deprecated.

Parameters:
*args : list of object

Positional args.

**kwargs : dict

Named args.

add_recorder(recorder)

Add a recorder to the solver’s RecordingManager.

Parameters:
recorder : <CaseRecorder>

A recorder instance to be added to RecManager.

cleanup()

Clean up resources prior to exit.

preconditioner

Provide ‘preconditioner’ property for backwards compatibility.

Returns:
LinearSolver

reference to the ‘precon’ property.

record_iteration(**kwargs)

Record an iteration of the current Solver.

Parameters:
**kwargs : dict

Keyword arguments (used for abs and rel error).

solve(vec_names, mode, rel_systems=None)

Run the solver.

Parameters:
vec_names : [str, …]

list of names of the right-hand-side vectors.

mode : str

‘fwd’ or ‘rev’.

rel_systems : set of str

Names of systems relevant to the current solve.

Returns:
boolean

Failure flag; True if failed to converge, False is successful.

float

absolute error.

float

relative error.

class openmdao.solvers.linear.scipy_iter_solver.ScipyKrylov(**kwargs)[source]

Bases: openmdao.solvers.solver.LinearSolver

The Krylov iterative solvers in scipy.sparse.linalg.

Attributes

precon (Solver) Preconditioner for linear solve. Default is None for no preconditioner.
SOLVER = 'LN: SCIPY'
__init__(**kwargs)[source]

Declare the solver option.

Parameters:
**kwargs : {}

dictionary of options set by the instantiating class/script.

add_recorder(recorder)

Add a recorder to the solver’s RecordingManager.

Parameters:
recorder : <CaseRecorder>

A recorder instance to be added to RecManager.

cleanup()

Clean up resources prior to exit.

preconditioner

Provide ‘preconditioner’ property for backwards compatibility.

Returns:
LinearSolver

reference to the ‘precon’ property.

record_iteration(**kwargs)

Record an iteration of the current Solver.

Parameters:
**kwargs : dict

Keyword arguments (used for abs and rel error).

solve(vec_names, mode, rel_systems=None)[source]

Run the solver.

Parameters:
vec_names : [str, …]

list of names of the right-hand-side vectors.

mode : str

‘fwd’ or ‘rev’.

rel_systems : set of str

Names of systems relevant to the current solve.

Returns:
boolean

Failure flag; True if failed to converge, False is successful.

float

absolute error.

float

relative error.