modifying velocities within global master

From: Nicholas Musolino (musolino_at_mit.edu)
Date: Sun Apr 18 2010 - 16:42:51 CDT

Dear NAMD-l:

With a great deal of help from my colleagues, I have modified the NAMD source code by adding a GlobalMaster class, named GlobalMasterIOP, to calculate certain order parameters and apply restraint forces for use with finite temperature string method (FTSM).

The next step I'd like to try is implementing so-called "Voronoi dynamics", in which all the velocities in a system are reversed at a certain point in the simulation, based on the state of the order parameters, which are themselves calculated based on the atomic coordinates.

Is there any way, within a global master, do to that? By reversing the velocity, I mean the assignment:
v_i = -v_i for all atoms i
I guess I'm looking for the "officially" best way of doing this, analogous to "modifyAppliedForces().add()" used to apply forces.

I looked in the Controller.{h,C} files and found this statement within the rescaleVelocities function:
        broadcast->velocityRescaleFactor.publish(step,factor);
Would this take care of the job? Ultimately I think I would want to invoke Sequencer::rescaleVelocites.

The reason I'm asking is that all the compute-objects stuff in Broadcast.h, Sequencer.C, is a bit over my head... all I've done is create a GlobalMaster class, and I haven't delved into any of the compute object or message-passing details.

Thanks so much for any help anyone can offer, and best regards,
Nicholas
---------------------------------------------------------------------------
Nicholas Musolino
Ph.D. candidate, Department of Chemical Engineering, MIT

Right now the structure in GlobalMasterIOP.C is, in simplified form:
> void GlobalMasterIOP::calculate() {
> // lots of code removed here.
> AtomIDList::const_iterator a_i = getAtomIdBegin();
> AtomIDList::const_iterator a_e = getAtomIdEnd();
> PositionList::const_iterator p_i = getAtomPositionBegin();
> for ( ; a_i != a_e; ++a_i, ++p_i ) {
> // get positions using *a_i, *p_i
> }
> // Calculate all forces here, then
> // apply forces below:
> modifyAppliedForces().resize(0);
> modifyForcedAtoms().resize(0);
> for ( loop over all forced atoms' atomids and corresponding forces) {
> modifyForcedAtoms().add(atomid);
> modifyAppliedForces().add(force)
> }
> // print output
> }

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