[lammps-users] adding group-ID to atoms within that group

hi patrick,

Hi all,

I have a question regarding the handling of atoms within a certain group.
Perhaps someone has an idea.

In my simulation I create several regions within the sample and asign the
atoms within a region to the corresponding group. But when I write the atom
coordinates, etc. to the dump-files (in my case CFGs) the information which
group an atom is in are no longer available. I therefore had the idea to

the problem here is that atoms can belong to multiple groups (up to 32),
so the per atom property that is stored internally is not the group id but
a bitmap to which groups an atom belongs.

assign a new atom type (but same mass and potential as the initial type) to
each group using the "set" command. However one has to specify all atom
types in the "create_box" command first. Since the structure is read from a
restart-file I can't add another "create_box" command, so this route will
not be possible most likely.

why don't you configure a _very_ large number of atom types,
much larger than you will initially need and use that as a pool?
you have to set the maximum number of atom types with a
create_box command and set the parameters (but you can just
set parameters for "* *" to define defaults), but you don't have
to use all of them right away. the same goes for data files.
this kind of thing is needed because there are some fixed size
arrays inside lammps that cannot be changed dynamically during
a run. the only drawback is that in some cases, the simulation may
run a little bit slower and consume a bit more memory, but with
atom types, this is usually not much of a concern.

a second, similar option would be to configure an atom style
that stores additional information (e.g. charge, torque, etc) normally
not needed for your simulation and abuse those data fields.

finally, if this is based on initial geometry, and does not result in
any changes to the force field parameters this information could
probably easily recovered from post processing, e.g. with VMD.