solver.py¶
Define the base Solver, NonlinearSolver, and LinearSolver classes.

class
openmdao.solvers.solver.
BlockLinearSolver
(**kwargs)[source]¶ Bases:
openmdao.solvers.solver.LinearSolver
A base class for LinearBlockGS and LinearBlockJac.

SOLVER
= 'base_solver'¶

__init__
(**kwargs)¶ Initialize all attributes.
Parameters:  **kwargs : dict
options dictionary.

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.

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 righthandside vectors.
 mode : str
‘fwd’ or ‘rev’.
 rel_systems : set of str
Set of names of relevant systems based on the current linear solve.
Returns:  boolean
Failure flag; True if failed to converge, False is successful.
 float
initial error.
 float
error at the first iteration.


class
openmdao.solvers.solver.
LinearSolver
(**kwargs)[source]¶ Bases:
openmdao.solvers.solver.Solver
Base class for linear solvers.

SOLVER
= 'base_solver'¶

__init__
(**kwargs)[source]¶ Initialize all attributes.
Parameters:  **kwargs : dict
options dictionary.

add_recorder
(recorder)[source]¶ 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.

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 righthandside vectors.
 mode : str
‘fwd’ or ‘rev’.
 rel_systems : set of str
Set of names of relevant systems based on the current linear solve.
Returns:  boolean
Failure flag; True if failed to converge, False is successful.
 float
initial error.
 float
error at the first iteration.


class
openmdao.solvers.solver.
NonlinearSolver
(**kwargs)[source]¶ Bases:
openmdao.solvers.solver.Solver
Base class for nonlinear solvers.

SOLVER
= 'base_solver'¶

__init__
(**kwargs)[source]¶ Initialize all attributes.
Parameters:  **kwargs : dict
options dictionary.

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.

record_iteration
(**kwargs)¶ Record an iteration of the current Solver.
Parameters:  **kwargs : dict
Keyword arguments (used for abs and rel error).


class
openmdao.solvers.solver.
Solver
(**kwargs)[source]¶ Bases:
object
Base solver class.
This class is subclassed by NonlinearSolver and LinearSolver, which are in turn subclassed by actual solver implementations.
Attributes
cite (str) Listing of relevant citations that should be referenced when publishing work that uses this class. options (<OptionsDictionary>) Options dictionary. recording_options (<OptionsDictionary>) Recording options dictionary. supports (<OptionsDictionary>) Options dictionary describing what features are supported by this solver. 
SOLVER
= 'base_solver'¶

__init__
(**kwargs)[source]¶ Initialize all attributes.
Parameters:  **kwargs : dict of keyword arguments
Keyword arguments that will be mapped into the Solver options.

add_recorder
(recorder)[source]¶ Add a recorder to the solver’s RecordingManager.
Parameters:  recorder : <CaseRecorder>
A recorder instance to be added to RecManager.


class
openmdao.solvers.solver.
SolverInfo
[source]¶ Bases:
object
Communal object for storing some formatting for solver iprint.
Attributes
prefix (str) Prefix to prepend during this iprint. stack (List) List of strings; strings are popped and appended as needed. 
clear
()[source]¶ Clear out the iprint stack, in case something is left over from a handled exception.
