Home › Forum › SOFA › Using SOFA › [SOLVED] Update parameters during simulation
Tagged: 64_bits, Linux_ubuntu, parameter, Plugin_SoftRobots, SOFA_1912
- This topic has 3 replies, 2 voices, and was last updated 5 years, 2 months ago by
Owen.
-
AuthorPosts
-
31 July 2020 at 17:52 #16996
Owen
BlockedHi everyone,
I encountered a little problem when I was trying to update the Young’s modulus with
self.pneu1Node.getObject('FEM').findData('youngModulus').value = 100000000000In the GUI it looked like the value has been updated, but it was not actually updated until I manually clicked on the ‘Update’ button. I am wondering if there is a way to call this ‘Update’ directly on my Python script?
Also, I noticed this post made last year asking about basically the same thing. It would be exciting to know if forceFields finally become updatable! :
Kind regards,
Owen14 August 2020 at 18:54 #17031Owen
BlockedHi @hugo
I am sorry to bother you. I guess you are very busy at the moment but I would like to know if there is any recent update on updating parameters in FEMForceFields like ‘TetrahedronFEMForceField.youngModulus’. Can you share some info and insights?
Thank you,
Owen24 August 2020 at 10:30 #17060Hugo
KeymasterDear @qwe12050
Sorry for the delay of my reply. As you know, the topic you are referring to is a topic!
When you click on Update, the Data (youngModulus) is up to date. However, the stiffness matrix is not. In the TetrahedronFEMForceField, the ‘materialsStiffnesses’ are computed only once at the beginning (see the reinit function which calls the computeMaterialStiffnesses() function) using the Young’s modulus. If you want this value to be updated with your new E, a brutal reinit would be required.
Note that a new mechanism has been introduce so that all components can implement an update with regards to their data. This mechanism has been introduced in the pull-requests #1406 / #1407 and an implementation is described in pull-request #1408.
All codes (including the TetrahedronFEMForceField) must therefore be updated to use this feature. E.g. the callback on the youndModulus data could call the reinit function.Best wishes,
Hugo
24 August 2020 at 13:03 #17061Owen
BlockedDear Hugo,
Thank you for your reply!
This new mechanism could be extremely useful for dynamics randomisation. I am going to give it a try. Thank you and all the other developers’ great effort! I will close the post now.
Best wishes,
Owen -
AuthorPosts
- You must be logged in to reply to this topic.
