From: Benjamin Bouvier (benjamin.bouvier_at_sophia.inria.fr)
Date: Thu Jun 05 2008 - 12:35:31 CDT
More on that :
I've compared the two approaches below using loadforces. When there is
only one term per atom, they give the same result. When there are multiple
terms, they do not...
It seems that addforce should only be called *once* per atom - presumably,
when called multiple times on one atom, only the force corresponding to
the last call is honored... Though as a NAMD newbie, I was not able to
check in the source whether this is effectively the case.
Can someone confirm this? I found similar questions on the mailing-list,
but with no replies...
IMHO, a sentence should be added to the manual to describe addforce's
behavior more accurately...
Le Thu, 05 Jun 2008 15:18:16 +0200, Benjamin Bouvier
<Benjamin.Bouvier_at_sophia.inria.fr> a écrit:
> Hi all,
> I'm using TCLforces to compute custom forces on a group of atoms. The
> force on a given atom (say, $i) is a sum of several terms (say, $x1, $x2
> and $x3).
> Is it OK to use:
> addforce $i $x1
> addforce $i $x2
> addforce $i $x3
> or should I do the sum myself, ie:
> addforce $i [vecadd $x1 $x2 $x3]
> I'm looking through the code right now, but if anybody knows the answer
> and would like to spare me some work...
This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 05:21:05 CST