[lammps-users] question on dump command for output of xyz format

I’d like to make output file in xyz format for SiO2 system.
However, just the use of “dump 1 all xyz 1000 traj.xyz” doesn’t show element name at the first column and give information of coordinate only in traj.xyz file.
There is even no description for it in the explanation of “dump_modify” command in the manual.
What should I do for it in detail?

Best regards,

Luke

2010/11/1 JhonY. I. <[email protected]...>:

I'd like to make output file in xyz format for SiO2 system.
However, just the use of "dump 1 all xyz 1000 traj.xyz" doesn't show
element name at the first column and give information of coordinate only in
traj.xyz file.
There is even no description for it in the explanation of "dump_modify"
command in the manual.
What should I do for it in detail?

there is no element name output for .xyz. this is from the manual:

The 'element' keyword applies only to the the dump cfg style

axel.

Thanks for your answer, axel.
xyz format is generally “element-name x coordinate y-cooridnate z-coordinate” with some head information as you know and I don’t know why xyz format of LAMMPS is different from a common rule.
If element name is omitted, it can’t be visualized in external molecular visualizer program.
Is there any method to insert element name to this form to visualize its trajectory correctly in external visualizer program?

Best regards,

Luke

2010/11/1 JhonY. I. <[email protected]...>:

Thanks for your answer, axel.
xyz format is generally "element-name x coordinate y-cooridnate

there is no standard for xyz.
many codes print out something similar but not quite.
the format

number of atoms
title
element x y z
element x y z

actually originates from the (now obscure) program xmol.
there are other packages, e.g. tinker that produce incompatible
.xyz files and yet other packages that put the element index
in the PSE in the first column. then others that have 7 columns
instead of 4 and contain velocities in addition to coordinates.
or others that store the current total energy in the "title" line,
and so on.

z-coordinate" with some head information as you know and I don't know why
xyz format of LAMMPS is different from a common rule.

lammps doesn't have the element information available
so where should it get it from. nobody has yet cared enough
to implement something that would allow the mapping that
the .cfg dump format supports. feel free to implement it.

i personally very much dislike the .xyz format because it
loses so much information and is so inefficient to read.
i usually write either .dcd or .xtc files. they also contain
the periodic box information, read more than 10x faster
and require less storage. you need to remember that
.xyz files are by default unsorted, leading to additional
problems with visualization programs that optimized by
assuming that atoms are always in the same order (and
thus need much less memory to store the trajectory).

If element name is omitted, it can't be visualized in external molecular
visualizer program.
Is there any method to insert element name to this form to visualize its
trajectory correctly in external visualizer program?

in VMD (my preferred visualization program) you can
feed topology and element information from a .psf file.
i often create this manually, but when i use VMD to generate
the data file (using the topotools plugin and some custom
scripts) then i have most of the important information already
already inside VMD and only need to also write out a .psf
file for analysis and visualization.

if you do have your data file, you can also use topotools
to re-create the element information with the following
script code.

package require topotools 1.1
topo readlammpsdata mysystem.data full
topo guessatom element mass
topo guessatom name element

animate write psf mysystem.psf

then you can first read mysystem.psf and
then any other (sorted!) coordinate format.

cheers,
    axel.

Many thanks for your answer, axel.
It was great help to me really.

Best regards,

Luke