Re: TCL: divide by zero

From: Grace Brannigan (gracebrannigan_at_gmail.com)
Date: Thu Feb 05 2009 - 10:12:01 CST

I presume you are dividing by 0, as the error message says - i.e., $sum is
zero when you divide by it. Without the actual program its impossible for me
to say why this is, but it often happens when one tries to normalize
something without making a special case for the instance that the number of
samples is zero.

-Grace

On Thu, Feb 5, 2009 at 7:26 AM, <supram_at_nankai.edu.cn> wrote:

> Dear namd users,
>
> Can some tell me what the matter with my programe?
> The output was as follows:
>
> TCL: divide by zero
> FATAL ERROR: divide by zero
> while executing
> "expr {$term / $sum}"
> (procedure "vecnorm" line 5)
> invoked from within
> "vecnorm [veccross $vecd $u"
> ("cyl" arm line 10)
> invoked from within
> "switch $type {
> "dist" {
> # Apply a harmonic restraint to a distance
>
> foreach { a1 a2 } $atoms($r) {}
> set k [lindex $rArray($r) 3]
> set r..."
> ("foreach" body line 4)
> invoked from within
> "foreach r [ array names atoms ] {
>
> set type [ lindex $rArray($r) 0 ]
> switch $type {
> "dist" {
> # Apply a harmonic restraint to a distance
>
> ..."
> (in namespace eval "::ABF" script line 6)
> invoked from within
> "namespace eval ABF {
>
> loadcoords coords
>
> # Loop on requested restraints
> foreach r [ array names atoms ] {
>
> set type [ lindex $rArray($..."
> (procedure "restraints" line 2)
> invoked from within
> "restraints "
> (in namespace eval "::ABF" script line 14)
> invoked from within
> "namespace eval ::ABF {
>
> # First timestep : we don't have forces
> if { $timestep == 0 } {
>
> # must not be equal to $timestep - 1
> set timeStored -2
> ..."
> (procedure "calcforces" line 2)
> invoked from within
> "calcforces"
>

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:50:28 CST