From: Josh Vermaas (vermaas2_at_illinois.edu)
Date: Wed Mar 13 2013 - 15:15:18 CDT

Hi Salvador,
The correct useage for setting unit cells is:

pbc set cell {68.44962167734951 68.44962167734951 68.44962167734951}

You may need to have a package require line at the top of your script
for this to work in a script:

package require pbctools

Hope this helps!
-Josh Vermaas

On 03/13/2013 10:37 AM, Salvador H-V wrote:
> 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)
>