OGS
NumLib::NewtonStepStrategy Class Referenceabstract

Detailed Description

Abstract globalization and step-acceptance strategy for Newton-Raphson iterations.

Concrete implementations (e.g. FixedDampingStrategy) decide how to scale the raw Newton direction \( -\Delta x \) before it is applied to the current solution. The NonlinearSolver<Newton> owns one strategy instance and calls applyStep() once per iteration.

Definition at line 57 of file NewtonStepStrategy.h.

#include <NewtonStepStrategy.h>

Inheritance diagram for NumLib::NewtonStepStrategy:
[legend]
Collaboration diagram for NumLib::NewtonStepStrategy:
[legend]

Public Member Functions

virtual void initialize (GlobalVector const &)
virtual StepResult applyStep (GlobalVector const &x, GlobalVector const &minus_delta_x, GlobalVector const &res, GlobalMatrix const &J, GlobalVector &x_new, NewtonStepContext &ctx, int iteration)=0
void setDampingPolicy (DampingPolicy const *policy)
virtual ~NewtonStepStrategy ()=default

Protected Attributes

DampingPolicy const * _damping_policy = nullptr

Constructor & Destructor Documentation

◆ ~NewtonStepStrategy()

virtual NumLib::NewtonStepStrategy::~NewtonStepStrategy ( )
virtualdefault

Member Function Documentation

◆ applyStep()

virtual StepResult NumLib::NewtonStepStrategy::applyStep ( GlobalVector const & x,
GlobalVector const & minus_delta_x,
GlobalVector const & res,
GlobalMatrix const & J,
GlobalVector & x_new,
NewtonStepContext & ctx,
int iteration )
pure virtual

Given the current solution x, the Newton direction minus_delta_x, the residual res, and the Jacobian J, compute and apply a step to x_new. The strategy is free to re-evaluate F(x) internally.

Parameters
[in]xcurrent solution
[in]minus_delta_xfull Newton step (J^{-1} r)
[in]resresidual at x
[in]JJacobian at x (may be used for curvature)
[out]x_newaccepted new solution
[in]ctxequation system context for re-evaluation
[in]iterationcurrent outer iteration number

Implemented in NumLib::DampingReductionStrategy, and NumLib::FixedDampingStrategy.

◆ initialize()

virtual void NumLib::NewtonStepStrategy::initialize ( GlobalVector const & )
inlinevirtual

Called once before the outer Newton loop starts. The default implementation is a no-op; override if the strategy needs to cache the initial solution (e.g. for trust-region radius initialisation).

Definition at line 64 of file NewtonStepStrategy.h.

64{}

◆ setDampingPolicy()

void NumLib::NewtonStepStrategy::setDampingPolicy ( DampingPolicy const * policy)
inline

Inject the damping policy from the convergence criterion. Called by NonlinearSolver::setEquationSystem() before the first solve. A null pointer means the criterion imposes no step-length constraint.

Definition at line 87 of file NewtonStepStrategy.h.

88 {
89 _damping_policy = policy;
90 }
DampingPolicy const * _damping_policy

References _damping_policy.

Member Data Documentation

◆ _damping_policy

DampingPolicy const* NumLib::NewtonStepStrategy::_damping_policy = nullptr
protected

The documentation for this class was generated from the following file: