This is a simple implementation of FEM for simulating StVK material. The numerical method used here is Gradient Descent.
-
main.cpp
-
FEMSimObj.cpp
-
MeshLoader.cpp
-
Mesh.cpp
- TetMesh.cpp
-
Constraint.cpp
-
TetConstraint.cpp
-
CollisionConstraint.cpp
-
A single "tet" file looks like this:
It could be generated by a Houdini node provided by my mentor Haowei Han (RD in Light Chaser Animation).
This program will output a series of "tet" files corresponding to each frame, which includes the information of positions and indices of a mesh. These files could be read by the "tetHDA" node in Houdini which is mentioned above. Therefore, the visualization of this program is in Houdini.
(unit/point mass = 0.01f, mu = 2e6, lambda = 8e6)
unit/point mass = 0.5f, mu = 5e4, lambda = 20e4
unit/point mass = 1.0f, mu = 5e4, lambda = 20e4
unit/point mass = 1.0f, mu = 8e4, lambda = 32e4
This implementation of FEM simulating StVK ONLY contains two constraints: tetrahedra constraint and collision constraint, which means the rest of constraints distance constraint and attachment constraint. Meanwhile, the implementation uses gradient descent instead of Newton's method.