[lammps-users] The variable is uable in some commands

Dear lammps-users,

I want to make some particles move along a direction and rotate around
a axis. My input code is shown below.

#rot

units metal
boundary p s p

atom_style atomic
lattice diamond 3.5667
region box block 0 10 0 20 0 10
create_box 1 box
mass * 12

pair_style tersoff
pair_coeff * * c.tersoff C

neighbor 0.3 bin
neigh_modify delay 5 check yes

region rot sphere 5 15 5 3
create_atoms 1 region rot
group rot region rot

fix 1 all nve
fix 2 rot rigid single
variable y equal "15-step*0.1"
fix 3 rot recenter 5 v_y 5
fix 4 rot move rotate 5 v_y 5 0 0 1 1

compute 1 rot com
thermo 1
thermo_style custom step v_y c_1[1] c_1[2] c_1[3]
timestep 0.001
dump 1 all atom 1 rot.lammpstrj
run 100

Unfortunately, the variable is not useful in some commands like fix
recenter and fix rotate, even displace_atoms etc.

Can you give me a good suggestion for this task. Thank you.

Best regards,
Zenger

Unfortunately, the variable is not useful in some commands like fix
recenter and fix rotate, even displace_atoms etc.
Can you give me a good suggestion for this task. Thank you.

Any command that you want to use a variable as input, like v_foo,
and want the value of the variable to be re-evaluated every time
the fix is invoked, then the fix has to support that option. Some
do, some don't - the doc pages make it clear.

The logic to evaluate the variable and do
the right thing has to be coded into the fix. So if your want a
fix to do that for a particular input, you'll need to edit the source
code and add
that capability. We've done it for some, but not for every possible
option.

Steve