Inertia Tensor for clumps with Intersecting Spheres

Asked by Bokkisa Srinivas Vivek on 2019-04-23

Hello community,

I was going through the Source code- Clump.cpp

The inertia tensor at local level for the intersecting spheres clump is calculated from the below equation (line no. 178):

Ig += m*(*Matrix3r::Identity()-x*x.transpose())+Matrix3r(Vector3r::Constant(dv*pow(dx,2)/6.).asDiagonal())

In the second part- "Matrix3r(Vector3r::Constant(dv*pow(dx,2)/6.).asDiagonal())",

I believe it should be m*pow(dx,2)/6 but instead it computes dv*pow(dx,2)/6, was it a mistake in code or done purposefully?


Thank you

Question information

English Edit question
Yade Edit question
No assignee Edit question
Solved by:
Robert Caulk
Last query:
Last reply:
Robert Caulk (rcaulk) said : #1

It looks like a mistake in the code. In fact, both terms were originally multiplied by dv. I think this commit [1] was aiming to fix it but only noticed the first term.

Can you confirm, Jan?


Jan Stránský (honzik) said : #2

good point, it looks like a mistake, definitely there should be m instead of dv..

2 points:
- the term tends to zero as discretization tends to infinity
- at the moment I have no idea why it is computed with respect to principal axes of the voxel, I **think** it should be computed with respect to global coordinate system..


Best Robert Caulk (rcaulk) said : #3

Thanks Bokkisa, I submitted the merge request for changing dv to m [1].


Thanks Robert Caulk, that solved my question.

Dear Jan, thanks for your confirmation.

I think inertia of all the voxels are calculated w.r.t Global Coordinate System (GCS) only. Using parallel axis theorem inertia at principal axis of voxel is translated to GCS. (Line 178)

After computing the centre of mass (C.O.M) of the clump, the inertia is translated again to the C.O.M. (Line 215)

Jan Stránský (honzik) said : #6

Yes, sorry, just ignore this part of my answer :-)