[lammps-users] something strange about tilt factor limitations

hi everybody,

while testing support for triclinic cells
in VMD, i ran across the problem, that
fix npt stops with an error message:

fix npt/nph has tilted box beyond 45 degrees

while the angles alpha, beta, gamma are still
around 60 degrees.

i suspect the test in fix_nh.cpp and the
documentation will need to be adjusted,
or am i making a mistake somewhere?

test input is attached.

thanks,
   axel.

p.s.: if anybody is using dcd output for
triclinic cells, note that it not storing
the box lengths correctly, so any software
using the cell information will be creating
a wrong periodic display. bugfix is in
lammps-icms and will hopefully make it to
the regular lammps when steve has time.
(xtc is even more broken).

http://git.icms.temple.edu/git/?p=lammps-icms.git;a=blobdiff;f=src/dump_dcd.cpp;h=da2fddbb07eee4cb79a578db97d47984cd533490;hp=0f88c21b7ced2d98acf5aca4b476b7fd97b989eb;hb=223a5605ae1552beb8dc8a36ba46bf6791681a5a;hpb=11f7e0b6e07b2493882ae971493a29abe69b11af

a-si-test.tar.gz (10.4 KB)

fix npt/nph has tilted box beyond 45 degrees

This error message is inaccurate. What it should say
is that the box has tilted too far. It's 45 degrees
if the box is cubic, but could be less for an xy tilt
if ybox > xbox.

The real issue is that beyond this limit you could
flip the box tilt and get a less tilted box. This is
what is done for fix deform. We could also do it for
fix npt, but we didn't want to allow/encourage people
to do this in a non-sensical way, e.g. apply a target
shear pressure to a fluid which wouldn't sustain
it, and thus the box would tilt indefinitely and never
come to equilibrium. Are you running a real
problem that wants this much tilt, or just an artificial
stress test?

Steve

fix npt/nph has tilted box beyond 45 degrees

This error message is inaccurate. What it should say
is that the box has tilted too far. It's 45 degrees
if the box is cubic, but could be less for an xy tilt
if ybox > xbox.

The real issue is that beyond this limit you could
flip the box tilt and get a less tilted box. This is
what is done for fix deform. We could also do it for
fix npt, but we didn't want to allow/encourage people
to do this in a non-sensical way, e.g. apply a target
shear pressure to a fluid which wouldn't sustain
it, and thus the box would tilt indefinitely and never
come to equilibrium. Are you running a real
problem that wants this much tilt, or just an artificial
stress test?

the system is a simple replicated primitive
bulk silicon cell with diamond structure.
this is a very common test input for DFT
calculations.

i didn't expect it to be a special stress test,
only the easiest system that i could think of
that has a non-orthogonal box. only that it
happens to be right on the boundary of what
LAMMPS accepts. it worked fine with the isotropic
(no surprise) and anisotropic settings for fix
ntp, but choked with the tri setting.

perhaps the documentation needs to clarify
that the triclinic cell shape is meant for deforming
a conventional cell and not for simulations starting
from any primitive cell. i could imagine that
people that have crystallographic input data might
be tempted to use lammps this way and be
as surprised as me, that it doesn't work as
expected?

cheers,
    axel.

I think Axel raises a good point. I was the one who told Steve not to allow box flips in NPT. However, I now see that there are some commonly occurring unit cells that happen to sit right on the edge of the LAMMPS flip criterion. At finite T, they should be allowed to flip between the different equivalent cells. The simplest example is the hexagonal unit cell in 2D, where xy/lx is exactly +/- 1/2.

I would suggest the following changes to eliminate unnecessary error messages:

-Allow the box to flip in triclinic NPT
-On input, flip the box to satisfy LAMMPS requirements

Aidan

I'll put this on the to-do list. I was wrong about the 45 degree comment
for a cubic box. The criteria is actually xy/lx is +/- 1/2. as Aidan
said, which corresponds to a minimum angle of about 63 degrees
(for the x-axis relative to the tilted y axis), before the error is thrown.
But keeping the angle between 63 and 117 is enough to cover all
possible configurations of the system, so that is what LAMMPS can do.

Steve