[lammps-users] IDs of particles of a given group

Since you'll be doing this in your own fix (there
is no way to do that in an input script), just
allocate a small vector, do the loop below
and put the indices of the atoms in the
group into the vector. When you do your
real loop that does actual work, just loop
over the short vector. There is little overhead
to loop over all the atoms on a proc. Almost
all the fixes do it.