Commit 306d1bb0 authored by peastman's avatar peastman
Browse files

Merge pull request #244 from peastman/master

Reference implementation of AndersenThermostat did not handle massless particles correctly
parents 0865043e 8d062ebb
......@@ -72,6 +72,7 @@ using OpenMM::RealVec;
for (int j = 0; j < (int) atomGroups[i].size(); j++) {
int atom = atomGroups[i][j];
if (atomMasses[atom] != 0) {
const RealOpenMM velocityScale = static_cast<RealOpenMM>(sqrt(BOLTZ*temperature/atomMasses[atom]));
atomVelocities[atom][0] = velocityScale*SimTKOpenMMUtilities::getNormallyDistributedRandomNumber();
atomVelocities[atom][1] = velocityScale*SimTKOpenMMUtilities::getNormallyDistributedRandomNumber();
......@@ -79,6 +80,7 @@ using OpenMM::RealVec;
}
}
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment