From: David Kingsbury (trentdk_at_gmail.com)
Date: Sun Jul 24 2005 - 20:45:47 CDT

Thanks for the help axel and blake!

I had no idea about the User field until your reply. Then, after some
reading about the "atomselect" function and such, I modified this
sample script I found on the mailing list. I'm using your idea of
reading in the KE values from another file ( I couldn't read from the
beta field, even though i would specify a different frame.. it still
retained the frame 1 values). The ke file is just a long list of ke
for each atom, and each frame is cancatinated to the file. This
script then applies each ke to each atom, frame after frame. Works
great!

Btw.. awesome website Axel! I'll send ya a link to some movies of
this stuff when i get it up. Its c60 bombarding si crystal. Beautiful
stuff =D

Here is the script!
#---------------------------------------------------

set pdb_file H:/sput/run/c60si.pdb
set ke_file [open "H:/sput/run/c60si.ke" r]

if {[molinfo num] > 0} {
  mol delete all
}

mol addfile $file waitfor all

set numframes [molinfo top get numframes]
set numatoms [molinfo top get numatoms]

mol modcolor 0 top User
mol colupdate 0 top 1
mol scaleminmax top 0 0.0 20.0

for {set i 0} {$i<$numframes} {incr i} {

  animate goto $i
  puts "Setting User data for frame $i ..."

  for {set j 0} {$j<($numatoms)} {incr j} {
    set ke [gets $ke_file]
    set atomsel [atomselect top "index $j" frame $i]
     $atomsel set user $ke
     $atomsel delete
  }
}

#-------------------------------------------------

On 7/24/05, Axel Kohlmeyer <axel.kohlmeyer_at_theochem.ruhr-uni-bochum.de> wrote:
> On Sat, 23 Jul 2005, David Kingsbury wrote:
>
> hi dave,
>
> DK> I'm running some MD simulations and want to have an on-the-fly
> DK> coloration of KE. I thought it would be ingenius to place the KE
> DK> values into the BETA field of a .pdb file, and watch it with VMD. So
> DK> now I have a 10 frame .pdb file of some action where the ke in the
> DK> beta field is changing every frame. I made sure to color by BETA, and
> DK> to check the "update color every frame" in the trajeectory tab. VMD
> DK> however is not updating the colors... it is just retaining frame 1's
>
> yep, that is how the VMD works. all structure and other similar
> information (bonds etc.) are only taken from the first frame
> (or a supported topology files) and from the remaining frames
> only the coordinates are taken.
>
> DK> BETA coloring scheme. Does anyone have any suggestions to get this
> DK> working? I have a feeling it my be a small fix, (or a bug?)
>
> there are actually two ways to this (been there, done it, and got the
> t-shirt ;-) ). either you store the data in the 'user' field (which
> is per frame, unlike beta) and use the 'User' colorization scheme
> or write a small function to be hooked into the animation loop
> that updates the beta field according to your pre-calculated values.
>
> please have a look at:
> http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/cpmd-vmd/part3.html#chap5_sect3
> for an example of the first method and about one screen down at:
> http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/cpmd-vmd/part3.html#chap5_sect4
> for an example of the second method.
>
> in your case, you probably want to use the first method, but
> then read the data from a separate file, like in the second example.
>
> i also should have a VMD script example somewhere, that computes
> an estimate of the instantaneous kinetic energy from within VMD
> (from distance differences) and stores it directly into the user
> field. unfortunately, i did not have the time to add it to
> the tutorial pages yet, so let me know, if i should send it to you.
>
> regards,
> axel.
>
> DK> Thanks!
> DK> -David B. Kingsbury
> DK> College of Charleston
> DK>
> DK>
>
> --
>
> =======================================================================
> Dr. Axel Kohlmeyer e-mail: axel.kohlmeyer_at_theochem.ruhr-uni-bochum.de
> Lehrstuhl fuer Theoretische Chemie Phone: ++49 (0)234/32-26673
> Ruhr-Universitaet Bochum - NC 03/53 Fax: ++49 (0)234/32-14045
> D-44780 Bochum http://www.theochem.ruhr-uni-bochum.de/~axel.kohlmeyer/
> =======================================================================
> If you make something idio
t-proof, the universe creates a better idiot.
>
>

-- 
-David Kingsbury