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*( x.dot(x)*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?

Reference:
https://github.com/yade/trunk/blob/master/core/Clump.cpp#L178

Thank you

Question information

Language:
English Edit question
Status:
Solved
For:
Yade Edit question
Assignee:
No assignee Edit question
Solved by:
Robert Caulk
Solved:
2019-04-23
Last query:
2019-04-23
Last reply:
2019-04-23
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?

[1]https://gitlab.com/yade-dev/trunk/commit/5fef57e3a925e803e6c5009f7ec30884a2cb9c37

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

Hello,
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..

cheers
Jan

Best Robert Caulk (rcaulk) said : #3

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

[1]https://gitlab.com/yade-dev/trunk/merge_requests/101

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 :-)
Jan