atoms range

You could group the atoms based on the id and use the ID in the compute command.

Arun