<BackwardEulerODESolver />¶
Doxygen:
SofaCaribou::ode::BackwardEulerODESolver
Implementation of an implicit backward euler solver compatible with non-linear materials.
We are trying to solve to following
where \(\boldsymbol{M}\) is the mass matrix, \(\boldsymbol{C}\) is the damping matrix, \(\boldsymbol{R}\) is the (possibly non-linear) internal elastic force residual and \(\boldsymbol{P}\) is the external force vector (for example, gravitation force or surface traction).
We first transform this second-order differential equation to a first one by introducing two independant variables:
Using the backward Euler scheme, we pose the following approximations:
where \(h\) is the delta time between the steps \(n\) and \(n+1\).
Substituting \((2)\) inside \((1)\) gives
And the problem becomes:
where \(\boldsymbol{a}_{n+1}\) is the vector of unknown accelerations.
Finally, assuming \(\boldsymbol{R}\) is non-linear in \(\boldsymbol{x}_{n+1}\), we iteratively solve for \(\boldsymbol{a}_{n+1}\) using the Newton-Raphson method and using the previous approximations to back propagate it inside the velocity and position vectors.
Let \(i\) be the Newton iteration number for a given time step \(n\), we pose
where \(\boldsymbol{x}_{n}\) and \(\boldsymbol{x}_{n}\) are the position and velocity vectors at the beginning of the time step, respectively, and remains constant throughout the Newton iterations.
We then solve for \(\boldsymbol{a}_{n+1}^{i+1}\) with
And propagate back the new acceleration using \((1)\) and \((2)\).
In addition, this component implicitly adds a Rayleigh’s damping matrix \(\boldsymbol{C}_r = r_m \boldsymbol{M} + r_k \boldsymbol{K}(\boldsymbol{x}_{n+1})\). We therefore have
Attribute |
Format |
Default |
Description |
---|---|---|---|
printLog |
bool |
false |
Output informative messages at the initialization and during the simulation. |
rayleigh_stiffness |
double |
0.0 |
The stiffness factor \(r_k\) used in the Rayleigh’s damping matrix \(\boldsymbol{D} = r_m \boldsymbol{M} + r_k \boldsymbol{K}\). |
rayleigh_mass |
double |
0.0 |
The mass factor \(r_m\) used in the Rayleigh’s damping matrix \(\boldsymbol{D} = r_m \boldsymbol{M} + r_k \boldsymbol{K}\). |
newton_iterations |
int |
1 |
Number of newton iterations between each load increments (normally, one load increment per simulation time-step). |
correction_tolerance_threshold |
float |
1e-5 |
Relative convergence criterion: The newton iterations will stop when the norm of correction \(\frac{|\delta \boldsymbol{u}^{k}|}{\sum_{i=0}^k|\delta \boldsymbol{u}^{i}|}\) reaches this threshold. |
residual_tolerance_threshold |
float |
1e-5 |
Relative convergence criterion: The newton iterations will stop when the relative norm of the residual \(\frac{|\boldsymbol{R}_k|}{|\boldsymbol{R}_0|}\) at iteration k is lower than this threshold. Use a negative value to disable this criterion. |
absolute_residual_tolerance_threshold |
float |
1e-15 |
Absolute convergence criterion: The newton iterations will stop when the absolute norm of the residual \(|\boldsymbol{R}_k|\) at iteration k is lower than this threshold. This criterion is also used to detect the absence of external forces and skip useless Newton iterations. Use a negative value to disable this criterion. |
pattern_analysis_strategy |
option |
BEGINNING_OF_THE_TIME_STEP |
Define when the pattern of the system matrix should be analyzed to extract a permutation matrix. If the sparsity and location of the coefficients of the system matrix doesn’t change much during the simulation, then this analysis can be avoided altogether, or computed only one time at the beginning of the simulation. Else, it can be done at the beginning of the time step, or even at each reformation of the system matrix if necessary. The default is to analyze the pattern at each time step.
|
linear_solver |
LinearSolver |
None |
Linear solver used for the resolution of the system. Will be automatically found in the current context node if none is supplied. |
converged |
bool |
N/A |
Whether or not the last call to solve converged. |
Quick example¶
XML
<Node>
<BackwardEulerODESolver rayleigh_stiffness="0.1" rayleigh_mass="0.1" newton_iterations="10" correction_tolerance_threshold="1e-8" residual_tolerance_threshold="1e-8" printLog="1" />
<LLTSolver backend="Pardiso" />
</Node>
Python
node.addObject('BackwardEulerODESolver', rayleigh_stiffness=0.1, rayleigh_mass=0.1, newton_iterations=10, correction_tolerance_threshold=1e-8, residual_tolerance_threshold=1e-8, printLog=True)
node.addObject('LLTSolver', backend='Pardiso')
Available python bindings¶
None at the moment.