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.