Rigid object in Taichi element

I’m trying to add a rigid object in MLS-MPM simulation to simulate interaction between rigid objects and elastic objects, I’m wondering if there is any example to show how to add a rigid object in a MLS-MPM simulation. Thanks. :slightly_smiling_face:


A simple solution would be to restrict the degrees of freedom of an elastic body to SO(2) in 2D and SO(3) in 3D. For example, this repo GitHub - runck/taichi_boat_on_sea shows a quick fix to simulate rigid bodies within the MLS-MPM framework.

If your rigid-body contains thin-shells (which is normally considered hard to solve using material point methods), you might also want to try CPIC. Here’s a sample implementation of CPIC and MPM using Taichi: GitHub - Zhijie-YU/MLS_MPM_CPIC: CPIC cases implemented with taichi.


1 Like

Hi Tiantian, thanks a lot for your reply, very useful. I will have a look and try :+1: :grinning:

Hello, I’ve been learning about this recently, but I’m getting an error when I try to run the code on the https://github.com/Zhijie-YU/MLS_MPM_CPIC/blob/main/mpm_fan_rotation.py page. I am not sure what is causing this and if it is due to a version iteration.How can I solve this problem? Pleace

Yes, it does have something to do with version updates, adding [None] to the index will solve the problem!

Hello, I also have some problems when running the mpm_fan_rotation.py,

How did you change ‘’‘J_line[None] = m_line * length**2 / 3.0 * n_bodies # total J for a fan’‘’ this code to let both variables in the same data type? It seems some variables in Expr and some are ScalarField.

Here is :J_line[None] = m_line[None] * length ** 2 / 3.0 * n_bodies

1 Like


Hi, Yunlong

Thanks for the answer, except for some ‘ScalarField’ Problems, it still has some problems showing that the type of og_Vec is invalid.

Because [ omega[None] ] should be used here as well. u didnt use [None]

1 Like