From: Josh Vermaas (vermaas2_at_illinois.edu)
Date: Mon Apr 27 2015 - 10:58:33 CDT

Hi Vlad,

Here is the body of the loop I tend to use:

colvars frame $i
colvars update
puts [colvars colvar "name" value]

-Josh Vermaas

On 04/27/2015 09:27 AM, Vlad Cojocaru wrote:
> Dear all,
>
> I am trying to use the cv command to output the value of a colvar for
> each frame of a trajectory (example script below). However, the
> script prints only the value corresponding to the last frame (e.g. if
> I load 50 frames it writes 50 times "Frame: 49; Colvar: 2.567"). Am I
> doing something wrong or missing something in the script ?
>
> I am using VMD compiled from CVS on 7th of April 2015
>
> Thanks for any advice
> Vlad
>
> --- example script ---
>
> mol new "topology"
> mol addfile "trajectory" waitfor all
>
> cv molid 0
> cv configfile "configfile"
>
> set numFrames [ molinfo 0 get numframes ]
>
> for { set frame 0 } { $frame < $numFrames } { incr frame } {
> animate goto $frame
> cv colvar "name" update
> set colvarValue [ cv colvar "name" value ]
> puts "Frame: $frame; Colvar: $colvarValue"
> }
>
>
>