how to rotate the same fix mesh with different origin

Submitted by mar_co on Tue, 01/21/2020 - 13:17

Hi all,
I am new with liggghts
I am try to rotate the same fix mesh with different origin and different running step
When I run a simulation which includes a mesh rotation about 2 different axis I get a different rotations in the first running, it is running fine.
But at the second running, i get the error as follows : " ERROR: Illegal deletion of a fix move/mesh. There is another fix move/mesh command active on the same mesh. Superposed fix move/mesh commands must be unfixed in reverse order of creation (fix_move_mesh.cpp:137) "

My goal is to make a rotation like planetary gear with differents axis and the angular velocity has to be change in each run

I implemented what I want to do as follows:

variable w1 equal -10.0
variable w2 equal -20.0

variable w3 equal -30.0
variable w4 equal -40.0

run 1000 upto
fix movecad1 all move/mesh mesh cad1 rotate origin 0.0 0.0 0.0 axis 0.0 0.0 1.0 period -2.0
fix movecad2 all move/mesh mesh cad2 rotate origin 0.0 0.0 0.0 axis 0.0 0.0 1.0 period -2.0

fix movecad3 all move/mesh mesh cad1 rotate/variable origin -0.35 0.0 0.0 axis 0.0 0.0 1.0 omega v_w1
fix movecad4 all move/mesh mesh cad2 rotate/variable origin 0.45 0.0 0.0 axis 0.0 0.0 1.0 omega v_w2

unfix movecad1
unfix movecad2
unfix movecad3
unfix movecad4

fix movecad5 all move/mesh mesh cad1 rotate origin 0.0 0.0 0.0 axis 0.0 0.0 1.0 period -2.0
fix movecad6 all move/mesh mesh cad2 rotate origin 0.0 0.0 0.0 axis 0.0 0.0 1.0 period -2.0

fix movecad7 all move/mesh mesh cad1 rotate/variable origin -0.35 0.0 0.0 axis 0.0 0.0 1.0 omega v_w3
fix movecad8 all move/mesh mesh cad2 rotate/variable origin 0.45 0.0 0.0 axis 0.0 0.0 1.0 omega v_w4

run 2000 upto

<<< I get follows error at 1000 step:
ERROR: Illegal deletion of a fix move/mesh. There is another fix move/mesh command active on the same mesh. Superposed fix move/mesh commands must be unfixed in reverse order of creation (fix_move_mesh.cpp:137)
-------------------------------------------------------
Primary job terminated normally, but 1 process returned
a non-zero exit code.. Per user-direction, the job has been aborted.
-------------------------------------------------------
--------------------------------------------------------------------------
mpirun detected that one or more processes exited with non-zero status, thus causing
the job to be terminated. The first process to do so was:

Thanks you in advance.

mschramm | Tue, 01/21/2020 - 21:07

Hello,
The error actually tells you how to resolve this error.
When you apply the following fix moves
fix movecad1 all move/mesh mesh cad1 rotate origin 0.0 0.0 0.0 axis 0.0 0.0 1.0 period -2.0
fix movecad2 all move/mesh mesh cad2 rotate origin 0.0 0.0 0.0 axis 0.0 0.0 1.0 period -2.0

fix movecad3 all move/mesh mesh cad1 rotate/variable origin -0.35 0.0 0.0 axis 0.0 0.0 1.0 omega v_w1
fix movecad4 all move/mesh mesh cad2 rotate/variable origin 0.45 0.0 0.0 axis 0.0 0.0 1.0 omega v_w2

if you wish to unfix movecad1, you must unfix the others first as you must unfix in reverse order. So to unfix all of them you would
unfix movecad4
unfix movecad3
unfix movecad2
unfix movecad1

Now you can apply new fixes
fix movecad5 all move/mesh mesh cad1 rotate origin 0.0 0.0 0.0 axis 0.0 0.0 1.0 period -2.0
fix movecad6 all move/mesh mesh cad2 rotate origin 0.0 0.0 0.0 axis 0.0 0.0 1.0 period -2.0

fix movecad7 all move/mesh mesh cad1 rotate/variable origin -0.35 0.0 0.0 axis 0.0 0.0 1.0 omega v_w3
fix movecad8 all move/mesh mesh cad2 rotate/variable origin 0.45 0.0 0.0 axis 0.0 0.0 1.0 omega v_w4