From: Emily Moore (emily.moore_at_utah.edu)
Date: Tue Aug 19 2008 - 12:21:11 CDT

Hello,
Iım trying to calculate the gofr for multiple frames of a trajectory. For
each frame, I would like to have the gofr for atoms ³type 4² against ³type
4², with the atoms that are considered to have a type=4 updated every frame.
The code below does the first frame correctly, but does not seem to update
the current frames type =4 atoms when calculating for the later frames. Iıve
tried using ³$sel1 update² and ³$sel1 frame $i² and Iıve tried taking out
³mol delete top² and ³$sel1 delete² but it still updates incorrectly, or not
at all (Iım not sure which is the problem, probably not updating at all).
Also, if there is any way to do this without a tcl script, within the
measuring gofr options window, that would be nice to know.
Thanks,
Emily

# Load the system and the trajectory
for {set i 0} {$i < 5} {incr i} {
mol new test.lammpstrj first $i last $i waitfor all

#set up the atom selections
set sel1 [atomselect top "type 4" ]

#calculate g(r)
set gr [measure gofr $sel1 $sel1 delta .02 rmax 80 usepbc 1 selupdate 1
first 0 last -1 step 1]

#set up the outfile and write out the data
set outfile [open "gofr.dat" w]

set r [lindex $gr 0]
set gr2 [lindex $gr 1]

foreach j $r k $gr2 {
   puts $outfile "$j $k"
}
puts "here"
close $outfile
file rename -force gofr.dat gofr.$i

# delete the frame, to erase the type info before next
mol delete top
$sel1 delete
}