From: Salvador H-V (chava09hv_at_gmail.com)
Date: Wed Mar 13 2013 - 10:37:39 CDT

Dear All,

First of all, thanks to Jerome for his previous suggestion.

I wrote a simple script to measure the rdf without the GUI of vmd. But I am
facing some troubles.

Here is my script:

==========
mol new gr1.xyz type xyz waitfor all

set cell {68.44962167734951 68.44962167734951 68.44962167734951}
set nframes [molinfo top get numframes]
set solv [atomselect top "name O"]

set rdf [measure gofr $solv $solv delta 0.01 rmax 18.0 usepbc 1 selupdate
0 first 0 last [expr {$nframes-1}] step 1]

set ri [lindex $rdf 0]
set gr [lindex $rdf 1]
set rdf_out [open "rdf.dat" "w"]

foreach val1 $ri val2 $gr {
   puts $rdf_out "$val1\t$val2"
}
close $rdf_out
exit
==============

But when I launch the script with: vmd -dispdev text -e calculate_gr.tcl

  I got the following message:
0
68.44962167734951 68.44962167734951 68.44962167734951
100
atomselect0
ERROR) measure rdf: unit cell volume is zero.
measure rdf: error during rdf calculation.

I got the same result when * *I use: molinfo top set volume [expr
{pow(68.44962167734951,3)}] instead of: set cell {..}

Any suggestion or point me out to my mistake would be greatly appreciated.

As usual, thanks a lot in advance.

Salvador

P.D Besides, I would like to understand why the script works when I just
remove the flags: usepbc 1 selupdate 1 in the measure gofr command! But I
obtain a wrong gr (compared with the gr obtained with the same set of
parameters via the GUI of vmd)