TCL: getting forces

From: Bartosz Dobrzelecki (noplease_at_phys.uni.torun.pl)
Date: Fri Mar 05 2004 - 04:58:31 CST

Hi!

I want to observe total forces acting on specified atoms. I have no
problems with getting coordinates using loadcoords but loadforces does
not fill the f array. Here is my script:

tclForcesScript {

set atm1 10
set atm2 100

addatom $atm1
addatom $atm2

  proc calcforces {} {
    global atm1 atm2
    loadforces f
        
    if { [array exists f] } {
      print INDEX: $atm1 FORCE: $f($atm1)
      print INDEX: $atm2 FORCE: $f($atm2)
      print
    } else {
      print NOARRAY
    }
  }
}

Thank you in advance,
Bartek D.

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:37:24 CST