Implementation of the Newton-Raphson method for solving nonlinear equations. More...
#include <ikarus/solver/nonlinearsolver/newtonraphson.hh>
Public Types | |
using | Settings = NRSettings |
using | SignatureTraits = typename F::Traits |
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 | Domain = typename SignatureTraits::Domain |
Type representing the parameter vector of the function. More... | |
using | UpdateFunction = UF |
Type representing the update function. More... | |
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> | |
NewtonRaphson (const DifferentiableFunction &residual, LS2 &&linearSolver={}, UF2 &&updateFunction={}, IDBCF2 &&idbcForceFunction={}) | |
Constructor for NewtonRaphson. More... | |
void | setup (const Settings &settings) |
Set up the solver with the given settings. More... | |
NonLinearSolverInformation | solve (Domain &x, double stepSize=0.0) |
Solve the nonlinear system. More... | |
auto & | residual () |
Access the function. More... | |
const auto & | residual () const |
Access the function. More... | |
const UpdateFunction & | updateFunction () const |
Access the update function. More... | |
const IDBCForceFunction & | idbcForceFunction () 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> |
F | Type of the differentiable function to solve. |
LS | Type of the linear solver used internally (default is SolverDefault). |
UF | Type of the update function (default is UpdateDefault). |
IDBCF | Type of the force function to handle inhomogeneous Dirichlet BCs (defaults to IDBCForceDefault). |
|
inherited |
using Ikarus::NewtonRaphson< F, LS, UF, IDBCF >::CorrectionType = typename SignatureTraits::template Range<0> |
using Ikarus::NewtonRaphson< F, LS, UF, IDBCF >::DifferentiableFunction = F |
using Ikarus::NewtonRaphson< F, LS, UF, IDBCF >::Domain = typename SignatureTraits::Domain |
using Ikarus::NewtonRaphson< F, LS, UF, IDBCF >::IDBCForceFunction = IDBCF |
using Ikarus::NewtonRaphson< F, LS, UF, IDBCF >::JacobianType = typename SignatureTraits::template Range<1> |
|
inherited |
using Ikarus::NewtonRaphson< F, LS, UF, IDBCF >::Settings = NRSettings |
using Ikarus::NewtonRaphson< F, LS, UF, IDBCF >::SignatureTraits = typename F::Traits |
|
inherited |
|
inherited |
using Ikarus::NewtonRaphson< F, LS, UF, IDBCF >::UpdateFunction = UF |
|
inlineexplicit |
residual | residual to solve. |
linearSolver | Linear solver used internally (default is SolverDefault). |
updateFunction | Update function (default is UpdateDefault). |
idbcForceFunction | Force function to handle inhomogeneous Dirichlet BCs (default is IDBCForceDefault). |
|
inline |
|
inlineinherited |
|
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.
callback | the callback function |
|
inline |
|
inline |
|
inline |
settings | Newton-Raphson settings. |
|
inline |
x | Where the solution should be stored. |
stepSize | the step size of the control routine (defaults to 0.0) |
|
inlineinherited |
|
inline |
|
staticconstexpr |