backtracking.py

A few different backtracking line search subsolvers.

BoundsEnforceLS - Only checks bounds and enforces them by one of three methods. ArmijoGoldsteinLS – Like above, but terminates with the ArmijoGoldsteinLS condition.

class openmdao.solvers.linesearch.backtracking.ArmijoGoldsteinLS(**kwargs)[source]

Bases: openmdao.solvers.solver.NonlinearSolver

Backtracking line search that terminates using the Armijo-Goldstein condition..

SOLVER = 'LS: AG'
__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).

solve()

Run the solver.

Returns:
boolean

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

float

absolute error.

float

relative error.

class openmdao.solvers.linesearch.backtracking.BoundsEnforceLS(**kwargs)[source]

Bases: openmdao.solvers.solver.NonlinearSolver

Bounds enforcement only.

Not so much a linesearch; just check the bounds and if they are violated, then pull back to a non-violating point and evaluate.

SOLVER = 'LS: BCHK'
__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).

solve()

Run the solver.

Returns:
boolean

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

float

absolute error.

float

relative error.