access unwrapped coordinates

Dear users,

I am trying to access unwrapped coordinates xu[atom-id]

While I can define without probles variables such as

variable h equal x[${b}] ,

as I try to substitute “x” with “xu”, i.e.

variable h equal xu[${b}]

i get this error

ERROR on proc 0: Invalid atom vector in variable formula (…/variable.cpp:3587)

does the access to xu-coordinates need something more to be accessed?

Best regards and many thanks for any hint.

Mario

Dear users,

I am trying to access unwrapped coordinates xu[atom-id]

While I can define without probles variables such as

variable h equal x[${b}] ,

as I try to substitute "x" with "xu", i.e.

variable h equal xu[${b}]

i get this error

ERROR on proc 0: Invalid atom vector in variable formula
(../variable.cpp:3587)

does the access to xu-coordinates need something more to be accessed?

there (currently) is no such xu property for variable expressions.

Thank you, Axel.

Kind regards

Mario

But every atom property that LAMMPS stores can be

accessed via compute property/atom, and a compute can
be accessed in a variable. That’s why we don’t make
a long list of per-atom properties directly reference-able
in per-atom variables.

Steve

Dear Steve,

Thanks for the answer.

So, do you mean something like

Compute 4 property/atom xu
variable a equal c_4[700] (print xu coordinate of atom #700)
print “$a”

Should it work? I apologize if the form I written is not correct, but I’m writing from my phone now. I tried this way too but it didn’t work. Excuse me if the question is too elementary.

Thanks for advice

Best regards

Mario

Your compute command is not correct syntax. You also
cannot execute this before a run, like for variable with many other computes.

See the variable doc page for details.

Steve