[lammps-users] Get atom coordinates as variable

Hello,

I want to control the simulation process regard to the position of the atoms.
I know I can use compute property / atom with dump.
I do not know how to assign these values to a variable.
I tried the following commands but got errors:

  1. compute zcord all property/atom id z
    variable zc equal c_zcord[1]
    print "${zc}"ERROR: Variable zc: Per-atom compute in equal-style variable formula (…/variable.cpp:1551)

2.variable zc atom min(z)
print “${zc}”
ERROR:Substitution for illegal variable zc (…/input.cpp:545)

Thanks in advance

why so complicated?

variable zc equal z[1]
print “${zc}”

works just as well.

axel.

Hi,

Dear Dr.Axel Kohlmeyer,Your suggestion was helpful and my problem was solved.

Thank you very much .