SOFA API  b67a9394
Open source framework for multi-physics simuation
sofa::component::odesolver::backward::StaticResidualFunction Struct Reference
Inheritance diagram for sofa::component::odesolver::backward::StaticResidualFunction:

Public Attributes

sofa::simulation::common::MechanicalOperationsmop
 
core::behavior::MultiVecCoordx
 
core::behavior::MultiVecDerivforce
 
core::behavior::MultiVecDerivdx
 
core::behavior::LinearSolverlinearSolver { nullptr }
 

Public Member Functions

void evaluateCurrentGuess () override
 
SReal squaredNormLastEvaluation () override
 
void computeGradientFromCurrentGuess () override
 
void updateGuessFromLinearSolution (SReal alpha) override
 
void solveLinearEquation () override
 
SReal squaredNormDx () override
 
SReal squaredLastEvaluation () override
 
 StaticResidualFunction (sofa::simulation::common::MechanicalOperations &mop, core::behavior::MultiVecCoord &x, core::behavior::MultiVecDeriv &force, core::behavior::MultiVecDeriv &dx, core::behavior::LinearSolver *linearSolver)
 
- Public Member Functions inherited from sofa::component::odesolver::backward::newton_raphson::BaseNonLinearFunction
virtual ~BaseNonLinearFunction ()=default
 
virtual void startNewtonIteration ()
 
virtual void endNewtonIteration ()
 

Attribute details

◆ dx

core::behavior::MultiVecDeriv& sofa::component::odesolver::backward::StaticResidualFunction::dx

◆ force

core::behavior::MultiVecDeriv& sofa::component::odesolver::backward::StaticResidualFunction::force

◆ linearSolver

core::behavior::LinearSolver* sofa::component::odesolver::backward::StaticResidualFunction::linearSolver { nullptr }

◆ mop

sofa::simulation::common::MechanicalOperations& sofa::component::odesolver::backward::StaticResidualFunction::mop

◆ x

core::behavior::MultiVecCoord& sofa::component::odesolver::backward::StaticResidualFunction::x

Constructor details

◆ StaticResidualFunction()

sofa::component::odesolver::backward::StaticResidualFunction::StaticResidualFunction ( sofa::simulation::common::MechanicalOperations mop,
core::behavior::MultiVecCoord x,
core::behavior::MultiVecDeriv force,
core::behavior::MultiVecDeriv dx,
core::behavior::LinearSolver linearSolver 
)
inline

Function details

◆ computeGradientFromCurrentGuess()

void sofa::component::odesolver::backward::StaticResidualFunction::computeGradientFromCurrentGuess ( )
inlineoverridevirtual

Compute the gradient internally. It is not necessary to share this gradient with the outside

Implements sofa::component::odesolver::backward::newton_raphson::BaseNonLinearFunction.

◆ evaluateCurrentGuess()

void sofa::component::odesolver::backward::StaticResidualFunction::evaluateCurrentGuess ( )
inlineoverridevirtual

Evaluation of the function where the input is the current guess. If the function is called for the first time, then it is called on the initial guess. The evaluation is computed internally. It is not necessary to share this evaluation with the outside.

Implements sofa::component::odesolver::backward::newton_raphson::BaseNonLinearFunction.

◆ solveLinearEquation()

void sofa::component::odesolver::backward::StaticResidualFunction::solveLinearEquation ( )
inlineoverridevirtual

Solve the linear equation from a Newton iteration, i.e. it computes (x^{i+1}-x^i). It is solved internally. It is not necessary to share the result with the outside

Implements sofa::component::odesolver::backward::newton_raphson::BaseNonLinearFunction.

◆ squaredLastEvaluation()

SReal sofa::component::odesolver::backward::StaticResidualFunction::squaredLastEvaluation ( )
inlineoverridevirtual

◆ squaredNormDx()

SReal sofa::component::odesolver::backward::StaticResidualFunction::squaredNormDx ( )
inlineoverridevirtual

◆ squaredNormLastEvaluation()

SReal sofa::component::odesolver::backward::StaticResidualFunction::squaredNormLastEvaluation ( )
inlineoverridevirtual

Returns the squared norm of the last evaluation of the function

Implements sofa::component::odesolver::backward::newton_raphson::BaseNonLinearFunction.

◆ updateGuessFromLinearSolution()

void sofa::component::odesolver::backward::StaticResidualFunction::updateGuessFromLinearSolution ( SReal  alpha)
inlineoverridevirtual

Once (x^{i+1}-x^i) has been computed, the result is used internally to update the current guess. It computes x^{i+1} += alpha * dx, where dx is the result of the linear system. It is not necessary to share the result with the Newton-Raphson method.

Implements sofa::component::odesolver::backward::newton_raphson::BaseNonLinearFunction.