(no subject)


I try to calculate the rotational energy of a rigid body in lammps but I don’t know if lammps calculates the rotational energy or not…?
I defined two groups and used 2 fix for my system
group hydroxyl type 2 3
group Ar type 1

fix 1 Ar npt temp 300 300 10 iso 50 50 100 dilate all
fix 2 hydroxyl rigid/nvt single temp 300 300 10

the OH here is the rigid body and I want to calculate its rotational and translational energy and I read the manual for dumping the data but I just found this part

All of the rigid fixes except rigid/small compute a global array of values which can be accessed by various output commands. The number of rows in the array is equal to the number of rigid bodies. The number of columns is 15. Thus for each rigid body, 15 values are stored: the xyz coords of the center of mass (COM), the xyz components of the COM velocity, the xyz components of the force acting on the COM, the xyz components of the torque acting on the COM, and the xyz image flags of the COM, which have the same meaning as image flags for atom positions (see the “dump” command).

and no clue of how to dump them.

Would you please tell me how I can do this.
Thank you.


The link in the part of the manual that you quoted explains how to output all kinds of properties.

You have keep reading all of the relevant documentation, not just the first part you come across.


Fix rigid does not compute or output the rotational or translation
energy of its bodies. But the variable command has “group” keywords
that will compute inertia and omega and vcm and mass of a group
of atoms. So you could define a variable that calculates 1/2 I w^2
and another for 1/2 M vcm^2, and output those values.


Thank you.