Update particle position iteratively in between steps

From: Nate Walkins (walkinsnate_at_gmail.com)
Date: Sun Jun 03 2018 - 09:55:29 CDT

Hello NAMD users,

I am trying to find a way in which to update an atom's position according
to a different equation of motion at each time step using tclForces.
Basically I would like move the entire system and then at each time step
iteratively update the position of the atom using a newly calculated force
that must be updated at each iteration until some condition is met.

I tried calling loadtotalforces multiple times throughtout the calcforces
procedure after adding a new force but it did not appear to update.

Ideally the script would look something like the following (this is for a
single atom, but eventually will scale to include all of the same type),
but if anyone knows of a better way I'm all ears.

tclForces on
tclForcesScript {
  set atoms {4}
  addatom 4
  proc calcforces {} {
    global atoms
    enabletotalforces
    loadmasses masses
    if {[getstep] > 0} {
      foreach atom $atoms {
        while {condition not met} {
           loadcoords coords
           loadtotalforces forces
           set force {$forces($atom)}
           $coords($atoms) = New Position
        }
      }
    }
    }
}

Any help or suggestions are greatly appreciated, thanks!

This archive was generated by hypermail 2.1.6 : Mon Dec 31 2018 - 23:21:09 CST