Using fix move wiggle style with varying amplitude (A)

Hi everybody,

I wanted to use the fix move command (wiggle or variable style) for a group of atoms in my box, but I need the the amplitude A not be a constant, rather be a function of z coordinate of the atoms in the group. Is there a way to do this by using existing loop commands and either the wiggle style or the variable style? I thought of creating a loop that goes through all the atoms in the group, defines the atom in each step of the loop as the target group, calculates A based on the z coordinate and use the variable style for that group (atom) ; however, if the run command is inside the loop, he timestep is not what it is supposed to be after the first run, which ruins the sin(omega*t) function calculation inside the move command. If the run command is outside the loop the fix will only operate for the last step of the loop before the run command is executed which is not what I wantâ€¦

Any thoughts or comments are appreciated,

Thanks,
Mehdi

Hi everybody,
I wanted to use the fix move command (wiggle or variable style) for a group
of atoms in my box, but I need the the amplitude A not be a constant, rather
be a function of z coordinate of the atoms in the group. Is there a way to
do this by using existing loop commands and either the wiggle style or the
variable style? I thought of creating a loop that goes through all the atoms
in the group, defines the atom in each step of the loop as the target group,

this makes no sense. the loop command in LAMMPS does not work like this.

calculates A based on the z coordinate and use the variable style for that
group (atom) ; however, if the run command is inside the loop, he timestep
is not what it is supposed to be after the first run, which ruins the
sin(omega*t) function calculation inside the move command. If the run
command is outside the loop the fix will only operate for the last step of
the loop before the run command is executed which is not what I want...

your concept of what to use loops for is wrong.

Any thoughts or comments are appreciated,

just use an atom style variable. that gives you access to the z
coordinate of the affected atom and you can use that in a formula to
compute your "wiggle" functions. plain and simple. no loops needed.

axel.