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

Dear all,

in my script, I need to displace all atoms of a group, one after the other.
I need to repeat this operation many times, for different groups.
Right now, in order to determine the IDs of the particles of group A,
I use a procedure involving a loop over all particles.
The loop over all particles makes this procedure too expensive.

I am therefore looking for a quick way to identify the IDs of all particles of a given group,
for instance placing them in a vector. Any idea?

Thanks,
Massimo

Dear all,

in my script, I need to displace all atoms of a group, one after the other.
I need to repeat this operation many times, for different groups.
Right now, in order to determine the IDs of the particles of group A,
I use a procedure involving a loop over all particles.
The loop over all particles makes this procedure too expensive.

I am therefore looking for a quick way to identify the IDs of all particles
of a given group,
for instance placing them in a vector. Any idea?

wouldn't it be better to write a fix for this pupose?
particularly, if you are concerned about performance...

cheers,
     axel.

The only way to extract the IDs of atoms in a group and
store them is to write code to do it, e.g. in a fix or compute.

What is it you are trying to do, at a higher level? Apply
the same displacement to each atom in a group. Or a displacement
that is a function of something like position?

Steve