NuTo
Numerics Tool
Classes | Functions
NuTo::NewtonRaphson Namespace Reference

Classes

struct  DoubleSolver
 "Solver" for scalar values More...
 
class  LineSearchImplementation
 Performs the line search algorithm based on the results of a single newton iteration step. More...
 
class  NoConvergence
 custom exception for the newton algorithm More...
 
class  NoLineSearch
 just a normal continuation of the newton scheme without using line search while keeping the interface of NuTo::LineSearch More...
 
struct  Problem
 problem definition More...
 
struct  VoidInfo
 takes any argument and does nothing... More...
 

Functions

template<typename TInfo = VoidInfo>
LineSearchImplementation< TInfo > LineSearch (TInfo info=VoidInfo(), int mMaxNumLineSearchStep=6)
 convienient instantiation of the NuTo::LineSearchImplementation with template deduction More...
 
template<typename TR , typename TDR , typename TNorm , typename TTol , typename TInfo = VoidInfo>
auto DefineProblem (TR residual, TDR derivative, TNorm norm, TTol tolerance, TInfo info=VoidInfo())
 defines the problem, basically just to enable automatic template deduction. More...
 
template<typename TNonlinearProblem , typename TX , typename TSolver , typename TLineSearchAlgorithm = NoLineSearch>
auto Solve (TNonlinearProblem &&problem, TX &&x0, TSolver &&solver, int maxIterations=20, TLineSearchAlgorithm &&lineSearch=NoLineSearch(), int *numIterations=nullptr)
 solves the Problem using the newton raphson iteration with linesearch More...
 

Function Documentation

template<typename TR , typename TDR , typename TNorm , typename TTol , typename TInfo = VoidInfo>
auto NuTo::NewtonRaphson::DefineProblem ( TR  residual,
TDR  derivative,
TNorm  norm,
TTol  tolerance,
TInfo  info = VoidInfo() 
)

defines the problem, basically just to enable automatic template deduction.

If you create a Problem directly, you'll have to specify each template parameter. This methods avoids it.

template<typename TInfo = VoidInfo>
LineSearchImplementation<TInfo> NuTo::NewtonRaphson::LineSearch ( TInfo  info = VoidInfo(),
int  mMaxNumLineSearchStep = 6 
)

convienient instantiation of the NuTo::LineSearchImplementation with template deduction

template<typename TNonlinearProblem , typename TX , typename TSolver , typename TLineSearchAlgorithm = NoLineSearch>
auto NuTo::NewtonRaphson::Solve ( TNonlinearProblem &&  problem,
TX &&  x0,
TSolver &&  solver,
int  maxIterations = 20,
TLineSearchAlgorithm &&  lineSearch = NoLineSearch(),
int *  numIterations = nullptr 
)

solves the Problem using the newton raphson iteration with linesearch

Parameters
problemtype of the nonlinear problem
x0of the initial value for the iteration
solversolver that provides a TX = solver.Solve(TNonlinearProblem::DR, TNonlinearProblem::R)
maxIterationsdefault = 20
lineSearchline search algorithm, default = NoLineSearch, alternatively use NuTo::LineSearch()
numIterationsoptionally returns the number of iterations required