Report bug on triclinic boxes

Hello everybody,

I have noticed that the cell vectors of a triclinic unit cell are not read correctly by LAMMPS. I am not sure whether this is a bug or something wrong with my approach. The problem originates when the tilt factors are read from a data file. Here a minimal example, reproducing the error with lammps 16 Mar 2018.

# Input file, adapted from ./examples/melt/in.melt
units lj
boundary p p p
atom_style atomic
read_data ""
lattice fcc 0.9
region box block 0 1 0 1 0 1
create_atoms 1 box
mass 1 1.0
velocity all create 3.0 87287
pair_style lj/cut 2.5
pair_coeff 1 1 1.0 1.0 2.5
neighbor 0.3 bin
neigh_modify every 20 delay 0 check no
fix 1 all nve
dump id all atom 50 sample.dump
thermo 50
run 250

# Data file
LAMMPS data file
0 atoms
1 atom types

0 18 xlo xhi
0 18 ylo yhi
0 17 zlo zhi
0.5 0.8 1.5 xy xz yz

The simulation box specified in the data file has a volume of 5507.997, while the one written in the dump at timestep=0 has a volume of 6397.953. More specifically, the tilt factors in the dump file are identical to those specified in the data file, while the XYZ dimensions are significantly different. Speaking in crystallographic units, the input cell (a,b,c,alpha,beta,gamma) is:
18.00000 18.00694 17.08498 84.885 87.313 88.409
While the cell which LAMMPS actually uses is
19.30000 19.50641 17.08498 84.890 87.313 88.531

I wonder if this is a bug of the code, and if it affects MD simulations with a triclinic barostat.
Thank you very much for the help.


Otello M Roscioni

Università di Bologna
Dipartimento di Chimica Inorganica "Toso Montanari"

PS to convert between Cartesian and crystallographic units, I have used the formulae reported in the wikipedia page:


For triclinic systems the first two columns of “ITEM: BOX BOUNDS” in the dump describe a bounding box around the system, not the system itself. See for more information.


Sorry for the second e-mail, but I’ve posted a wrong link. Here is the correct one:


My bad.

Thank you very much for pointing to the relevant part of the manual.