From: Axel Kohlmeyer (
Date: Thu Jun 09 2016 - 10:45:58 CDT

On Thu, Jun 9, 2016 at 11:06 AM, Christian Leitold
<> wrote:
> Hello,
> I am running VMD 1.9.2 and would like to customize the XYZ file reader
> plugin for my needs. I already know how to do this in principle (I
> already added support for box information some time ago), however, I
> am struggling when it comes to adding support for (optional)
> velocities. In the function
> read_xyz_timestep(void *mydata, int natoms, molfile_timestep_t *ts)
> the coordinates are read and saved to ts->coords[3*i ] for x,
> ts->coords[3*i+1] for y etc. Now I thought I could do the same with
> ts->velocities, apart from the fact that I have to make sure that the
> array is actually allocated first. However, although I can allocate
> the array and save the velocities to it, this seems to have no effect
> whatsoever, i. e. I still cannot access the velocities when running
> VMD with my modified XYZ reader. So my question, what else do I have
> to do to make that work? Just to be sure, the modified plugin _is_
> properly loaded, so that is not the problem here.

you have to signal VMD, that you have velocities in the time step metadata.
please have a look at the LAMMPS plugin.

in fact, i would suggest rather than hacking VMD plugins, simply
convert your custom file into a LAMMPS format file, or generate it
directly. it is not very different from what a hacked .xyz file would
rather than using a private non-standard customization, you would
output a documented and supported file format and those files would
not only be readable by VMD, but all programs that use the VMD plugins
(e.g. pymol) and others that support the LAMMPS file format directly.
with your hacked .xyz format, you would only be compatible to your
hacked plugin.


> Thanks!
> Christian

Dr. Axel Kohlmeyer
College of Science & Technology, Temple University, Philadelphia PA, USA
International Centre for Theoretical Physics, Trieste. Italy.