sofa
sofa copied to clipboard
[SofaImplicitOdeSolver] Add a Euler implicit solver with Newton iterations
This is a port of the a Newton based Euler implicit solver I had in another project. In that project the solver return a ConvergenceStatus, which in the end allowed me to reduce the dt if the step failed to covnerged. In this case its not possible without modifying the AnimationLoop, but in any case, I am restoring the original position and velocities (or trying to, because it's not actually happening).
@jjcasmar Do you still plan to update NBESolver? You said on Gitter it was not up-to-date.
Yes, but I am doing some testing to check everything is worked as expected. I have some scenes using this NBESolver + a custom CG and they are failing, need to check if its the NBESolver or the CG.
Any news @jjcasmar ? 🧐
Sorry, I haven't done anything about this yet for SOFA. I am currently using the solver in my own project and right now I am testing it works correctly. I have some cases where the energy of the system seems to grow and I am not sure if its because of the solver or I have issues somewhere else, so I would say its not ready yet.
I have advance a bit on this and I have a robus implementation. But there is an issue regarding rayleigh damping. If we consider implicit damping forces, we would have something like f = - (aM + bK)*v_new. That M and K are constants (for example, they can be the M and K of the current point (M0 and K0 for instance)). They must remain constant, or we should take their derivatives.
That means that during the linear solve, we have to compute M and K of the current linealization point and M0 and K0 of the point where we compute the damping forces. That is not efficient at all. For example, with a CG solver, we would need to change the state of the mechanical objects for each CG iteration
List of things to do:
- fix conflicts
- expose the private members as Data<> (for getters/setters, py2, xml etc)
- register the component in the Factory (now it cannot be spawn like other BaseObject)
- get an example, tests
- some math people could review (@hugtalbot, @jnbrunet ) ?
Any update @jjcasmar on this work?