Re: tclforces: force not a vector

From: Peter Freddolino (petefred_at_ks.uiuc.edu)
Date: Thu Jul 12 2007 - 09:34:02 CDT

Hi Maria,
you can find a brief discussion of how to use swig to wrap c code at
http://www.swig.org/tutorial.html, and a more detailed tcl-centric
discussion at
http://ic.net/~cflynt/realprog/realwrld/beazley/tclchap.htm. You'll just
need to write C functions that perform the necessary math and take
parameters which are available inside of calcforces, and then load the
shared object generated by compiling your c code in the tclforces script
and use the defined functions in your script. You should be able to
follow the example in the tutorial from that first link pretty directly.

As far as the cvs version, you don't need to change the code; just
follow the directions under "bleeding-edge" at
http://www.ks.uiuc.edu/Research/namd/development.html and compile the
code you get via cvs, and you should be able to use that (newly
compiled) version.

Best,
Peter

maria goranovic wrote:
> Thank you Peter,
>
> In yesterday's post, you mention that you use the following strategy:
>
> "Use a compiled tcl extension (probably written in C and built using
> swig) to do any serious math in the tclforces script "
>
> Can you please elaborate on this ? How is this done ?
>
> Secondly, how does the CVS work ? I understand that I have to apply
> for an account, install CVS on my local computer. What then ? Do I
> need to make changes in the source code to enable this extrabonds
> feature ? Or do I just need to use a beta binary and use the
> extrabonds feature ?
>
> Thank you a lot,
>
> -Maria
>
>
> On 7/12/07, *Peter Freddolino* < petefred_at_ks.uiuc.edu
> <mailto:petefred_at_ks.uiuc.edu>> wrote:
>
> Maria,
> please see the discussion from yesterday on this error. The same
> solutions apply to your case.
> Alternatively, if you don't mind using the cvs version of
> namd, you can
> try the new extrabonds feature, which allows you to specify a file
> containing dihedral restraints of the format
>
> dihedral index1 index2 index3 index4 k theta0
>
> To use this feature, set
> extraBonds yes
> extraBondsFile FILENAME
> (where filename is the file containing your dihedral definitions)
>
> in your config file.
>
> Peter
>
> maria goranovic wrote:
> > While using a tclforces script to apply dihedral restraints,
> I get the
> > following error after about 85000 steps of dynamics.
> >
> > #=============================================
> > WRITING COORDINATES TO DCD FILE AT STEP 87000
> > TCL: force not a vector
> > FATAL ERROR: force not a vector
> > while executing
> > "addforce $id21 [vecscale $g5 $forcepsi]"
> > (procedure "calcforces" line 78)
> > invoked from within
> > "calcforces"
> > #==============================================
> >
> > The constraint script is attached. The attempt is to
> constrain the
> > dihedral angles of the residues 19 and 197 to helical values.
> >
> > There is some discussion in the mail archive about the "force
> not a
> > vector" error. What is confusing is why the error shows up
> only after
> > 85000 steps, and not from the very beginning of the simulation ?
> >
> > Can someone please suggest a remedy ?
> >
> > -Maria.
> > --
> > Maria G.
> > Technical University of Denmark
> > Copenhagen
>
>
>
>
> --
> Maria G.
> Technical University of Denmark
> Copenhagen
>
>
>
>
> --
> Maria G.
> Technical University of Denmark
> Copenhagen

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:44:57 CST