Re: [lammps-users] Problem with the command msd/chunk

Compute msd calculates the MSD of each atom in the group and averages
them to give its output at each time point.

Compute msd/chunk treats all the atoms in one chunk (e.g. a molecule or in
your case I believe it is all the O atoms in one grain) as a single entity with
a center of mass, and computes the MSD over time of that entity.
Which is not what you want. That wll be effectively zero for a bunch of
O atoms diffusing randomly.

I think what you want is to use compute msd with fix ave/chunk defined
for 2 chunks (e.g. one for each grain). Then the compute msd value for
each O atom in one chunk will be averaged by fix ave/chunk and you will
get 2 values of output, one for O atoms diffusing in chunk 1 and one for chunk 2.


Thank you so much for your time and help.

I understand the mistake that i was doing, however, Im not sure how to carry out the solution that you explain.

As you said, my desire is to obtain the msd calculation for each O atom in one chunk averaged in one single output value. Similar to what msd command does when you use it for the complete model but divided for different regions of the cell. Following your explanation I wrote the following script:

fix 1 all npt temp 1200 1200 0.5 iso 0 0 0.5 drag 1

group O type 1

compute 1 O chunk/atom bin/1d z 47 20 bound z 47 67 compress yes

compute msd O msd

fix 2 O ave/chunk 100 1 100 1 c_msd[*] file tmp2.out

ERROR: Illegal fix ave/chunk command (…/fix_ave_chunk.cpp:265)

Last command: fix 2 O ave/chunk 100 1 100 1 c_msd[*] file tmp2.out

Your “fix ave/chunk” command is not correct. Please take another look at the doc page: