Fwd:Re: TCL: divide by zero

From: supram_at_nankai.edu.cn
Date: Thu Feb 05 2009 - 10:28:45 CST

Thank you very much for you kind help!!! Here is my config file. When the part of "abf restraintlist { rest1 { cyl { { LGLU 2 O1 } {LGLU 2 O2} } \ 1.0 \ {0.0005 0.06 -10.788 } \ { 0 0 1 } } rest2 { cyl { { LGLU 2 O3 } {LGLU 2 O4 }} 1.0 \ { -0.0005 -0.0595 -5.212 } \ { 0 0 1 } } } " is in the config file, the fault will come.Without it, the fault will not come.I don't know why? config file: structure bcdlglu_wb_na.psf coordinates restart.coor velocities restart.vel extendedsystem restart.xsc firsttimestep 1010000 paraTypeCharmm on parameters par_all22_prot.inp parameters CSFF_parm.inp exclude scaled1-4 1-4scaling 1.0 cutoff 14.0 switching on switchdist 12.0 pairlistdist 16.0 timestep 1.0 rigidbonds all nonbondedFreq 1 fullElectFrequency 2 stepspercycle 20 langevin on langevinDamping 1 langevinTemp 298.15 langevinHydrogen on useGroupPressure yes useFlexibleCell no useConstantArea no langevinPiston on langevinPistonTarget 1 langevinPistonPeriod 100 langevinPistonDecay 50 langevinPistonTemp 298.15 wrapwater on wrapall on PME on PMEGridSizeX 36 PMEGridSizeY 36 PMEGridSizeZ 60 constraints on consref bcdlglu_wb_na_h.pdb conskfile bcdlglu_wb_na_h.pdb conskcol B outputName output binaryoutput no outputEnergies 1000 outputTiming 1000 outputPressure 1000 dcdfile bcdlglu_wb.dcd dcdfreq 1000 dcdunitcell yes xstfreq 1000 restartname restart-1 binaryrestart no restartfreq 1000 source E:/NAMD/lib/abf/abf.tcl abf coordinate zCoord abf abf1 { 14 35 56 77 98 119 140 } abf abf2 { 149 150 164 165 } abf ximin -8 abf ximax -4 abf dxi 0.1 abf fullsamples 2000 abf dsmooth 0.1 abf forceconst 20 abf applybias yes abf outputfreq 1000 abf writexifreq 1000 abf outfile bcdlglu.abf abf distFile bcdlglu.dist abf historyfile bcdlglu-his.abf abf restraintlist { rest1 { cyl { { LGLU 2 O1 } {LGLU 2 O2} } \ 1.0 \ {0.0005 0.06 -10.788 } \ { 0 0 1 } } rest2 { cyl { { LGLU 2 O3 } {LGLU 2 O4 }} 1.0 \ { -0.0005 -0.0595 -5.212 } \ { 0 0 1 } } } run 4000000 >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 >Dear namd users, > > Can some tell me what the matter with my programe? > The output was as follows: > > >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ǺThank you very much for you kind help!!! Here is my config file. When the part of "abf restraintlist { rest1 { cyl { { LGLU 2 O1 } {LGLU 2 O2} } \ 1.0 \ {0.0005 0.06 -10.788 } \ { 0 0 1 } } rest2 { cyl { { LGLU 2 O3 } {LGLU 2 O4 }} 1.0 \ { -0.0005 -0.0595 -5.212 } \ { 0 0 1 } } } " is in the config file, the fault will come.Without it, the fault will not come.I don't know why? config file: structure bcdlglu_wb_na.psf coordinates restart.coor velocities restart.vel extendedsystem restart.xsc firsttimestep 1010000 paraTypeCharmm on parameters par_all22_prot.inp parameters CSFF_parm.inp exclude scaled1-4 1-4scaling 1.0 cutoff 14.0 switching on switchdist 12.0 pairlistdist 16.0 timestep 1.0 rigidbonds all nonbondedFreq 1 fullElectFrequency 2 stepspercycle 20 langevin on langevinDamping 1 langevinTemp 298.15 langevinHydrogen on useGroupPressure yes useFlexibleCell no useConstantArea no langevinPiston on langevinPistonTarget 1 langevinPistonPeriod 100 langevinPistonDecay 50 langevinPistonTemp 298.15 wrapwater on wrapall on PME on PMEGridSizeX 36 PMEGridSizeY 36 PMEGridSizeZ 60 constraints on consref bcdlglu_wb_na_h.pdb conskfile bcdlglu_wb_na_h.pdb conskcol B outputName output binaryoutput no outputEnergies 1000 outputTiming 1000 outputPressure 1000 dcdfile bcdlglu_wb.dcd dcdfreq 1000 dcdunitcell yes xstfreq 1000 restartname restart-1 binaryrestart no restartfreq 1000 source E:/NAMD/lib/abf/abf.tcl abf coordinate zCoord abf abf1 { 14 35 56 77 98 119 140 } abf abf2 { 149 150 164 165 } abf ximin -8 abf ximax -4 abf dxi 0.1 abf fullsamples 2000 abf dsmooth 0.1 abf forceconst 20 abf applybias yes abf outputfreq 1000 abf writexifreq 1000 abf outfile bcdlglu.abf abf distFile bcdlglu.dist abf historyfile bcdlglu-his.abf abf restraintlist { rest1 { cyl { { LGLU 2 O1 } {LGLU 2 O2} } \ 1.0 \ {0.0005 0.06 -10.788 } \ { 0 0 1 } } rest2 { cyl { { LGLU 2 O3 } {LGLU 2 O4 }} 1.0 \ { -0.0005 -0.0595 -5.212 } \ { 0 0 1 } } } run 4000000 >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 >Dear namd users, > > Can some tell me what the matter with my programe? > The output was as follows: > > >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:52:20 CST