trying to understand positioning of atoms in a tilted triclinic box in scaled vs. absolute coordinates

I have dump files of atom positions in a dump file printed out in x,y,z, and xs,ys,zs coordinates. From the detailed triclinic box write up, and region command, i understand certain conventions: Lx=xhi-xlo, Ly=yhi-ylo, Lz=zhi-zlo. These are the actual lengths along the tilted parralleliped that forms the triclinic box; the triclinic edge vector lengths. Bounding this triclinic box are xlo_bound, xhi_bound, ylo_bound,yhi_bound,zlo_bound,zhi_bound.In my simulations, along with xy,xz,yz in the dump files. The triclinic box is created with xy,xz,yz all = 0, so as the sample distorts, the xy,xz,yz, change. What are the xs,ys,zs in the atom positions scaled to? are the positions relative to the orthogonal box created by the bound coordinates (xlo_bound to xhi_bound, ylo_bound to yhi_bound, zlo_bound to zhi_bound writtne out by the dump file define 0. to 1., are they scaled between the triclinic edge vectors (e.g. xlo to xhi, ylo to yhi , zlo to zhi as edge vector locations, or something else? I am trying to place a volume of dummy atoms in the triclinic box defined by a given dump such that the wrapped triclinic box is filled, but with correct positions for post-processing identification of voids in the sample (I will look for voids by comparing actual atomic volumes and locations to the dummy atom locations, and remove all dummy atoms where actual atoms are located. Then what is left is where voids are located. I am using periodic boundary conditions and wrapped coordinates in my dump file outputs.

Sincerely

Richard Gustafson

I have dump files of atom positions in a dump file printed out in x,y,z,
and xs,ys,zs coordinates. From the detailed triclinic box write up, and
region command, i understand certain conventions: Lx=xhi-xlo,
Ly=yhi-ylo, Lz=zhi-zlo. These are the actual lengths along the tilted
parralleliped that forms the triclinic box; the triclinic edge vector
lengths. Bounding this triclinic box are xlo_bound, xhi_bound,
ylo_bound,yhi_bound,zlo_bound,zhi_bound.In my simulations, along with
xy,xz,yz in the dump files. The triclinic box is created with xy,xz,yz
all = 0, so as the sample distorts, the xy,xz,yz, change. What are the
xs,ys,zs in the atom positions scaled to? are the positions relative to
the orthogonal box created by the bound coordinates (xlo_bound to
xhi_bound, ylo_bound to yhi_bound, zlo_bound to zhi_bound writtne out by
the dump file define 0. to 1., are they scaled between the triclinic
edge vectors (e.g. xlo to xhi, ylo to yhi , zlo to zhi as edge vector
locations, or something else?

If my understanding is correct, then they are scaled according to (multiplied by) the a,b,c lattice vectors (whose coordinates depend on xhi-xlo, yhi-ylo, zhi-zlo, xy, xz, and yz). The equation for these lattice vectors is explained here. Here are some excerpts from the “dump2data.py” file which converts the xs,ys,zs coordinates into ordinary cartesion x,y,z coordinates:
x = xlo + xs * avec[0] + ys * bvec[0] + zs * cvec[0]
y = ylo + xs * avec[1] + ys * bvec[1] + zs * cvec[1]
z = zlo + xs * avec[2] + ys * bvec[2] + zs * cvec[2]

---- possibly irrelevant: feel free to skip the next portion of my reply —

The “dump2data.py” script mentioned above is used to extract coordinates from dump files. Perhaps this tool could help you. It is not official LAMMPS code, but (at one point I convinced myself that) it can successfully read dump files from triclinic systems. (Please let me know if you discover this is not the case.) You can try running it on your dump file to create a new DATA file and try visualizing that data file see if it worked. (By default “dump2data.py” will create a new data file for you. If you just want the raw x,y,z coordinates, then run it as “dump2data.py -raw”). Incidentally, if you include the “ix”, “iy”, “iz” image flags (recommended), then you would do the same thing with them. If you’re curious, here is an excerpt from the code that deals with ix,iy,iz flags:
x += ix * avec[0]
y += ix * avec[1]
z += ix * avec[2]
x += iy * bvec[0]
y += iy * bvec[1]
z += iy * bvec[2]
x += iz * cvec[0]
y += iz * cvec[1]
z += iz * cvec[2]
(it is equivalent to what was done with xs, ys, zs.)

You can also try using pizza.py to interpret the dump file.

As a matter of taste, I like to invoke the dump command with the mol, x,y,z, ix, iy, iz arguments:
dump 1 all custom 1000 traj.lammpstrj id mol type x y z ix iy iz
The choice is yours. Use whichever format is convenient for you. (I mention the ix,iy,iz flags be cause they are useful if you need to track the motion of atoms or molecules as they move across the periodic boundaries. Also, if you have any molecules in your system, it is helpful to include the “mol” attribute. Otherwise it is much more difficult to wrap molecule coordinates correctly.)

I am trying to place a volume of dummy
atoms in the triclinic box defined by a given dump such that the wrapped
triclinic box is filled, but with correct positions for post-processing
identification of voids in the sample (I will look for voids by
comparing actual atomic volumes and locations to the dummy atom
locations, and remove all dummy atoms where actual atoms are located.
Then what is left is where voids are located. I am using periodic
boundary conditions and wrapped coordinates in my dump file outputs.

I hope this helped.
Cheers

Andrew

I thnk you are asking what xs, ys, zs are in the dump file as the box changes (e.g. skews)
dynamically. From the dump doc page:

There are several options for outputting atom coordinates. The x, y, z attributes write atom coordinates “unscaled”, in the appropriate distance units (Angstroms, sigma, etc). Use xs, ys, zs if you want the coordinates “scaled” to the box size, so that each value is 0.0 to 1.0. If the simulation box is triclinic (tilted), then all atom coords will still be between 0.0 and 1.0. I.e. actual unscaled (x,y,z) = xsA + ysB + zs*C, where (A,B,C) are the non-orthogonal vectors of the simulation box edges, as discussed on the Howto triclinic doc page.

So simply think of A,B,C being computed every time a snapshot is output,
using the current box shape. And the xs,ys,zs being 0-1 values
within that box shape, with the appropriate transformation.

Steve