backtracking.py

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: LinesearchSolver

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

Parameters:
**kwargsdict

Options dictionary.

Attributes:
_analysis_error_raisedbool

Flag is set to True if a subsystem raises an AnalysisError.

Methods

add_recorder(recorder)

Add a recorder to the solver's RecordingManager.

can_solve_cycle()

Return True if this solver can solve groups with cycles.

check_config(logger)

Perform optional error checks.

cleanup()

Clean up resources prior to exit.

get_outputs_dir(*subdirs[, mkdir])

Get the path under which all output files of this solver are to be placed.

get_reports_dir()

Get the path to the directory where the report files should go.

record_iteration(**kwargs)

Record an iteration of the current Solver.

report_failure(msg)

Report a failure that has occurred.

solve()

Run the solver.

use_relevance()

Return True if relevance should be active.

SOLVER = 'LS: AG'
__init__(**kwargs)[source]

Initialize all attributes.

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

Bases: LinesearchSolver

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.

Parameters:
**kwargsdict

Options dictionary.

Attributes:
linesearch

Get the linesearch solver associated with this solver.

msginfo

Return info to prepend to messages.

Methods

add_recorder(recorder)

Add a recorder to the solver's RecordingManager.

can_solve_cycle()

Return True if this solver can solve groups with cycles.

check_config(logger)

Perform optional error checks.

cleanup()

Clean up resources prior to exit.

get_outputs_dir(*subdirs[, mkdir])

Get the path under which all output files of this solver are to be placed.

get_reports_dir()

Get the path to the directory where the report files should go.

record_iteration(**kwargs)

Record an iteration of the current Solver.

report_failure(msg)

Report a failure that has occurred.

solve()

Run the solver.

use_relevance()

Return True if relevance should be active.

SOLVER = 'LS: BCHK'
class openmdao.solvers.linesearch.backtracking.LinesearchSolver(**kwargs)[source]

Bases: NonlinearSolver

Base class for line search solvers.

Parameters:
**kwargsdict

Options dictionary.

Attributes:
_do_subsolvebool

Flag used by parent solver to tell the line search whether to solve subsystems while backtracking.

_lower_boundsndarray or None

Lower bounds array.

_upper_boundsndarray or None

Upper bounds array.

Methods

add_recorder(recorder)

Add a recorder to the solver's RecordingManager.

can_solve_cycle()

Return True if this solver can solve groups with cycles.

check_config(logger)

Perform optional error checks.

cleanup()

Clean up resources prior to exit.

get_outputs_dir(*subdirs[, mkdir])

Get the path under which all output files of this solver are to be placed.

get_reports_dir()

Get the path to the directory where the report files should go.

record_iteration(**kwargs)

Record an iteration of the current Solver.

report_failure(msg)

Report a failure that has occurred.

solve()

Run the solver.

use_relevance()

Return True if relevance should be active.

__init__(**kwargs)[source]

Initialize all attributes.

Parameters:
**kwargsdict

Options dictionary.