density calculation difference with compute

Dear Lammps users,

I am tracking density/mass change in solid melting process. I did it using “compute chunk/atom” and “fix ave/chunk” but here is one issue I do not understand:

I got correct density when I used compute chunk/atom bin/3d and defined a box for calculation of density.
When I used “compute chunk/atom type”, the results got to 211054 which I do not know where it comes from (it is not atom number).
In the fix ave/chunk documentation, it says when a box is defined, use volume of box to calculate results, if not, used whole simulation box volume. This does not match my results either.

Anyone got any clue about how this happens?

Thanks for help.

If you post a small simple example script that gives

a funny result (best on 1 proc), we can look at it.


Hi Steve,

for example, these commands are right with results:

compute den all chunk/atom bin/3d z lower 5 y 0 10 x 0 10
fix den all ave/chunk 2 20 100 den density/mass file my.density

but these are not.

compute den all chunk/atom type
fix den all ave/chunk 2 20 100 den density/mass file my.density

my simulation box is 10x10x20 with p p s boundary condition.


yes, there was a missing volume term for density normalization when

the chunk style is not spatial bins. Will be fixed in next patch.