newton.py

Define the NewtonSolver class.

class openmdao.solvers.nonlinear.newton.NewtonSolver(**kwargs)[source]

Bases: openmdao.solvers.solver.NonlinearSolver

Newton solver.

The default linear solver is the linear_solver in the containing system.

Attributes

linear_solver (LinearSolver) Linear solver to use to find the Newton search direction. The default is the parent system’s linear solver.
linesearch (NonlinearSolver) Line search algorithm. Default is None for no line search.
SOLVER = 'NL: Newton'
__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()[source]

Clean up resources prior to exit.

Return the current linesearch object.

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.