- This topic has 3 replies, 2 voices, and was last updated 4 years, 2 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 › Using SOFA › [SOLVED] Update parameters during simulation
Tagged: 64_bits, Linux_ubuntu, parameter, Plugin_SoftRobots, SOFA_1912
Hi everyone,
I encountered a little problem when I was trying to update the Young’s modulus with self.pneu1Node.getObject('FEM').findData('youngModulus').value = 100000000000
In 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,
Owen
Hi @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,
Owen
Dear @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
Dear 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
WARNING
The forum has been moved to GitHub Discussions.
Old topics and replies are kept here as an archive.