sofa icon indicating copy to clipboard operation
sofa copied to clipboard

[SofaImplicitOdeSolver] Add a Euler implicit solver with Newton iterations

Open jjcasmar opened this issue 3 years ago • 8 comments

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 avatar Jun 28 '21 10:06 jjcasmar

@jjcasmar Do you still plan to update NBESolver? You said on Gitter it was not up-to-date.

guparan avatar Jul 05 '21 15:07 guparan

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.

jjcasmar avatar Jul 05 '21 17:07 jjcasmar

Any news @jjcasmar ? 🧐

fredroy avatar Jul 30 '21 08:07 fredroy

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.

jjcasmar avatar Aug 09 '21 08:08 jjcasmar

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

jjcasmar avatar Aug 30 '21 23:08 jjcasmar

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 ) ?

fredroy avatar Sep 01 '21 08:09 fredroy

Any update @jjcasmar on this work?

hugtalbot avatar Nov 17 '21 10:11 hugtalbot