Commit a9947670 authored by Christopher Bruns's avatar Christopher Bruns
Browse files

Use either bond constraints or harmonic stretch, but not both, in HelloWaterBox.cpp

parent 9aaeed29
......@@ -156,6 +156,13 @@ static void simulateWaterBox() {
0.0001 * OpenMM::NmPerAngstrom * SigmaPerVdwRadius,
0.0000 * OpenMM::KJPerKcal);
// constrain O-H bond lengths
if (UseConstraints) {
system.addConstraint(oIndex, h1Index,
0.9572 * OpenMM::NmPerAngstrom);
system.addConstraint(oIndex, h2Index,
0.9572 * OpenMM::NmPerAngstrom);
} else {
// Add stretch parameters for two covalent bonds
// Note factor of 2 for stiffness below because Amber specifies the constant
// as it is used in the harmonic energy term kx^2 with force 2kx; OpenMM wants
......@@ -168,13 +175,6 @@ static void simulateWaterBox() {
0.9572 * OpenMM::NmPerAngstrom,
553.0 * 2 * OpenMM::KJPerKcal
* OpenMM::AngstromsPerNm * OpenMM::AngstromsPerNm);
// constrain O-H bond lengths
if (UseConstraints) {
system.addConstraint(oIndex, h1Index,
0.9572 * OpenMM::NmPerAngstrom);
system.addConstraint(oIndex, h2Index,
0.9572 * OpenMM::NmPerAngstrom);
}
// Store bonds for exclusion list
......
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