Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
tsoc
openmm
Commits
a9947670
Commit
a9947670
authored
Jun 17, 2009
by
Christopher Bruns
Browse files
Use either bond constraints or harmonic stretch, but not both, in HelloWaterBox.cpp
parent
9aaeed29
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
13 deletions
+13
-13
examples/HelloWaterBox.cpp
examples/HelloWaterBox.cpp
+13
-13
No files found.
examples/HelloWaterBox.cpp
View file @
a9947670
...
...
@@ -156,25 +156,25 @@ static void simulateWaterBox() {
0.0001
*
OpenMM
::
NmPerAngstrom
*
SigmaPerVdwRadius
,
0.0000
*
OpenMM
::
KJPerKcal
);
// 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
// it as used in the force term kx, with energy kx^2/2.
bondStretch
.
addBond
(
oIndex
,
h1Index
,
0.9572
*
OpenMM
::
NmPerAngstrom
,
553.0
*
2
*
OpenMM
::
KJPerKcal
*
OpenMM
::
AngstromsPerNm
*
OpenMM
::
AngstromsPerNm
);
bondStretch
.
addBond
(
oIndex
,
h2Index
,
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
);
}
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
// it as used in the force term kx, with energy kx^2/2.
bondStretch
.
addBond
(
oIndex
,
h1Index
,
0.9572
*
OpenMM
::
NmPerAngstrom
,
553.0
*
2
*
OpenMM
::
KJPerKcal
*
OpenMM
::
AngstromsPerNm
*
OpenMM
::
AngstromsPerNm
);
bondStretch
.
addBond
(
oIndex
,
h2Index
,
0.9572
*
OpenMM
::
NmPerAngstrom
,
553.0
*
2
*
OpenMM
::
KJPerKcal
*
OpenMM
::
AngstromsPerNm
*
OpenMM
::
AngstromsPerNm
);
}
// Store bonds for exclusion list
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment