Removed truncation of nrdf in v-rescale thermostat
authorBerk Hess <hess@kth.se>
Wed, 23 Apr 2014 13:15:08 +0000 (15:15 +0200)
committerGerrit Code Review <gerrit@gerrit.gromacs.org>
Tue, 29 Apr 2014 13:22:47 +0000 (15:22 +0200)
commit1f8a4f94581bb4ade86901208580bc6f01ee2abe
tree268b884efbeeaffe496a2260f3b353be624f65aa
parent2d79ca12f227ce79bba2c63d43ac8b4e2960fd65
Removed truncation of nrdf in v-rescale thermostat

The resampling function for the v-rescale thermostat expected an
integer value for nrdf, but a real was passed, which was truncated.
With a single coupling coupling group nrdf is analytically an int,
but could be off by a bit. The could lead to incorrect kinetic
energy fluctuations (averages were correct).
Now fractional nrdf's are properly handled for nrdf > 3.
For nrdf < 3 a check is added for integer values with a small margin
for rounding.
Fixes #1218

Change-Id: I4c60c337f9874d0bff51220ad09429140be2a056
src/mdlib/coupling.c