Home › Forum › SOFA › Programming with SOFA › [SOLVED] Solving FEM system
Tagged: 64_bits, deformations, FEM, finite element method, Linux_ubuntu, SOFA_1706
- This topic has 8 replies, 3 voices, and was last updated 6 years, 11 months ago by jnbrunet.
-
AuthorPosts
-
21 November 2017 at 17:13 #10166CatherineBlocked
Hi,
I am trying to find the new configuration of vertices of a mesh after a deformation using FEM. I have an .obj file containing the mesh and know the external forces applied to each node as well as the Young modulus and Poisson ratio. Is it possible to use SOFA to find the new vertex positions and, if so, how do I go about calculating them?
Thank you,
Catherine21 November 2017 at 17:15 #10167HugoKeymasterDear Catherine,
Welcome on the SOFA forum!
Yes it is possible. Physics simulation is what SOFA is made for.
Do you have already a SOFA scene ?Hugo
21 November 2017 at 18:03 #10168CatherineBlockedI have got a scene displaying my mesh but I am unsure of how to proceed from there.
Catherine
21 November 2017 at 19:10 #10169HugoKeymasterDear Catherine,
Please have a look at :
- the introduction paper
- the documentation (Main principles are described)
- and the tutorial scenes that you can start with (in SOFA, examples/Tutorials/ folder.
Unfortunately SOFA is not yet super newcomer-friendly but this is our 2018 mission. Let me know if you would be interest in a specific training session for SOFA.
Best regards,
22 November 2017 at 10:50 #10170CatherineBlockedThank you, I will have a look at those documents.
Catherine
22 November 2017 at 23:40 #10175CatherineBlockedHi,
I read the documents and have done several of the tutorials. Here is the .xml file that I have used for my scene so far: https://www.dropbox.com/s/xrogzmvkfebjtn0/Tutorial3.scn?dl=0&m= However, rather than deforming due to gravity or interaction from the user, I have a vector that contains the external force acting on each node in each frame and would like these values to be used by the Euler/CG solvers. Is there a way to feed in these vectors at each frame and visualise the corresponding deformation?
Thanks,
Catherine23 November 2017 at 09:03 #10176jnbrunetModeratorHi Catherine,
You can look at the
LinearForceField
component. If “Volume” is the name of yourMechanicalObject
, you could write:<LinearForceField points="@Volume.indices" forces="0 -1 0 0 -5 0 0 -10 0" times="0 10 20" />
This will set the forces to (0,-1,0) at time 0, (0, -5, 0) at time 10 and (0, -10, 0) at time 20. Between those times, the force will be linearly interpolated.
If you want to apply the forces on a subset of your domain, you can specify the indices of your dofs in the
points
attribute of theLinearForceField
. For exemple,<BoxROI name="f_indices" box="0 0 0 10 10 10"/> <LinearForceField points="@f_indices.indices" forces="0 -1 0 0 -5 0 0 -10 0" times="0 10 20" />
will set the forces contained in the box
(xmin, ymin, zmin, xmax, ymax, zmax) = (0,0,0,10,10,10)
If you need more than this, then I would suggest you to look at python scenes.
Let me know if you need more details.
Jean-Nicolas23 November 2017 at 09:33 #10177CatherineBlockedHi Jean-Nicolas,
Thank you for your response! However, I am looking to apply a different force vector to each node in the mesh rather than the same force everywhere. How do Ido this?
Thanks,
Catherine26 November 2017 at 14:30 #10178jnbrunetModeratorHi Catherine,
Unfortunately this is not possible with the
LinearForceField
component. I’m not sure if there is another component that would do that. If you are comfortable enough with c++, you could try to extend theLinearForceField
class to add this feature.Otherwise, I would suggest to look at python scenes, you can have a look at the various examples in the SofaPython plugin directory (sofa/applications/plugins/SofaPython/examples). You could, for instance, use a
ConstantForceField
component and change the values inside its vector of forces at each step with your python script.Let me know if you still struggle with this.
Jean-Nicolas -
AuthorPosts
- You must be logged in to reply to this topic.