# Fix Move Rotation with sinusoidal law?

Hi there,

I am trying to impose a sinusoidal rotation to a region of my 2D simulations.
The idea is to do something related to oscillatory rheology.
I can create a probe, for example a square filled with particles with no force.
After that, I would like to rotate the the square of an angle following the evolution equation:

theta(t) = theta(0) * sin (w * t)

so that I will have an oscillatory deformation with amplitude that follow a sin law.

I have tried to explore

• fix move

but those not seem to do what I want, since the rotation is continuos

• displace_atoms

in principle i can make a loop to rotate the particle of a delta theta every # steps.
However, it does not appear to be a clean solutiom

Ideally I would need a fix semilar to move but with time evolution as in the equation above.

I probably can extend the fix move to do that, but I wanted to ask if you see a different way to do this (I am not a super-pro user).

Hi there,

I am trying to impose a sinusoidal rotation to a region of my 2D simulations.
The idea is to do something related to oscillatory rheology.
I can create a probe, for example a square filled with particles with no force.
After that, I would like to rotate the the square of an angle following the evolution equation:

theta(t) = theta(0) * sin (w * t)

so that I will have an oscillatory deformation with amplitude that follow a sin law.

I have tried to explore

• fix move

but those not seem to do what I want, since the rotation is continuos

• displace_atoms

in principle i can make a loop to rotate the particle of a delta theta every # steps.
However, it does not appear to be a clean solutiom

Ideally I would need a fix semilar to move but with time evolution as in the equation above.

I probably can extend the fix move to do that, but I wanted to ask if you see a different way to do this (I am not a super-pro user).

Please review the fix move documentation again. I am certain that your motion can described with atom style variables.

Axel

Dear Axel,

thanks a lot for the feedback. According to de docs, if I am correct, in fix move there are 4 styles:

• Linear: This will make a plane uniform translation in an arbitrary direction

• Wiggle: sinusoidal translation in arbitrary direction

• Rotation: Uniform rotation. Fixed angular velocity (i.e. peridod)

• Variable: If understand this well, one can write an arbitrary variable to change position/velocity of particles with time.

So the Linear and Wiggle no use. Variable it seems that you apply the variable to all position of the region in the same way so I do not see how you can apply a rotation matrix to each particle, but perhaps you can do a per-particle operation.

Rotation, perhaps you can make the period time-dependent? but then I have to see if you can implement a sinusoidal time dependence of angular amplitude.

Am I missing something?
Best

Dear Axel,

thanks a lot for the feedback. According to de docs, if I am correct, in fix move there are 4 styles:

• Linear: This will make a plane uniform translation in an arbitrary direction

• Wiggle: sinusoidal translation in arbitrary direction

• Rotation: Uniform rotation. Fixed angular velocity (i.e. peridod)

• Variable: If understand this well, one can write an arbitrary variable to change position/velocity of particles with time.

So the Linear and Wiggle no use. Variable it seems that you apply the variable to all position of the region in the same way so I do not see how you can apply a rotation matrix to each particle, but perhaps you can do a per-particle operation.

Yes, you can. You have to use atom style variables for the dimensions you want to modify. These are evaluated per atom an have access to per-atom properties.

Try this with a simpler operation and you’ll see.

Axel

Hi Axel,

indeed this si probably doable in the way you suggested. I am not fully familiar with atom style variable, but it seems like a nice workaround, but maybe a bit cumbersome.

In any case, I took an alternative route.

I add a style “orotate” (oscillatory rotate) to the fix move. It was pretty straightforward to generalize it starting from “rotate”.
It seems to work, fine.

I will test it on my simulations. I do not know if this can be interesting for anyone, but in case I can make the patch (it is really no-rocket-science!) available.

Thanks again!

Hi Axel,

indeed this si probably doable in the way you suggested. I am not fully familiar with atom style variable, but it seems like a nice workaround, but maybe a bit cumbersome.

Yes, it is meant for people that do not want to write C++ code or for trying things out.

In any case, I took an alternative route.

I add a style “orotate” (oscillatory rotate) to the fix move. It was pretty straightforward to generalize it starting from “rotate”.
It seems to work, fine.

I will test it on my simulations. I do not know if this can be interesting for anyone, but in case I can make the patch (it is really no-rocket-science!) available.

You can submit patches or (even better) pull requests on the lammps github or bitbucket pages.

Axel

Thanks Axel,

I will test my implementation and once I think that it is ok, I will send patch (or the other method you suggested)
Thanks again all the best