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

Dear Vikas, dear Axel,

thank you very much for your fast and helpful replies. I’ve tried the trick with assigning an otherwise unused property to the atoms earlier, but LAMMPS doesn’t let you assign properties that are not suitable for the used atom style. In my case I’ve tried charge and also radius for style atomic, both didn’t work.

However, what did the trick was the suggestion with the transformation from restart to data file. I just had to add the masses for all the other atom types and set the total atom types to the amount I needed and it worked perfectly.

Axel’s suggestion to initially add more atom types in the create_box command would’ve been my next meassure, since it involves me running the previous simulations again (they are rather big).

So, let me thank you again for your help and have a nice weekend!

Best regards,

Patrick

----- Axel’s Reply -----

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.

cheers,

axel.

----- Vikas’ Reply -----

Dear Patrick,

Here is the trick that might work. Convert the restart file to data file. Increase no. of atom types from current to current+how many more you need. Duplicate pair coeff and Mass lines for the new atom types. Then, try your script. It should work without create_box command now in my opinion.

Best Regards,

Vikas

----- Original Post -----

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 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.

Is there another way to assign an integer value to atoms depending on the group they are in? I don’t necessarily need them to be of different atom type as long as I have a group specific identifier for each atom. It should look something like this:

atom-ID, type, xs, ys, zs, group-ID,…further properties

1 1 0 0 0.5 1…

2 1 0 0.5 0.5 1

3 1 0.5 0 0.5 1

4 1 0.5 0.5 0 2

5 1 0.5 0.5 0.5 2

Thanks in advance for your help.

Best regards,

Patrick