How to dump the kinetic energy of rigid molecule

dimension 2
atom_style sphere
atom_modify map array
boundary p p p
comm_modify vel yes cutoff 2.5

fix prop all property/atom mol ghost yes

region box block 0 50 0 50 -0.5 0.5 units box
create_box 2 box

pair_style gran/hertz/history 2e4 NULL 100.0 NULL 0.5 0
pair_coeff * *

timestep 0.001

molecule allmol mol_rough.txt
create_atoms 0 random 600 458465 box mol allmol 4565 overlap 0.1 maxtry 20 units box
shell mkdir restart
restart 1000 restart/restart.equilibrium

fix 1 all rigid/nvt molecule temp 200.0 200.0 0.1
velocity all create 200 5454654 rigid 1
fix f2d all enforce2d
group mol molecule <> 1 600
compute 1 all erotate/sphere
compute 2 all temp/sphere
compute KE all ke/rigid 1
variable KB equal 8.625e-5
variable TEMP equal c_KE/${KB}
thermo_style custom step atoms ke c_2 c_KE v_TEMP
thermo_modify lost ignore norm no temp 2
compute_modify 2 dynamic/dof yes

thermo 1000
dump 1 all custom 100 tmp.dump id type radius mass x y z

run 10000
This is in.file.And i want to know how to dump the kinetic energy and the temp of the rigid molecule.I try to write the command:dump 2 mol custom 100 ke.dump mol c_KE.Error:Dump custom compute KE does not compute per-atom info.Sorry if this is a super-basic question,and thank you in advance!

You cannot use dump since the information you are accessing is global and not per-atom.

If you want to access the per-atom kinetic energy, you need to create a compute ke/atom instance.
If you want to get the kinetic energy per molecule, you need to create a compute chunk/atom instance that creates chunks based on the molecule ID and then use compute reduce/chunk to get the sum of the kinetic energy per chunk. If you want the temperature per molecule, you would have to use compute temp/chunk instead, but note that you have to manually correct the number of degrees of freedom per chunk (i.e. molecule) to account for those removed by using fix rigid.

Please see the documentation of the individual commands I mentioned and 8.3.2. Use chunks to calculate system properties — LAMMPS documentation for more information and guidance.

1 Like

Thank you for your reply.It is useful for me.And thank you for your help again.