I was for some time puzzled at the output of the following computes in lammps:
units lj
atom_style atomic
mass 1 1.0
mass 2 1.0
compute mass all property/atom mass
compute vp flow reduce/region pump sum c_mass vz
compute tp flow reduce/region pump avesq vx vy vz
thermo_style custom time pe etotal c_vp[1] c_vp[2] c_tp[1] c_tp[2] c_tp[3]
The reduce/region sum output show values like:
(sum mass) (sum velocity)
0.011658031 -0.0031486513
dividing -0.0031486513/0.011658031 gave what I expected for the average flow velocity.
and the reduce/region avesq would show values like what I’d expect for the temperature,
1.2837408 1.5237237 1.2449146
The mass would allow me to get the average velocity, but was not an integer!
I noticed by manually counting that the actual number in the region was always a factor of N larger – where N=2316 is the number of atoms in my system. So the conclusion is that the reduce/region is dividing its quantities by N. This is not what I expected from reading the manual, which only says (in the units section):
“Note that for LJ units, the default mode of thermodyamic output via the thermo_style command is to normalize energies by the number of atoms, i.e. energy/atom. This can be changed via the thermo_modify norm command.”
Should it say instead that all extensive quantities are normalized by the number of atoms? I think this is significant enough that the “reduce command” documentation should also warn about this.