direct.py

LinearSolver that uses linalg.solve or LU factor/solve.

class openmdao.solvers.linear.direct.DirectSolver(**kwargs)[source]

Bases: openmdao.solvers.solver.LinearSolver

LinearSolver that uses linalg.solve or LU factor/solve.

SOLVER = 'LN: Direct'
__init__(**kwargs)

Initialize all attributes.

Parameters:

**kwargs : dict

options dictionary.

add_recorder(recorder)

Add a recorder to the driver’s RecordingManager.

Parameters:

recorder : <BaseRecorder>

A recorder instance to be added to RecManager.

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.

openmdao.solvers.linear.direct.format_singluar_error(err, system, mtx)[source]

Format a coherent error message when the matrix is singular.

Parameters:

err : Exception

Exception object

system : <System>

OpenMDAO system containing the Directsolver.

mtx : ndarray

Matrix of interest.

Returns:

str

New error string.