[lammps-users] forces output order changed in latest lammps version (07032010)

Hi everyone,

I noticed the output order of the atom forces has changed for the latest lammp version (07032010) comparing with lammps 25Oct2009 version. I used the following script to output the forces:

dump ani all custom 1 force.dat id fx fy fz
dump_modify ani format “%5d %12.6f %12.6f %12.6f”

The lammps 25Oct2009 can out put the forces as follows:

ITEM: ATOMS id fx fy fz
1 -19.743945 84.273056 -56.255995
2 19.694229 27.929149 -69.223726
3 -172.176662 -112.583713 49.826429
4 13.715168 35.442023 -37.351240
5 24.392595 -46.191220 65.166895
6 -0.621283 31.395572 122.500926
7 65.732349 -70.577554 -111.149473
8 114.595643 -38.482859 -13.887384
9 72.122803 62.862471 22.938288
10 -28.758420 -29.762789 -24.104811
11 -9.146244 98.226775 -70.037717

While the lammps 07032010 gives:

ITEM: ATOMS id fx fy fz
5 24.392595 -46.191220 65.166895
6 -0.621283 31.395572 122.500926
25 -62.246986 -85.738308 119.724927
33 -17.596068 6.080109 86.131794
34 -7.290228 -22.366935 99.744217
37 17.423052 -29.101572 -18.763372
38 -77.991549 20.236001 -58.297030
3 -172.176662 -112.583713 49.826429
4 13.715168 35.442023 -37.351240
35 36.887847 60.915642 7.216539
39 33.554137 18.559888 128.917251

So my question is how to make the forces output in order in the latest lammps.

Thanks!

Dongshan

Hi everyone,

I noticed the output order of the atom forces has changed for the latest
lammp version (07032010) comparing with lammps 25Oct2009 version. I used the

no the output order has not changed. they were never meant to be ordered.
they only are in order if you run in serial and at the beginning of a
trajectory.

[...]

So my question is how to make the forces output in order in the latest
lammps.

just sort them by the atom index after you read them.

cheers,
   axel.

The change is likely due to the (relatively) new atom_modify sort command
becoming the default. Atoms will be re-ordered within a processor
periodically during a run unless you turn this off with the atom_modify
command. But if you run in parallel, your dump files will be dis-ordered
anyway. So you can just sort as a post-processing step. See the tools/python
dir for a script that does this.

Steve