version 0.4.4
Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF > Class Template Reference

Newton-Raphson solver with subsidiary function. More...

#include <ikarus/solver/nonlinearsolver/newtonraphsonwithscalarsubsidiaryfunction.hh>

Inheritance diagram for Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >:
[legend]

Public Types

using Settings = NewtonRaphsonWithSubsidiaryFunctionSettings
 
using SignatureTraits = typename F::Traits
 
using Domain = typename SignatureTraits::Domain
 Type representing the parameter vector of the Function. More...
 
using CorrectionType = typename SignatureTraits::template Range< 0 >
 Type of the correction of x += deltaX. More...
 
using JacobianType = typename SignatureTraits::template Range< 1 >
 Compile-time boolean indicating if the linear solver satisfies the non-linear solver concept. More...
 
using UpdateFunction = UF
 
using DifferentiableFunction = F
 Type of the non-linear operator. More...
 
using IDBCForceFunction = IDBCF
 Type representing the force function to handle inhomogeneous Dirichlet BCs. More...
 
using State = NonlinearSolverStateType< F >
 
using MessageType = NonLinearSolverMessages
 
using Callback = std::function< void(NonLinearSolverMessages, const State &)>
 
using Token = std::shared_ptr< Callback >
 

Public Member Functions

template<typename LS2 = LS, typename UF2 = UF, typename IDBCF2 = IDBCF>
 NewtonRaphsonWithSubsidiaryFunction (const DifferentiableFunction &residual, LS2 &&linearSolver={}, UF2 &&updateFunction={}, IDBCF2 &&idbcForceFunction={})
 Constructor for NewtonRaphsonWithSubsidiaryFunction. More...
 
void setup (const Settings &settings)
 Setup the Newton-Raphson solver with subsidiary function. More...
 
template<typename SubsidiaryType >
NonLinearSolverInformation solve (Domain &req, SubsidiaryType &&subsidiaryFunction, SubsidiaryArgs &subsidiaryArgs)
 Solve the nonlinear system using the Newton-Raphson method with subsidiary function. More...
 
auto & residual ()
 Access the residual function. More...
 
const auto & residual () const
 Access the function. More...
 
const UpdateFunctionupdateFunction () const
 Access the update function. More...
 
const IDBCForceFunctionidbcForceFunction () const
 Access the force function calculating internal forces due to inhomogeneous Dirichlet BCs. More...
 
Token registerListener (Callback callback)
 This method is used to register a Listener function. More...
 
void unregisterListener (Token token)
 deregisters a specific function More...
 
void notify (NonLinearSolverMessages message, const State &data)
 This calls all the registered functions. More...
 

Static Public Attributes

static constexpr bool isLinearSolver = Ikarus::Concepts::LinearSolverCheck<LS, JacobianType, CorrectionType>
 Type representing the update function. More...
 

Detailed Description

template<typename F, typename LS, typename UF, typename IDBCF>
class Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >

This class provides a Newton-Raphson solver for solving nonlinear systems with a subsidiary function. It uses a linear solver to handle the linear system arising in each iteration.

Template Parameters
FType of the function.
LSType of the linear solver used internally (default is SolverDefault).
UFType of the update function (default is UpdateDefault).
IDBCFType of the force function to handle inhomogeneous Dirichlet BCs (defaults to IDBCForceDefault).

Member Typedef Documentation

◆ Callback

using Ikarus::Broadcaster< NonLinearSolverMessages , NonlinearSolverStateType< F > >::Callback = std::function<void(NonLinearSolverMessages , const State&)>
inherited

◆ CorrectionType

template<typename F , typename LS , typename UF , typename IDBCF >
using Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >::CorrectionType = typename SignatureTraits::template Range<0>

◆ DifferentiableFunction

template<typename F , typename LS , typename UF , typename IDBCF >
using Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >::DifferentiableFunction = F

◆ Domain

template<typename F , typename LS , typename UF , typename IDBCF >
using Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >::Domain = typename SignatureTraits::Domain

◆ IDBCForceFunction

template<typename F , typename LS , typename UF , typename IDBCF >
using Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >::IDBCForceFunction = IDBCF

◆ JacobianType

template<typename F , typename LS , typename UF , typename IDBCF >
using Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >::JacobianType = typename SignatureTraits::template Range<1>

◆ MessageType

◆ Settings

template<typename F , typename LS , typename UF , typename IDBCF >
using Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >::Settings = NewtonRaphsonWithSubsidiaryFunctionSettings

◆ SignatureTraits

template<typename F , typename LS , typename UF , typename IDBCF >
using Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >::SignatureTraits = typename F::Traits

◆ State

using Ikarus::NonlinearSolverBase< F, Args >::State = NonlinearSolverStateType<F>
inherited

◆ Token

using Ikarus::Broadcaster< NonLinearSolverMessages , NonlinearSolverStateType< F > >::Token = std::shared_ptr<Callback>
inherited

◆ UpdateFunction

template<typename F , typename LS , typename UF , typename IDBCF >
using Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >::UpdateFunction = UF

Constructor & Destructor Documentation

◆ NewtonRaphsonWithSubsidiaryFunction()

template<typename F , typename LS , typename UF , typename IDBCF >
template<typename LS2 = LS, typename UF2 = UF, typename IDBCF2 = IDBCF>
Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >::NewtonRaphsonWithSubsidiaryFunction ( const DifferentiableFunction residual,
LS2 &&  linearSolver = {},
UF2 &&  updateFunction = {},
IDBCF2 &&  idbcForceFunction = {} 
)
inlineexplicit
Parameters
residualresidual to solve.
linearSolverLinear solver used internally (default is SolverDefault).
updateFunctionUpdate function (default is UpdateDefault).
idbcForceFunctionForce function to handle inhomogeneous Dirichlet BCs (default is IDBCForceDefault).

Member Function Documentation

◆ idbcForceFunction()

template<typename F , typename LS , typename UF , typename IDBCF >
const IDBCForceFunction & Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >::idbcForceFunction ( ) const
inline
Returns
Reference to the function.

◆ notify()

void Ikarus::Broadcaster< NonLinearSolverMessages , NonlinearSolverStateType< F > >::notify ( NonLinearSolverMessages  message,
const State data 
)
inlineinherited

◆ registerListener()

Token Ikarus::Broadcaster< NonLinearSolverMessages , NonlinearSolverStateType< F > >::registerListener ( Callback  callback)
inlineinherited

The function that is passed in is first stored in a shared_ptr. After this, the shared_ptr is added to the vector of listener functions, which leads to a implicit conversion to a weak_ptr. The shared_ptr is then returned to the Listener that has called this function to be stored in a vector of shared_ptr<void> listener.hh.

Parameters
callbackthe callback function
Returns
Token

◆ residual() [1/2]

template<typename F , typename LS , typename UF , typename IDBCF >
auto & Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >::residual ( )
inline
Returns
Reference to the residual function.

◆ residual() [2/2]

template<typename F , typename LS , typename UF , typename IDBCF >
const auto & Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >::residual ( ) const
inline
Returns
Reference to the function.

◆ setup()

template<typename F , typename LS , typename UF , typename IDBCF >
void Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >::setup ( const Settings settings)
inline
Parameters
p_settingsSettings for the solver.

◆ solve()

template<typename F , typename LS , typename UF , typename IDBCF >
template<typename SubsidiaryType >
NonLinearSolverInformation Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >::solve ( Domain req,
SubsidiaryType &&  subsidiaryFunction,
SubsidiaryArgs subsidiaryArgs 
)
inline
Template Parameters
SubsidiaryTypeType of the subsidiary function.
Parameters
subsidiaryFunctionSubsidiary function to be solved.
reqWhere the solution should be stored.
subsidiaryArgsAdditional arguments for the subsidiary function.
dxPredictorPredictor for the solution increment (default is NoPredictor).
Returns
Information about the solution process.

Determine Fext0 It is assumed that Fext = Fext0 * lambda such that dRdlambda = Fext0 Generalization for Fext0 = Fext0(lambda) is not implemented Forces due to inhomogeneous Dirichlet BCs is treated separately

Iterative solving scheme

Two-step solving procedure

◆ unregisterListener()

void Ikarus::Broadcaster< NonLinearSolverMessages , NonlinearSolverStateType< F > >::unregisterListener ( Token  token)
inlineinherited

◆ updateFunction()

template<typename F , typename LS , typename UF , typename IDBCF >
const UpdateFunction & Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >::updateFunction ( ) const
inline
Returns
Reference to the function.

Member Data Documentation

◆ isLinearSolver

template<typename F , typename LS , typename UF , typename IDBCF >
constexpr bool Ikarus::NewtonRaphsonWithSubsidiaryFunction< F, LS, UF, IDBCF >::isLinearSolver = Ikarus::Concepts::LinearSolverCheck<LS, JacobianType, CorrectionType>
staticconstexpr

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