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__(self, **kwargs)

Initialize all attributes.

Parameters
**kwargsdict

options dictionary.

add_recorder(self, recorder)

Add a recorder to the solver’s RecordingManager.

Parameters
recorder<CaseRecorder>

A recorder instance to be added to RecManager.

cleanup(self)

Clean up resources prior to exit.

record_iteration(self, **kwargs)

Record an iteration of the current Solver.

Parameters
**kwargsdict

Keyword arguments (used for abs and rel error).

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

Run the solver.

Parameters
vec_names[str, …]

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

modestr

‘fwd’ or ‘rev’.

rel_systemsset of str

Names of systems relevant to the current solve.

openmdao.solvers.linear.direct.format_nan_error(system, matrix)[source]

Format a coherent error message when the matrix contains NaN.

Parameters
system<System>

System containing the Directsolver.

matrixndarray

Matrix of interest.

Returns
str

New error string.

openmdao.solvers.linear.direct.format_singular_csc_error(system, matrix)[source]

Format a coherent error message when the CSC matrix is singular.

Parameters
system<System>

System containing the Directsolver.

matrixndarray

Matrix of interest.

Returns
str

New error string.

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

Format a coherent error message when the matrix is singular.

Parameters
errException

Exception object

system<System>

System containing the Directsolver.

mtxndarray

Matrix of interest.

Returns
str

New error string.