Re: Calculating or Outputing Forces

From: Joshua D. Moore (jdmoore_at_unity.ncsu.edu)
Date: Thu Jun 29 2006 - 12:55:38 CDT

Hi again,

I think I have determined that it would be too difficult for me to alter
the NAMD code to write out the forces.

I have discovered tclforces, but my tcl scripting is novice at best.

So far I have this

tclforces on
tclForcesScript {

  set numatoms 193

  for {set i 1} {$i < $numatoms} {incr i 1} {
      addatom $i
      }

  proc calcforces {} {
    set filename "forces.txt"
    setfileID [open $filename "w"]
    global numatoms

    loadcoords m
# Note: note sure if I need loadcoords

    loadtotalforces p
    for {set i 1} {$i < $numatoms} {incr i 1} {
    puts $fileID $p($i)

# Manual says to use "print" instead of puts but I don't think you can
write to a file with "print"

    }
    close $fileID
   }
}

This actually does not work. It appears (from the manual) that the
totalforces are calculated for the "previous" frame. So I need one frame
before I can call "loadtotalforces"? I am not sure how I could do this.
I can output the coordinates easily using the above script, just changing
p to m.

Can anyone point me in the right direction with my tcl script so that I
can output the forces?

Right now I am testing this on a very small simulation (only 192 atoms).
I actually will want all of the totalforces on each atom (x,y,z) for much
larger systems. I have seen in some places that it might be possible to
make fortran calls within tcl. Ideally, I would like to write these in
binary fortran unformatted format (i.e. dcd format). Otherwise, I can see
the file size approaching 100 GB or something during a few ns run.

Thanks.

Josh

On Wed, June 28, 2006 3:18 pm, Joshua D. Moore wrote:
> Hi,
>
> Would it be difficult to modify NAMD to output the forces in dcd format as
> was previously done in version 1.5?
>
> http://www.ks.uiuc.edu/Research/namd/1.5/ug/node26.html
>
> Thanks.
>
> Josh
>
> On Mon, June 26, 2006 10:00 pm, Joshua D. Moore wrote:
>> Is NAMD still capable of outputing forces in *dcd like files?
>>
>> See http://www.ks.uiuc.edu/Research/namd/1.5/ug/node26.html
>>
>> Or does there exist a script which will do this now from the *dcd
>> trajectories?
>>
>> Thanks.
>>
>> Josh
>>
>>
>>
>>
>
>
> --------------------------------------------------
> Joshua D. Moore
> Graduate Student
> North Carolina State University
> Department of Chemical and Biomolecular Engineering
> Box 7905 Centennial Campus
> Engineering Building I
> 911 Partners Way
> Raleigh, NC 27695-7905
> Phone: (919) 513-2051
> Fax: (919) 513-2470
> Email: jdmoore_at_unity.ncsu.edu
> --------------------------------------------------
>
>

--------------------------------------------------
Joshua D. Moore
Graduate Student
North Carolina State University
Department of Chemical and Biomolecular Engineering
Box 7905 Centennial Campus
Engineering Building I
911 Partners Way
Raleigh, NC 27695-7905
Phone: (919) 513-2051
Fax: (919) 513-2470
Email: jdmoore_at_unity.ncsu.edu
--------------------------------------------------

This archive was generated by hypermail 2.1.6 : Wed Feb 29 2012 - 15:42:16 CST