# PBC problem with oriented lattice

Hi all,

When I minimize FCC lattice it takes 1 or 2 steps as expected, for there is nothing to minimize (perfect lattice, 1 type of metal atoms).

So far so good.

But when I set the lattice to be oriented then things get abnormal - LAMMPS execute about 1000 steps of minimization and the animation confirms a lot of movement.

The only difference between the two is this line:

lattice fcc \${latparam} orient x 1 1 0 orient y -1 1 1 orient z 1 -1 2

Also, the 0 frame confirms from all angles that the new orientation is fine. Data shows that new lattice spacings are fine as well.
The model is 3d periodic.

Would love to understand what’s wrong.

P.S: Centrosymmetry data/visuals shows on the 0th frame a lots of atoms not in place with quaint patterns (at the facets only), and when coloring this frame with potential energy data there are ordered patterns, again on the facets only.

Hi all,

When I minimize FCC lattice it takes 1 or 2 steps as expected, for there is
nothing to minimize (perfect lattice, 1 type of metal atoms).

So far so good.

But when I set the lattice to be oriented then things get abnormal - LAMMPS
execute about 1000 steps of minimization and the animation confirms a lot of
movement.

The only difference between the two is this line:

lattice fcc \${latparam} orient x 1 1 0 orient y -1 1 1 orient z 1 -1 2

Also, the 0 frame confirms from all angles that the new orientation is fine.
Data shows that new lattice spacings are fine as well.
The model is 3d periodic.

Would love to understand what's wrong.

your system may not be properly periodic in z-direction.
at least that is what i see, if i add the orient commands
to the melt example, output the initial coordinates and
visualize it.

axel.

Hi Axel,

How is that possible? I’m afraid I don’t understand. Boundary command is set to “p p p”, and the vectors I wrote in the lattice command are orthogonal and obey to right hand rule. Under these conditions, I can’t see why would LAMMPS treat the box as non periodic in any direction?

thanks,
Eyal.

I agree with Axel. best solution is to visualize the simulation. I
would think that it is very easy to mess up the periodic boundary
conditions when you rotate a lattice.

If you are able to view your system in VMD, then in VMD you can use
the Graphics->Representations menu and click on the "Periodic" tab.

In VMD, you can also select the Extensions->TkConsole menu and type in
"pbc box".

Alright, fixed it.

There were two problems:

1. I didn’t set the box dimensions exactly as a multiple of the spacings in each direction. That caused a placement of atoms too near to end facets.

2. I used style region instead of box in the create atoms command.

Thank you anyway!

Alright, fixed it.

There were two problems:

1. I didn't set the box dimensions exactly as a multiple of the spacings in
each direction. That caused a placement of atoms too near to end facets.

which has nothing to do with the problems that i quoted
in the melt example, since that uses not absolute dimensions
but lattice vectors to define the box. the problem is that the
periodicity of the superstructure resulting from the tilting of the
lattice has to be a divisor of the box dimension.

that is for using your lattice orientation on the melt example,
the facet in z-direction requires a periodicity of 3a,
i.e. switching the box definition to

region box block 0 9 0 9 0 9

results in a proper periodic continuation. for the other facets
only

2. I used style region instead of box in the create atoms command.

this makes no sense. the result should be the same.
if it is *not* the same, you have placed your box/region
boundaries exactly on lattice points, which makes
atom placement subject to rounding errors. for style
box, this is avoided; for style region it is not. in any case,
it is *highly* recommended to slightly shift to box/region
boundaries, to avoid any ambiguity at all. for instance,
in the melt example, you can define the region box without
a problem as:

region box block 0.1 10.1 0.1 10.1 0.1 10.1