Caribou
Public Types | Public Member Functions | List of all members
SofaCaribou::ode::NewtonRaphsonSolver Class Referenceabstract

Detailed Description

This class implements a generic Newton-Raphson solver for SOFA.

Let $\vect{F}(\vect{x})$ be a non-linear function. This component will try to solve

\begin{eqnarray*} \vect{F}(\vect{x}) = 0 \end{eqnarray*}

using the following iterative method:

\begin{align*} \mat{J} \left [ \Delta \vect{x}_{n+1}^{i+1} \right ] &= - \vect{F}(\vect{x}_{n+1}^i) \\ \vect{x}_{n+1}^{i+1} &= \vect{x}_{n+1}^{i} + \Delta \vect{x}_{n+1}^{i+1} \end{align*}

where $\vect{x}_{n}^{i}$ is the vector $\vect{x}$ evaluated at the time step $n$ and Newton iteration $i$. $\mat{J}$ is the jacobian of $\vect{F}$, and is defined as

\begin{align*} \mat{J} = \frac{\partial \vect{F}}{\partial \vect{x}_{n+1}} \bigg\rvert_{\vect{x}_{n+1}^i} \end{align*}

#include <NewtonRaphsonSolver.h>

Inheritance diagram for SofaCaribou::ode::NewtonRaphsonSolver:
SofaCaribou::ode::BackwardEulerODESolver SofaCaribou::ode::StaticODESolver

Public Types

template<typename T >
using Data = sofa::core::objectmodel::Data< T >
 
template<typename T >
using Link = sofa::core::objectmodel::SingleLink< NewtonRaphsonSolver, T, sofa::core::objectmodel::BaseLink::FLAG_STRONGLINK >
 

Public Member Functions

 SOFA_CLASS (NewtonRaphsonSolver, sofa::core::behavior::OdeSolver)
 
void init () override
 
void solve (const sofa::core::ExecParams *params, SReal dt, sofa::core::MultiVecCoordId x_id, sofa::core::MultiVecDerivId v_id) override
 
auto iteration_times () const -> const std::vector< UNSIGNED_INTEGER_TYPE > &
 List of times (in nanoseconds) that each Newton-Raphson iteration took to compute in the last call to Solve().
 
auto squared_residuals () const -> const std::vector< FLOATING_POINT_TYPE > &
 The list of squared residual norms (||r||^2) of every newton iterations of the last solve call.
 
auto squared_initial_residual () const -> const FLOATING_POINT_TYPE &
 The initial squared residual (||r0||^2) of the last solve call.
 

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