[lammps-users] atom ID changing

Hi all-

I'm not sure if there was a change in how lammps assigns atoms IDs recently, but the new version is giving me trouble. Here's an example of my input script:

units metal
boundary p p p
atom_style atomic
lattice bcc 2.8553 #B
region mybox block 0 15 0 15 0 15
create_box 2 mybox
create_atoms 1 box
pair_style eam/alloy
pair_coeff * * FeH_bulkB.eam.alloy Fe H
fix 1 all nve
group vacancy id 3376 3374 3825 3855 3826 3824 4275 4305 3853 3823 3854 4303 4273 3794 3822 4274 3404 3856 3406 3885 3857
dump vacancies vacancy custom 1 dump.V x y z type id
run 0
undump vacancies
delete_atoms group vacancy
thermo 5
thermo_modify format 5 %14.6f
minimize 0.0 1e-06 100 1000
dump newnames all custom 1 dump.newnames id type x y z

As you can see, I have deleted, for example, atom number 3376, 3374,... all the ones in group vacancy. Somehow, between there and my final dump command, those ID numbers are getting reassigned to different atoms, so that there are no gaps in the ID numbers. This is different from lammps's old behavior, when ID numbers stayed constant for the entire simulation. I was using those IDs numbers for postprocessing, and downloading the newer version of lammps has really screwed things up. I'm using only one processor, so there shouldn't be any ambiguity in how the IDs are assigned. Is there anything I can do to prevent lammps from reassigning IDs? Thanks,

Erin

Note from the documentation (http://lammps.sandia.gov/doc/delete_atoms.html):

"After atoms are deleted, if the system is not molecular (no bonds), then atom IDs are re-assigned so that they run from 1 to the number of atoms in the system. This is not done for molecular systems, since it would foul up the bond connectivity that has already been assigned."

So one way around this would be to use atom_style molecule. Or you could go back to using an older version of LAMMPS. Some old tarballs are here: http://lammps.sandia.gov/tars/ Or hack the code to make it do what you want.

Paul

See the 4Aug10 patch. I added a compress yes/no option
to the delete_atoms command, so you can turn off the
renumbering if you like.

Steve

1 Like