[lammps-users] variable name for create_atoms does not exist

Dear LAMMPS users,

I have written the following input script in the create_atoms command:

lattice sc 1.0
region myregion1 block 0 20 0 50 0 30
create_box 1 myregion1

region mycyl cylinder z 15 4 3 -30 30

variable x1 equal PI
variable y1 equal PI/2
variable v equal cos(x1)+sin(y1)+1
create_atoms 1 region mycyl var v set x 1 set y 2 set z 1

However I keep on getting the error " ERROR: Variable name for create_atoms does not exist (…/create_atoms.cpp:276) ". I can understand the meaning of the error
But the evaluation of v is 1 and it should have this value in var v. Am I doing something wrong in the syntax?.

The error message is due to “set x 1” in your create_atoms command, where “1” is expected to be an “internal” variable.
please see the example given in the documentation for the create_atoms command.


Thanks Axel. It works now. I should have read the documentation carefully.