How to specify each groups in dump file for visulization?

Dear All,

I created my model using different groups of atoms. For visualization with Ovito, I want to distinguish between these groups by different colors. My question is that how should I specify each group of atoms in the dump file which will enable me to show each group with a different color?

I don’t think that this is possible, but I may be wrong.

Instead, you can print one dump file per group of atom. You could also assign a different type of atom for the atom of group…

Thanks for your comment. Since I have 6 different groups of Aluminium, I can initially define 6 types of Al atoms. In this case I have to define 12 paire-coeff of LJ for interactions of these 6 types with other C and H atoms.

You have to identify group assignments by using a per-atom property. The most obvious one is the molecule ID. If that is used for other purposes, you can also add custom per-atom properties with fix property/atom and refer to them in a custom style dump.

With a recent version of LAMMPS you can even use the “dump_modify colname” command to rename their label in the dump file to match known labels in Ovito. BTW, a similar functionality exists for thermo output. For details, please see the dump_modify documentation in the LAMMPS manual.

Another way to get a per group value into the dump that can help identifying atom’s group membership would be with an atom style variable (assuming group names are “one”, “two”, “three”):

variable groupid atom "gmask(one)+2.0*gmask(two)+4.0*gmask(three)"

This will generate a group ID value of 1 for atoms that are only in group one, 2 for atoms that are only in group two, 4 for atoms only in group three, 3 for atoms that are in group one and two, and so on.

The groupid variable can then be output in a custom style dump.

Thank you for your answer.