AW: How to run a TCL proc at every step in NAMD using callback command?

From: Norman Geist (norman.geist_at_uni-greifswald.de)
Date: Thu Jun 14 2018 - 03:38:08 CDT

You can call foo now between "run" commands, you should't do it every step since this would be very slow. You can try running for at least stepspercycle (which is the lower bound anyway). You also
need to make sure that outputenergies is divisible by whatever number of steps you use for run, otherwise the energies are rubbish.

e.g.:

proc foo {labels values} {
      print $labels
      print "foo\n"
      print $values
 }
callback foo

set i_step 0
set incr_step [stepspercycle]
set runs [expr floor(50000000/$incr_step)]
outputenergies $incr_step

for {set r 0} {r < $runs} {incr r} {
        run $incr_step
        foo
}

> -----Urspr√ľngliche Nachricht-----
> Von: owner-namd-l_at_ks.uiuc.edu [mailto:owner-namd-l_at_ks.uiuc.edu] Im
> Auftrag von yjcoshc
> Gesendet: Donnerstag, 14. Juni 2018 10:11
> An: Namd Mailing List <namd-l_at_ks.uiuc.edu>
> Betreff: namd-l: How to run a TCL proc at every step in NAMD using callback
> command?
>
> Hello,
>
> I want to run a TCL proc every step in NAMD and the manual tells me
> the callback command can do that, so I have added following lines in the
> NAMD configuration file:
>
> proc foo {labels values} {
> print $labels
> print "foo\n"
> print $values
> }
> callback foo
> run 50000000
>
> However when I read the log file the "foo" string is only printed once.
> What I want is running the foo proc at every step. Are there any
> examples of using the callback command?
>
> Thanks,
>
> Haochuan Chen

This archive was generated by hypermail 2.1.6 : Wed Dec 04 2019 - 23:19:58 CST