Re: extending namd / shared library build (UNCLASSIFIED)

From: Ajasja Ljubetič (
Date: Tue Nov 09 2010 - 08:39:47 CST

As a related suggestion, I am currently using NAMD to compute some energies
in a random conformational search.
I write the DCD then calculate the energies using the script snippet found
below. (One still has to parse the log file though).

Best regards,
# energy calculation
print "opening $dcdin"
coorfile open dcd $dcdin
set ts 0

while { ![coorfile read] } {
  # Set firstTimestep so our energy output has the correct TS.
  firstTimestep $ts
  # Compute energies and forces, but don't try to move the atoms.
  run 0

  incr ts 1

coorfile close

On Mon, Nov 1, 2010 at 21:05, Jim Phillips <> wrote:

> That Programming Guide is for NAMD 1.5 based on PVM and is a decade old so
> it's not going to be of much help to you with NAMD 2.7.
> The place to splice in would be ScriptTcl.C at ScriptTcl::run() combined
> with the "output" script command that causes files to be written.
> It won't be easy, though, since NAMD is a parallel program and you need to
> let Charm++ initialize through mainfunc() first. Making it look like Tcl
> was driving everything is a hack in itself.
> -Jim
> On Fri, 29 Oct 2010, Sellers, Michael S. (Cont, ARL/WMRD) wrote:
> Classification: UNCLASSIFIED
>> Caveats: NONE
>> NAMD Community,
>> Does anyone have a few pointers on opening NAMD up to some wrapper code?
>> Ideally, I would like to build NAMD as a library and drive it via another
>> program. I have some "experience" with this using LAMMPS. Its layout
>> makes
>> doing this type of thing very easy.
>> I have made my way through the NAMD code and read a good portion of the
>> Programming Guide recommended by a few users on this listserv, but I'm
>> still
>> having trouble locating a spot where I can have some low-level access:
>> atom
>> positions, forces, etc. Also starting up NAMD and issuing commands
>> on-the-fly.
>> I would greatly appreciate a few tips on where to start and, if possible,
>> a
>> quick statement on the structural changes of NAMD since the Programming
>> Guide was released.
>> Thanks,
>> Michael Sellers
>> Classification: UNCLASSIFIED
>> Caveats: NONE

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