[lammps-users] Co ordinates for a Triclinic read_data file

Hi Steve, Axel and other subscribers,

I'm currently using lammps version 2-Feb-11 and pizza.py version 24-Nov-10. I use VMD to visualise xyz files. Sorry if this question has been asked before, I've tried searching the mailing list for help but am unable to find information.

I am having problems creating a triclinic data file (a file being read in via the read_data command). So I decided to begin with a simpler problem - hcp. I've chosen the following setup:

a = b = c = 5
alpha = beta = 90 deg
gamma = 60 deg

Using the information in the triclinic I calculated:

lx = lz = 5
ly = 4.33
xy = 2.5
xz = yz = 0

I then placed atoms in the data file with the following co ordinates:

1 1 0.000 0.000 0.000
2 1 1.000 0.000 0.000
3 1 2.000 0.000 0.000
4 1 3.000 0.000 0.000
5 1 4.000 0.000 0.000
6 1 5.000 0.000 0.000
7 1 0.000 1.000 0.000
8 1 0.000 2.000 0.000
9 1 0.000 3.000 0.000
10 1 0.000 4.000 0.000
11 1 0.000 5.000 0.000
12 1 0.000 0.000 1.000
13 1 0.000 0.000 2.000
14 1 0.000 0.000 3.000
15 1 0.000 0.000 4.000
16 1 0.000 0.000 5.000

I then use pizza.py to convert the dump file into an xyz file, and visualise it in VMD. Several problems occur:

I would expect the angle between the two lines in the xy plane to be 60 degrees (or 90 if the program worked with cartesian co ordinates in a non cartesian cell). However it is 130 degrees. I don't understand why it's an obtuse angle.. and not 60!

I would expect the distances between the atoms to be 1 (except the y axis due to tilt), especially along the x axis however their spacing is

1.5 along the x axis
1.32 along the y axis
1 along the z axis.

Apologies if I'm missing something basic and well documented but I am unable to find the solution online.

Thanks for your help.

Jon

It's possible that Pizza.py is not fully up-to-date with triclinic
boxes and files. I will note that in a LAMMPS data file
you need to put a line like

2.5 0 0 xy yz xz

at the top of your data file for it to be triclinic - see the read_data
doc page for details. That is what Pizza.py should pick up
on if needed.

Axel can probably comment on the VMD portion of your Q.

Steve

It's possible that Pizza.py is not fully up-to-date with triclinic
boxes and files. I will note that in a LAMMPS data file
you need to put a line like

2.5 0 0 xy yz xz

at the top of your data file for it to be triclinic - see the read_data
doc page for details. That is what Pizza.py should pick up
on if needed.

Axel can probably comment on the VMD portion of your Q.

i don't really see how there is a problem related to VMD in there,
however, i would like to remark that .xyz is about the worst possible
file format (ever) that you can use, particularly for non-orthogonal cells.
i would use a lammps dump instead.

please note, you need to use a VMD 1.9 beta version
for proper support for reading triclinic cell dumps.

cheers,
     axel.

Hi Axel and Steve,

Thanks to both of you for your help. I am able to correctly open the dump file using the beta version of VMD, and can see that regardless of simulation box settings, co ordinates specified in the read_data file will create atoms in reference to Cartesian co ordinates (as opposed to along the axes of the simulation cell).

However I am unable to produce sensible output using Pizza.py.

Thanks,

Jon

The xyz format doesn't do anything to the atom coords
it gets from dump. If you just read the dump file
and echo its contents into the xyz file, do the coords
match what was in the dump file? The dump command
in Pizza.py gives you control over whether you scale/unscale
or not, so you should be able to set it up to just echo
coords directly into the xyz file.

Steve

Hi,

I am still unable to correctly visualise the data when it's gone through the Pizza.py script, but it works in the VMD beta. I am still using my basic lines of atoms which run along the 3 cartesian axes but in a hcp cell and I have managed to get the following results (see bottom of email).

The closest results that I could see were from the python script that utilised the dump.scale() command, but because there were no tilt factors in the xyz file the visualisation was still incorrect. When i say closest results, I mean the atoms in the tmp files all have the same co ordinates as the atoms in the lammps dump file number for number, but because only the dump file has tilt factors, when in VMD only the dump file's atoms are placed correctly.

In my results below, after the co ordinates for each method of opening the data, I have included the measured angle between the lines of atoms on the xy plane.

Apologies that the results are long:

It doesn't look like the dump unscale command is applying
the triclinic factors (which isn't surprising since Pizza.py was
written before triclinic boxes in LAMMPS). I suggest for now,
you just dump out your atom coords from LAMMPS in unscaled
mode (see the dump_modify command).

Steve

Hi,

For some reason I haven't received your last email which can be seen on Sourceforge.

I've used the dump_modify command and I can obtain the correct co-ordinates.

Thank you very much for your help.

Jon