Principal moment of inertia

Hello everyone!!
Is there any way to calculate the principal moment of inertia of some molecule in LAMMPS? I am trying to calculate it for many molecule to see how they orient to each other.I am working atomistically.
Thanks a lot,

Just added a compute inertia/molecule command (1Dec patch).
You can try it out. It calculates the 6 components of the inertia
tensor, not the principal moments. The latter would have
to be added as an option to diagonalize the tensor for each molecule.


Hi Steve,

I just wanted to point out that there may be a bug in the file “compute_inertia_molecule.cpp”.

Lines 159-161 read:

dx = unwrap[0] - com[imol][0];
dy = unwrap[1] - com[imol][1];
dz = unwrap[2] - com[imol][2];

They should read:

dx = unwrap[0] - comall[imol][0];
dy = unwrap[1] - comall[imol][1];
dz = unwrap[2] - comall[imol][2];

yes, you’re right - I’ll post a patch when I’m
back in the office (next week).