Particles velocities in VMD

161 views
Skip to first unread message

Jonathan Watkins

unread,
Apr 28, 2014, 9:39:30 AM4/28/14
to hoomd...@googlegroups.com
Hi all,

I have a very simple LJ simulation of particles in a 2D box.

Does anyone have nice way of viewing particle velocities in vmd that are output that are from hoomd. The best I can do is to output hundreds of xml files, one for each snapshot. I then have to import these images one at a time into VMD. This is clearly not a god solution.

1) Is there a better way to do this by a different method?

2) If the multiple xml files method is the only way to output the velocities, does anyone know an easy way to import them into VMD?

Thanks,

Jon

Joshua Anderson

unread,
Apr 28, 2014, 9:53:35 AM4/28/14
to hoomd...@googlegroups.com
The next feature release of hoomd, version 1.1 will include a new binary file format capable of storing velocities in the trajectory dump. That will at least enable you to store such data efficiently. I don't know if VMD's molfile plugin architecture allows plugins to provide velocity per frame, though.
------
Joshua A. Anderson, Ph.D.
Research Area Specialist, Chemical Engineering, University of Michigan
Phone: 734-647-8244
http://www-personal.umich.edu/~joaander/
> --
> You received this message because you are subscribed to the Google Groups "hoomd-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to hoomd-users...@googlegroups.com.
> To post to this group, send email to hoomd...@googlegroups.com.
> Visit this group at http://groups.google.com/group/hoomd-users.
> For more options, visit https://groups.google.com/d/optout.

Jonathan Watkins

unread,
Apr 28, 2014, 9:59:59 AM4/28/14
to hoomd...@googlegroups.com
Thanks for the reply. I will have a look at the mol file plugin in more detail.

Benjamin Trefz

unread,
Apr 28, 2014, 10:13:38 AM4/28/14
to hoomd...@googlegroups.com
Hey Jon, 

I used to use a bash script like the one below to read multiple xml files into vmd. 
Not sure if that works for your problem.

Best regards,
    Ben

#!/bin/bash

if ( $1 ); then
        echo "Usage: video.sh <path to snapshots>"
else
        cd $1
        ofile="video.tcl"

        array=(`ls *.xml | sort`)
        length=${#array[*]}
        length=$(($length-1))

        echo "#!/usr/bin/tclsh" > $ofile 
        echo "mol new ${array[0]} type hoomd waitfor all" >> $ofile

        for i in $(seq 1 $length); do
                echo "mol addfile ${array[$i]} type hoomd waitfor all" >> $ofile
        done
        echo "animate" >> $ofile

        vmd -e video.tcl
        rm video.tcl    
fi

Jonathan Watkins

unread,
Apr 28, 2014, 11:07:55 AM4/28/14
to hoomd...@googlegroups.com
Yes that is exactly what I needed. Thank you. You have saved me a lot of time.
Reply all
Reply to author
Forward
0 new messages