9 October 2019 at 16 h 33 min #14364
I am trying to build a scene (with the SOFA Python plugin) where a particular vertex of a tetrahedral mesh is subjected to a sequence of translation, given by this:
node.createObject('LinearMovementConstraint',name='moveConst',template='Vec3d',relativeMovements='true',movements='4 0 0 0 4 0 0 0 4',showMovement='true', keyTimes='1 1.5 2 2.5', indices = str(self.node))
self.nodeis the vertex ID.
Given this sequence of motion, I would like to know the external, unbalanced force acting on the object to cause this deformation, i.e., the amount of force I need to apply using a
LinearForceFieldtype of object to cause the same amount of deformation in the mechanical mesh. I would like to record these forces when a steady-state has been reached and the vertex has reached the desired position.
I tried to do this using two methods:
node.createObject("Monitor" , name="myMonitor", indices=str(self.node), ExportForces='true', showForces='false',fileName='/path/to/log/file.txt')
Both these methods produce similar outputs, but they do not seem to be reasonable.
For example, at the
keyTimes, it shows the force to be zero for most of the simulation, and then suddenly jumps to a meaningful value after a few sequence of translation has already been executed.
Could you please let me know the proper way to get this done (or point me to a proper documentation for doing this). Thanks in advance.11 October 2019 at 19 h 40 min #14395
The first concern that I have is that you are mixing two notions of “nodes”.
I would rather name the indices that you want to pass to your constraint:
nodeis also the graph node..
The idea of looking into the force vector was good, I don’t know exactly what makes the values to suddenly jump..
Internal forces resulting from imposed displacement are computed by the mechanical constitutive law. Depending on the FEM mechanical model you are using, you could export in the C++ code the vector resulting from the
Hugo11 October 2019 at 23 h 42 min #14397
So, can I assume that the VecDeriv object ‘f’ in the
addForce()method of FastTetrahedralCorotationalForceField would provide the force on each indices?
So the inverse of the resultant of all the forces is the external force needed to cause the same displacement?
If that is correct, it will neatly solve my problem. I will try this out soon.
Thanks a lot.27 November 2019 at 16 h 33 min #14634
Sorry for the delay of my reply, we have been busy with the SOFA Week. You can find out more about this annual community event on SofaFramework’s YouTube account.
The contribution computed in the
addForce()function and added in the f vector corresponds to the explicit contribution of the internal forces (due to the mechanical constitutive law). If you are in an implicit scheme, the internal forces contribute to the f vector with both an explicit contribution and an implicit contribution, related to the derivative of the internal force with regards to the degrees of freedom in the
addDForce()function. More info can be found in the documentation here.
Therefore you sentence “the inverse of the resultant of all the forces is the external force needed to cause the same displacement” would be true only in an explicit scenario. Because in implicit, the mechanical model also influences the system matrix A.
If I remember properly you are working in Hybrid team in Rennes. Is this correct?
In case you need a deeper introduction to SOFA, please let me know.
Hugo27 November 2019 at 23 h 01 min #14651
I’m in Rainbow team, not Hybrid.
Thanks for the information, I’ll stick to explicit solvers for the purpose.
Agniv29 November 2019 at 8 h 58 min #14662
If my previous reply answers your question, do not hesitate to close this topic.
You can open a new one anytime.
- You must be logged in to reply to this topic.