[lammps-users] variable command

Hello,

I am having problems with the “variable” command (lammps-7Sep09, serial). I am trying to group the atoms that are inside a complicated geometry (in the example I chose a cylinder of radius 2 to make it simpler) but I cannot use the command “variable x equal x[id]” to extract the coordinates of atom id. I am using the following loop and the error sign is under it (the error also appears without the loop):

###########LOOP#############
variable i loop $N
label loop

variable x1 equal x[$i]
variable y1 equal y[i] variable dd equal ({x1}**2+${y1}**2)

if ${dd} <= 2.0 then “group Cyl id $i”

next i
jump in.spt loop

ERROR: Indexed per-atom vector in variable formula without atom map

You can't index a per-atom quantity like x in a variable unless an atom
map is defined, so LAMMPS can find the atom. See the atom_modify map
command to do it. Atom maps are not created by default for atom_style atomic.

Steve