Re: addforce

From: Jérôme Hénin (jerome.henin_at_uhp-nancy.fr)
Date: Tue Apr 19 2005 - 11:21:21 CDT

Hi Leandro,

What happens is that the variables inside curly braces are not substituted
before the call to addforces. You could try this instead:

addforce $atm1 "$f(1) $f(2) $f(3)"

Jerome

On Tuesday 19 April 2005 16:38, Leandro Martínez wrote:
> Dear all,
> I'm trying to use the tclForces script to add a force that has
> a variable direction to some atom in my simulation. I have
> succeeded to compute the force and store each component
> in the variables f(1), f(2) and f(3). Now, when I try to
> apply the force using addforce, with
>
> addforce $atm1 { $f(1) $f(2) $f(3) }
>
> The program fails to run, and error message is bellow. It seems
> that I cannot put variables values to define the vector, only scalars.
> The addforce works fine with, for example,
>
> addforce $atm1 { 1. 0. 0. }
>
> but, of course, thats not what I want to do. I have also tried
>
> set force "$f(1) $f(2) $f(3)"
> addforce $atm1 { $force }
>
> and even
>
> set force "{ $f(1) $f(2) $f(3) }"
> addforce $atm1 $force
>
> and the errors are the same. Does anybody know how to solve that or
> what's the problem?
> Thanks,
> Leandro.
>
> ------------- Processor 0 Exiting: Called CmiAbort ------------
> Reason: FATAL ERROR: force not a vector
> while executing
> "addforce $atm1 { $f(1) $f(2) $f(3) }"
> (procedure "calcforces" line 68)
> invoked from within
> "calcforces"
>
> Charm++ fatal error:
> FATAL ERROR: force not a vector
> while executing
> "addforce $atm1 { $f(1) $f(2) $f(3) }"
> (procedure "calcforces" line 68)
> invoked from within
> "calcforces"
>
> TCL: DL = 10.0
> TCL: Force = 4.0 0.0 0.0
> TCL: force not a vector
> FATAL ERROR: force not a vector
> while executing
> "addforce $atm1 { $f(1) $f(2) $f(3) }"
> (procedure "calcforces" line 68)
> invoked from within
> "calcforces"

-- 
Jérôme Hénin
Equipe de Dynamique des Assemblages Membranaires
Université Henri Poincaré / CNRS
Tel : (33) 3 83 68 43 95        Fax : (33) 3 83 68 43 71
http://www.edam.uhp-nancy.fr/

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:39:21 CST