Re: TCL: getting forces

From: Fangqiang Zhu (fzhu_at_ks.uiuc.edu)
Date: Fri Mar 05 2004 - 14:04:31 CST

Hi,

What you should use is the "loadtotalforces" command. This is explained
in the user's guide:
http://www.ks.uiuc.edu/Research/namd/current/ug/node32.html#SECTION00096700000000000000

Zhu

Bartosz Dobrzelecki wrote:

> 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:38:28 CST