- This topic has 1 reply, 2 voices, and was last updated 9 years, 5 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Home › Forum › SOFA › Using SOFA › [SOLVED] PauseAnimation
Tagged: PauseAnimation; Solver; Event
Dear all,
I want to pause the simulation whenever the solver is going to diverge or the solution is unstable. There is a page on PauseAnimation Component which is not complete yet:
https://www.sofa-framework.org/documentation/general-documentation/components/pauseanimation/
Can anyone help me get this component to work for this specific event (i.e. solver divergence)?
Thanks
Hi Sharif,
Here what you want to do is not directly in SOFA, since you want to do something relatively specific. This topic is therefore more related to the “Developping in SOFA” forum.
To answer you questions. As always there is different ways of doing it.
What you can do is to create a component heriting from “PauseAnimation” (in modules/SofaGraphComponent).
1) This pause component must have “Data” linked to the parameters you want to monitor (i.e. convergence criterion)
2) The solver must have the required “Data” (convergence criterion) available. You will have to modify (on your local version) the solver (i.e. CGLinearSolver) to define a new data.
3) And at each time step, you can analyze this convergence Data in the pause component and use the pause() function to stop your simulation.
Another solution might be using Python.
Hope that helps.
Cheers,
Hugo
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.