Question about computing constraint forces using XPBD integrator
ShaoxiongYao opened this issue · comments
Hi,
I am using the XPBD integrator to simulate a tetrahedron FEM model. I am reading the original paper which mentioned the constraint forces can be computed https://matthias-research.github.io/pages/publications/XPBD.pdf. Equation (6) provides a way to compute elastic forces.
However, I realize these values are not saved in the body_f
or particle_f
attributes. Especially in the solve_tetrahedron
function, these values are never computed. If possible, I wonder if there these values can be saved in the integrator. Or, if you may provide a recommended way to create these values. The current implementation seems to have a different notation compared to the original paper. I am looking forward to your reply.
The current implementation is based on this paper: https://mmacklin.com/neohookean.pdf
It is relatively straightforward to compute the forces given the pose of the tetrahedron, you first compute C
, then multiply by inverse stiffness and gradient (as in the equation above).
Alternatively, you can look at the SemiImplicitIntegrator() which computes the forces from the tet pose directly using the same model. https://github.com/NVIDIA/warp/blob/main/warp/sim/integrator_euler.py#L608
Hope that helps.
Cheers,
Miles