Fixing handling of perturbation mass changes.
authorMichael Shirts <michael.shirts@virginia.edu>
Sun, 28 Apr 2013 00:57:19 +0000 (20:57 -0400)
committerMichael Shirts <michael.shirts@virginia.edu>
Tue, 30 Apr 2013 17:40:59 +0000 (13:40 -0400)
commitb8440aeb2256c94c441db3a269149aa756d2d2dc
tree065122f640931b45e2850555bccdff4bff4dea58
parent0b29f837fc4d971681da398e27d6cd59d44ef7ea
Fixing handling of perturbation mass changes.

Fixes redmine #1232

in force.c, sum_dhdl

 * moved F_DKDL to match the order in efpt_names.  Not required, but
   harmonizes the code (lack of clarity probably helped cause the
   problems before), has no code effect.

 * no longer treating the F_DKDL term separately from the other
   derivative components.  Will be added to F_DVDL if the mass-lambda
   term is not separately specified.  Results in a bit of a misnomer
   (F_DVDL becomes the derivative of the entire hamiltonian), but
   makes it much easier to collapse all molecular perturbation terms
   into a single component for output, where it is no longer really
   F_DVDL.  I think that's better than always printing out a F_DVDL
   and a F_DKDL for everything where F_DKDL will probably usually
   be zero.

in md_support.c, compute_globals

 * Synchronize the behaviors of the dhdls by writing first to the linear component
   corresponding to the mass, and then later transferring it to F_DKDL

in group.h, struct gmx_ekindata_t
 * add pointer to per-thread accumulation variable for dekindl

in tgroup.c, sum_ekin

 * For velocity verlet integrators, computes the dekindl correctly as
   the derivatives of the current ekin.  Shouldn't really affect the results
   in any significant way, since the average contribution will be the same
   regardless, but this is more consistent.

in tgroup.c, init_ekindata

 * reduce use of numeric constants in allocating memory

 * initialize new ekindata_t member

in update.c, calc_ke_part_normal

 * zero the accumulator for dekindl before using it,
   fixing bug introduced in 7b6508e8

in update.c, in calc_ke_part_normal and calc_ke_part_visc

 * sign error in mass change; if mass B is greater than mass A, then the
   change in free energy is positive, not negative.

Change-Id: I9deaf546bca66d400e0eb2c4015abeeda302dd1d
include/types/group.h
src/mdlib/force.c
src/mdlib/md_support.c
src/mdlib/tgroup.c
src/mdlib/update.c