[lammps-users] group with "<=" command

Hello LAMMPS developer and users,

I have a quick question about "group" command with "<=".
My input file has

group up id <= 2731

However, this group "up" includes every atom (which is in my case 2940
atoms) though the rest of atom IDs is definitely larger than 2731...
I supposed this should make the group which has atoms from #1 to #2731
but actually not....
Does anybody have same problem before?

Thank you very much.
Any help would be greatly appreciated.



If I add your command
group up id <= 2731
to bench/in.lj, the code prints out
2731 atoms in group up
which is the expected behavior.

So I'm not seeing your problem. How do you know
an atom with ID 2940 is in the group you get?


Hello Steve,

Thank you so much for your reply.

My code prints out
group up id <= 2731
2940 atoms in group up.....

Does the restart file affect to group command?
I am wondering because I reset the groups in new input file when it is

Thank you very much.


If you are worried about the restart file messing up the groups, a quick test would be to delete the group before you assign it.

Quoting Nanako TAKAHASHI <[email protected]>:

Restart files store group names and atom assignments.
So if you use group commands after reading a restart file,
you are adding atoms to existing groups.