delete_atom / velocity loop

Dear all,

Deletion of atom(s) in data file (written in the full atom_style) using the delete_atom command gives an nonconsecutive data file (in which the atom IDs don’t start at 1) which then can not be used later in a new simulation due to the Atom IDs must be consecutive for velocity create loop all'' error. The compress yes’’ keyword does not help as the atom_style of the system is full.

Although changing the ``velocity loop to local or geom’’ in the new simulation can somehow waived the nonconsecutive issue, nevertheless I really need to have the a consecutive data file for some other tasks.
So, I was wondering how I can delete the whole or part of the atoms with for example type 16 in my data file and keep it consecutive. Here is commands I use for deleting atoms:

group dH type 16
delete_bonds all atom 16 remove
delete_atoms group dH compress yes

Also, what is the criteria for choosing the loop (all, local, geom) for velocity command? And would the change the loop affect on the results of a hypothetical quantity out of simulation?

Thank you.

Cheers,

Henrik

Why does “compress yes” not with with atom_style full?
Are you getting some error message from LAMMPS?

The velocity doc explains the settings for the optional
loop keyword, including the default setting. It should
not matter which method you use in terms of getting
statistically identical simulations. It’s more a matter
of convenience for the user.

Steve

Thanks.
No error actually. Just the “compress yes” does not have any effect on the system with atom_style full which belongs to the molecular system.
Cheers,
Henrik

Why does "compress yes" not with with atom_style full?

FYI, the compress option is ignored for all molecular systems. see
delete_atoms.cpp line 108ff

Are you getting some error message from LAMMPS?

LAMMPS does not even print a warning.

axel.

Dear Prof. Axel,

Would you please comment on my first question? I mean how to delete all or part of atoms with the same type from a data.lammps file (in full atom_style) and avoid nonconsecutive issue of course.

Thanks.

Regards,

Henrik

Dear Prof. Axel,

Would you please comment on my first question? I mean how to delete all or
part of atoms with the same type from a data.lammps file (in full
atom_style) and avoid nonconsecutive issue of course.

i already confirmed that you cannot. there is nothing to add or comment.

axel.

You would need to write a data file, do the compress action in i.e. python yourself.

Anders

Ah, you did not mention that you have a molecular system
(makes sense with atom_style full). The delete_atoms
doc page explains why compress does not operate
in that mode. All the bond, angle, etc topology would
have to change due to any deletions, since they store
atom IDs. It’s typically not what the user would
want or expect. It would also require some careful coding.

Possibly the code should print a warning that
it won’t do the compress.
Or have some other command like “renumber”
that re-sets the IDs to consecutive. I think often
the user does not really want that to happen.
E.g. changing what IDs mean in the middle of
a dump file (between snapshots).

Steve

Ah, you did not mention that you have a molecular system
(makes sense with atom_style full). The delete_atoms
doc page explains why compress does not operate
in that mode. All the bond, angle, etc topology would
have to change due to any deletions, since they store
atom IDs. It's typically not what the user would
want or expect. It would also require some careful coding.

Possibly the code should print a warning that
it won't do the compress.

​did that yesterday already as part of a pending pull request.

axel.

Today’s patch (20Mar) adds a new reset_ids command, that can do this operation.

You could use it after delete_atoms.

Steve