Regarding Atom Style Variable Definition in twisting...

Dear Steve,

Is it possible to apply rotation or twist to a group of atoms using “move rotate or displace_atoms” commands, with Atom Style Variable , for example:

variable twst atom “sin(PI*x)”

fix 1 right move rotate 0.0 0.0 0.0 0.0 0.0 1.0 ${twst}

OR

displace_atoms right rotate 0.0 0.0 0.0 0.0 0.0 1.0 ${twst}

Thanks and regards
Ishaq

Dear Steve,

Is it possible to apply rotation or twist to a group of atoms using "move
rotate or displace_atoms" commands, with Atom Style Variable , for example:

yes, it is possible, but your examples are incorrect and inconsistent
with what is explained in the manual on multiple levels.

axel.

Thank you Axel,

Can you please tell me were am I doing wrong, I am using LAMMPS 7Dec15 version. Your suggestions/comments will be of great help to resolve this issue.

The following are the few lines of my script:

Thank you Axel,

Can you please tell me were am I doing wrong, I am using LAMMPS 7Dec15
version. Your suggestions/comments will be of great help to resolve this
issue.

*everything* is wrong.

- the rotate option doesn't require you to use a variable
- when using atom style variables you need to use the variable option
to fix move
- you are using ${} expansion of variables, which is done at the
parser level, however, for what you want, you have to be able to pass
a variable by name as an argument.

all of that shows, that you have not spend enough time studying the
documentation or do not understand what you are doing.

The following are the few lines of my script:

-----------------------------------------------------
group left region left
group mobile subtract all left

fix 1 left setforce 0.0 0.0 0.0
velocity left set 0 0 0 units box

variable twst atom "sin(PI*x)"
fix 2 mobile move rotate 0.0 0.0 0.0 0.0 0.0 1.0 ${twst} units box

run 10000
------------------------------------------------------

When I run the script, I get the following error:

ERROR on proc 0: Substitution for illegal variable (../input.cpp:531)

...and deservedly so. you are trying to expand an atom-style variable
as a global variable, which is illegal and makes no sense at all.

again, this is all explained in the documentation. but you have to
study it properly and probably should practice with doing simpler
manipulations first.

axel.