Rotation with periodic boundary conditions

Hi all,
In my simulation box, I have two consecutive layers and I need to rotate one of them while keeping the periodic boundary condition. For this work, at first I tried move rotate command but it didn’t work and gave much dangerous build; then I changed the size of my box and still I got the same errors. I don’t know the reason maybe it comes from the angle and bound interactions included in my model.
Next I think instead of the move command maybe its a good idea that I rotate the layer before simulation by another code or software keeping PBC and then complete my simulation in lammps, but I don’t know any method or software for this.

So I was wondering if any body can help me to solve the problem with either method or another one.

Thanks,
Meysam

Actually several owners of recent posts have had similar questions.
Please try with a reduced value of "period".

Ray

I tried it but still doesn’t work. what is an acceptable rate?

Meysam

What was the rate?

Before rotating the sample, try first with nve and see if the
structure is stable.

Ray

I meant rotation period rate per box size. I used 36000 as period and I rotate it for 3 degrees (3000 in time steps) while the box size was 208X184X36 in units real. And yes the structure is stable.

Meysam

I am not sure. Maybe you have to post the complete, yet the simplest,
script and the exact error message.

Cheers,
Ray

The code is:

pair_style lj/cut/coul/long 8.5
pair_modify mix geometric

bond_style harmonic
kspace_style ewald/n 0.00001

read_data m422_90_m_big.lammps05
region lower block INF INF INF INF 10 25 units box
group glower region lower
thermo_style multi
thermo 10
dump 1 all xyz 10 dum1.xyz
dump 2 all custom 10 mydump.npt id mol type x y z fx
timestep 1.0 # 1.0 fs

fix 1 glower move rotate 10.4 9.2 0.0 0.0 0.0 1.0 36000 units box
run 300
velocity all create 300 4928459 rot yes dist gaussian
unfix 1
fix 1 all nve/limit 0.1
run 1000
unfix 1

Meysam

What are the errors?

Steve

Depends on the size of the box and rotation period, it has these problems:

  1. ERROR on proc 12: Bond atoms 32336 10170 missing on proc 12 at step 122 (neigh_bond.cpp:48)
  2. gives many dangerous builds

Meysam

Well, as the manual says in Section_errros, those error messages mean
you have bad dynamics. Bonds are stretching so far
that a processor can't find it's bond partners. Dangerous
builds mean that you are not reneighboring often enough.

It is easy to rotate atoms so far, so fast that you cause bad
dynamics. Fix your model and the error messages will
likely go away.

Steve

But I used 30000 steps to rotate it,only 3 degree, its full rotation period is 3600000, and I was doing fix nve for other particles of my system simultaneously. The size of my system is orthogonal box = (0 0 0) to (208 184 35.8136). So do you suggest that I use more time steps for 3 degree rotation?

Meysam

So do you suggest that I use more time steps for 3 degree
rotation?

I don't know. What matters is how far atoms move, how fast.
How far are the atoms at the end of the rotation moving?
(furthest from the rotation axis). If you are rotating them
through a periodic boundary, that is also generally a bad
idea unless you are sure they will not cause problems
when they "appear" on the other side of the boundary.

You can fix dangerous reneighboings with settings to the
neigh_modify command, to check for the need to reneighbor
more frequently.

Steve

For the small system, I had lost atom and dangerous points problems and I thought if I use a big system the particles will apear on the other side of the box properly.
Yes, I have a periodic system, and I need it to be periodic, so maybe its a good idea I rotate statically the layer before my simulation by another software keeping pbc and then use that structure for lammps, so is there any software or algorithm for this work?

Meysam

is there any

software or algorithm for this work?

Not that I'm aware - maybe someone else will
suggest.

Steve

I am just wondering if this will work if you don't use fix nve, that
is, use fix move rotate as the only fix. Then under this
circumstance, the atoms are static as if it is before a run.

Ray

So I was wondering if somebody let me know the algorithm used in lammps for rotation with pbc?
Thanks,

Meysam

So I was wondering if somebody let me know the algorithm used in lammps for
rotation with pbc?

???

this is such an elementary operation. no special
algorithm is needed. a rotation around a point is
effectively a translation of that point to the origin,
a matrix multiplication and a translation back to
the original location.

if that is too confusing, you may want to swing
by your local library, pick up a book on classical
mechanics (e.g. goldstein) and look it up.
search for rigid body motions. if that is too "old-style"
check out books on 3d-computer graphics.
this stuff is *everywhere*.

BTW: if you don't want to program this for atomic/molecular
coordinates, you can generate the rotations with
scripting in VMD, for example.

axel.

Thank you for your answer, but it’s not only a simple rigid body rotation, here we have pbc with constant number of atoms and bonds and we should consider.

Meysam

Thank you for your answer, but it's not only a simple rigid body rotation,
here we have pbc with constant number of atoms and bonds and we should
consider.

this is nonsense.

you cannot rotate a periodic object unless
it is periodic only in 1 direction and you
rotate "around" that direction. everything
else can be handled as a rigid object or
not at all.

axel.

Meysam,

If I take a unit cell of a crystal and try to rotate it about some axis through some arbitrary angle, while keeping the unit cell boundaries stationary, it probably won't work. The repeat distance is different in different directions, so you are essentially trying to cram the structure into an Ill-fitting box. Only certain special angles about certain special axes are allowable. My guess is that you will need to do a larger simulation without PBC.

Barry