a question compute reduce/region command

You are probably normalizing your thermo output by the number of atoms.
The 2 computes produce extensive quantities, so they will then
be divided by N. The output of variables is never normalized
since LAMMPS doesn't know what you're computing in a variable formula.

In all cases you probably want to normalize these values by the number
of atoms in the region, which you can do with a variable formula and
the count() function.


Dear Steve,
Thanks for point that out. It seems like that the compute values are on per atom basis. I did the following test. I used the whole box (lowerbox) to calculate the kinetic energy. The c_kel gives same value as kinetic energy of the system. But v_tel which I assigned to be equal to c_kel gives totally different value. See below.

region lowerbox block -INF INF -INF INF -INF INF units box
compute ke all ke/atom
compute kel all reduce/region lowerbox sum c_ke
variable tel equal c_kel

thermo 100000
thermo_style custom step etotal pe ke c_kel v_tel
Step TotEng PotEng KinEng kel tel
1 -12.237788 -13.7534 1.5156115 1.5156115 6512.5824

I have 4297 atoms in the system. On multiplying c_kel with 4297, I get v_tel. But it was interesting to find out that kinetic energies and potential energy are printed on per atom basis when the atom style sphere.

Thanks again.

Best Regards,

no - I think the compute is calculating a big number. Its the thermo
output which is rescaling it. See the thermo_modify norm option,
which is yes by default for LJ units. The ouptut of the compute
is getting divided by N, the output of the variable is not.