- This topic has 3 replies, 2 voices, and was last updated 7 years, 3 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Programming with SOFA › [SOLVED] ForceField with implicit iterative solver
Tagged: addDForce, Forcefield, implicit solver
Hi,
I have written a custom ForceField
and implemented both addForce and addDForce. The simulation runs fine when using an explicit solver, but when I switch to an implicit iterative solver the object is totally rigid and I cannot pull on any vertex. When debugging, the dx input argument to addDForce seems to always be 0.
In case it might matter, I am using a 1D ForceField
with a 1D MechanicalObject
custom mapped to another 3D MechanicalObject
as outlined in my previous post Using model reduction in SOFA
Any ideas what I might be doing wrong?
Thanks!
—
Bassam
Hey @beejay ,
alright then, if the explicit simulation gives you the right behaviour/result (are your sure about it?), then the addForce
function is well implemented.
About the implicit simulation:
– are you sure the object is not moving (even small value in the velocity
field of the MechanicalObject
) ?
– If so, are you sure to have both the integration scheme (ODESolver, e.g. EulerImplicitSolver) AND a linear solver (e.g. CGLinearSolver) ?
– what are the value of iterations / threshold / tolerance in the CG (if you are using one) ?
– finally, the problem could also come from your mapping
Could you share us the explicit and implicit scene ?
Hugo
Hi Hugo,
You nailed it, I had a problem in my mapping’s applyJT
where I was overwriting the output value instead of adding to it, therefore overwriting my ForceField’s contribution. The overall simulation still ran with an explicit solver, albeit with no internal forces, and with a heavy dose of wishful thinking I assumed it worked fine..
I have got it working now, thank you!
Bassam
Closing this topic!
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.