TCL: divide by zero

From: supram_at_nankai.edu.cn
Date: Thu Feb 05 2009 - 06:26:11 CST

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"

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

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:52:19 CST