/* could this be done more readably/compactly? */
switch (i)
{
+ case (efptMASS):
+ index = F_DKDL;
+ break;
case (efptCOUL):
index = F_DVDL_COUL;
break;
case (efptRESTRAINT):
index = F_DVDL_RESTRAINT;
break;
- case (efptMASS):
- index = F_DKDL;
- break;
default:
index = F_DVDL;
break;
so we don't need to add anything to the
enerd->enerpart_lambda[0] */
- /* we don't need to worry about dvdl contributions to the current lambda, because
- it's automatically zero */
-
- /* first kinetic energy term */
- dlam = (fepvals->all_lambda[efptMASS][i] - lambda[efptMASS]);
-
- enerd->enerpart_lambda[i+1] += enerd->term[F_DKDL]*dlam;
+ /* we don't need to worry about dvdl_lin contributions to dE at
+ current lambda, because the contributions to the current
+ lambda are automatically zeroed */
for (j = 0; j < efptNR; j++)
{
- if (j == efptMASS)
- {
- continue;
- } /* no other mass term to worry about */
-
+ /* Note that this loop is over all dhdl components, not just the separated ones */
dlam = (fepvals->all_lambda[j][i]-lambda[j]);
enerd->enerpart_lambda[i+1] += dlam*enerd->dvdl_lin[j];
if (debug)