Home › Forum › SOFA › Programming with SOFA › [SOLVED] Triangular FEM Methods
Tagged: FEM, hyperelastic, triangles
- This topic has 2 replies, 2 voices, and was last updated 8 years, 9 months ago by Hugo.
-
AuthorPosts
-
24 December 2015 at 01:36 #5246rajadityaBlocked
I am looking for the basefiles by which I can develop a Hyperelastic (neohookean) FEM simulator for 3D triangular element. But so far, I am confused between looking at two sets of libraries : one which contains “SofaSimpleFEM” and the other which contains “SofaMiscFEM”. More specifically I am looking for the computation of the element stiffness matrix for the same. Can anyone point me to the approximate locations of these files where the said computations are done.
Any helpful discussions in this regard is greatly appreciated. Happy Holidays
24 December 2015 at 12:06 #5247HugoKeymasterDear Raj,
Nice to hear that you want to develop a NeoHookean triangular forcefield in SOFA.
I do understand what you mean about your confusion about the library names. This comes from a classification of the code. Many codes were existing in the past, we separated it so that the basic/usual FEM are in SofaSimpleFEM. The more advanced and specific implementations of forcefields is stored in SofaMiscFEM.
To implement your own NeoHookean triangular forcefield, there is several functions of interest (to build the stiffness matrix K). You can take the SofaSimpleFEM/TriangularFEMForceFieldOptim.inl, as an example. If you are using a CG (iteretive) approach, then look at the addForce and addDForce functions.
- addForce: in the system Ax=b, addForce builds the b vector by multiplying K with u.
- addDForce: is used for implicit integration and add the stiffness component to the A matrix, but without constructing A (direct matrix vector multiplication)
If you are using a direct solver, look at the addKToMatrix function instead of addDForce. addKToMatrix does the same operation but the matrix A is really built
A plugin called Flexible (applications/plugins/Flexible) already implements the NeoHookean constitutive law. However, the specificity of this plugin is that the constitutive law and the shape functions (element type) are decoupled. I don’t know this plugin very well, but some other users should be able to help you with it. You can already have a look at the example: applications/plugins/Flexible/examples/material/NeoHookean.scn
Hope these first clues will help you.
Hugo
25 January 2016 at 18:03 #5382HugoKeymasterDear Raj,
Did my reply help you or do you need further support ?
Best regards,Hugo
-
AuthorPosts
- You must be logged in to reply to this topic.