AW: selection error in forces script

From: Norman Geist (norman.geist_at_uni-greifswald.de)
Date: Tue Mar 08 2016 - 01:35:26 CST

You don't have atomselect available in NAMD, but you could prepare some kind of config file from VMD which contains your atoms of interest as atom indices.

Norman Geist

> -----Ursprüngliche Nachricht-----
> Von: owner-namd-l_at_ks.uiuc.edu [mailto:owner-namd-l_at_ks.uiuc.edu] Im
> Auftrag von Olya Kravchenko
> Gesendet: Dienstag, 8. März 2016 06:03
> An: NAMD <namd-l_at_ks.uiuc.edu>
> Betreff: namd-l: selection error in forces script
>
> Hi all,
>
> I have another question about applying constant forces. My system is a
> box of argon atoms, I would like to apply constant force in Z
> direction to atoms that pass through XY slab of certain thickness
> located at the center. Here is my script (this is to be called in
> .conf file):
>
> set sel [atomselect top all]
> set ailist [$sel get index]
> foreach i $ailist { addatom $i }
>
> set linaccel_namd [vecscale [expr 1.0/418.68] $linaccel]
> print "linear acceleration imparted: ($linaccel) Ang*ps^-2"
>
> proc calcforces { } {
> global ailist linaccel_namd
> loadcoords coords
> loadmasses masses
> foreach i $ailist {
> foreach {x y z} $coords($i) {;}
> if { $z > 27.5 and $z < 37.5} {
> set force [vecscale $masses($i) $linaccel_namd]
> addforce $atom $force
> }
> }
> }
>
> When I submit the job I am getting the following error:
>
> Reason: FATAL ERROR: wrong # args
> while executing "atomselect top all"
> invoked from within "set sel [atomselect top all]"
> (file "my_force1.tcl" line 1)
>
> Charm++ fatal error:
> FATAL ERROR: wrong # args
> while executing "atomselect top all" invoked from within
> "set sel [atomselect top all]"
> (file "my_force1.tcl" line 1)
>
> Why is it complaining about [atomselect top all]? I tried various ways
> to set this selection and when I make it an array (which I know makes
> no sense but I just wanted to proceed further and see if it complains
> about the next line) I see the same error message about second line
> (set ailist [$sel get index]). Can't figure out what is wrong with the
> syntax here. Help, please?

This archive was generated by hypermail 2.1.6 : Sun Dec 31 2017 - 23:20:12 CST