# [lammps-users] Lattice, Orient and Spacing

Hi Everybody,

A question to the lattice command.
If I want to setup a lattice with (112) in y-direction and lateral periodic bc, then I could to it like this:

lattice fcc 1.234 orient x -1 -1 1 orient y 1 1 2 orient z -1 1 0

But: this will lead to strange effects at the lateral boundaries. Then I found out, that the unit cell spacing should be set by

lattice … spacing ||-1 -1 1|| ||1 1 2|| ||-1 1 0||

Only this will lead to the (natural) periodic unit cell.

Now I have two questions:
(1) Do I understand it right, that I have to specify the lattice spacing besides the orientations?
(2) If I am right: Why isn’t the lattice spacing automatically calculated as the norm of the orient vectors? Wouldn’t this be more natural, than xmax-xmin of the simple rotated unit cell?

/BR:
Gerolf

This has been discussed on the mail list before. The spacings
are just a scale factor that LAMMPS sets that does not
affect the lattice itself. Rather it is used by other commands
when you do something in "lattice units", e.g. set the size of
the simulation box or a region extent.

Since LAMMPS tells you what the lattice spacing it chose is,
in principal it shouldn't matter - you can adjust your input
script accordingly.

In practice, I agree it would be nice if making periodic systems
were simple. Maybe your rule of ||-1 1 1|| would be more convenient
in some cases. But I don't think it works for arbitrary lattices, e.g. ones
where the user defines a1,a2,a3 ?? Does your rule always work
if a1 = 1 0 0, a2 = 0 1 0, a3 = 0 0 1 (the default)? Does it
give lattice spacings that are the minimum for periodicity?

Steve