nonlinear_block_gs.py

nonlinear_block_gs.py#

Define the NonlinearBlockGS class.

class openmdao.solvers.nonlinear.nonlinear_block_gs.NonlinearBlockGS(**kwargs)[source]

Bases: NonlinearSolver

Nonlinear block Gauss-Seidel solver.

Parameters:
**kwargsdict

Options dictionary.

Attributes:
_delta_outputs_n_1ndarray

Cached change in the full output vector for the previous iteration. Only used if the aitken acceleration option is turned on.

_theta_n_1float

Cached relaxation factor from previous iteration. Only used if the aitken acceleration option is turned on.

SOLVER = 'NL: NLBGS'
__init__(**kwargs)[source]

Initialize all attributes.

add_recorder(recorder)

Add a recorder to the solver’s RecordingManager.

Parameters:
recorder<CaseRecorder>

A recorder instance to be added to RecManager.

can_solve_cycle()

Return True if this solver can solve groups with cycles.

Returns:
bool

True if this solver can solve groups with cycles.

cleanup()

Clean up resources prior to exit.

get_outputs_dir(*subdirs, mkdir=True)

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

Parameters:
*subdirsstr

Subdirectories nested under the relevant problem output directory. To create {prob_output_dir}/a/b one would pass solver.get_outputs_dir(‘a’, ‘b’).

mkdirbool

If True, attempt to create this directory if it does not exist.

Returns:
pathlib.Path

The path of the outputs directory for the problem.

get_reports_dir()

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

If it doesn’t exist, it will be created.

Returns:
str

The path to the directory where reports should be written.

property linesearch

Get the linesearch solver associated with this solver.

Returns:
NonlinearSolver or None

The linesearch associated with this solver, or None if it does not support one.

property msginfo

Return info to prepend to messages.

Returns:
str

Info to prepend to messages.

record_iteration(**kwargs)

Record an iteration of the current Solver.

Parameters:
**kwargsdict

Keyword arguments (used for abs and rel error).

report_failure(msg)

Report a failure that has occurred.

The msg may be printed or ignored depending on the iprint option, and may raise an AnalysisError depending on the err_on_non_converge option.

Parameters:
msgstr

Message indicating the failure.

solve()

Run the solver.

use_relevance()

Return True if relevance should be active.

Returns:
bool

True if relevance should be active.