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
9e800ced
Commit
9e800ced
authored
Sep 17, 2015
by
Jason Swails
Browse files
Add units to the returned bond cubic and quartic terms and add tests for
AmoebaBondForce.
parent
d04154b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
33 additions
and
2 deletions
+33
-2
wrappers/python/src/swig_doxygen/swigInputConfig.py
wrappers/python/src/swig_doxygen/swigInputConfig.py
+2
-2
wrappers/python/tests/TestAPIUnits.py
wrappers/python/tests/TestAPIUnits.py
+31
-0
No files found.
wrappers/python/src/swig_doxygen/swigInputConfig.py
View file @
9e800ced
...
@@ -224,8 +224,8 @@ UNITS = {
...
@@ -224,8 +224,8 @@ UNITS = {
(
"AmoebaAngleForce"
,
"getAmoebaGlobalAngleSextic"
)
:
(
None
,()),
(
"AmoebaAngleForce"
,
"getAmoebaGlobalAngleSextic"
)
:
(
None
,()),
(
"AmoebaAngleForce"
,
"getAngleParameters"
)
:
(
None
,
(
None
,
None
,
None
,
'unit.radian'
,
'unit.kilojoule_per_mole/(unit.radian*unit.radian)'
)),
(
"AmoebaAngleForce"
,
"getAngleParameters"
)
:
(
None
,
(
None
,
None
,
None
,
'unit.radian'
,
'unit.kilojoule_per_mole/(unit.radian*unit.radian)'
)),
(
"AmoebaBondForce"
,
"getAmoebaGlobalBondCubic"
)
:
(
None
,()),
(
"AmoebaBondForce"
,
"getAmoebaGlobalBondCubic"
)
:
(
'1/unit.nanometer'
,()),
(
"AmoebaBondForce"
,
"getAmoebaGlobalBondQuartic"
)
:
(
None
,()),
(
"AmoebaBondForce"
,
"getAmoebaGlobalBondQuartic"
)
:
(
'1/unit.nanometer**2'
,()),
(
"AmoebaBondForce"
,
"getBondParameters"
)
:
(
None
,
(
None
,
None
,
'unit.nanometer'
,
'unit.kilojoule_per_mole/(unit.nanometer*unit.nanometer)'
)),
(
"AmoebaBondForce"
,
"getBondParameters"
)
:
(
None
,
(
None
,
None
,
'unit.nanometer'
,
'unit.kilojoule_per_mole/(unit.nanometer*unit.nanometer)'
)),
(
"AmoebaInPlaneAngleForce"
,
"getAmoebaGlobalInPlaneAngleCubic"
)
:
(
None
,()),
(
"AmoebaInPlaneAngleForce"
,
"getAmoebaGlobalInPlaneAngleCubic"
)
:
(
None
,()),
...
...
wrappers/python/tests/TestAPIUnits.py
View file @
9e800ced
...
@@ -517,5 +517,36 @@ class TestAPIUnits(unittest.TestCase):
...
@@ -517,5 +517,36 @@ class TestAPIUnits(unittest.TestCase):
self
.
assertEqual
(
force
.
getParticleParameters
(
1
)[
0
][
0
],
20
)
self
.
assertEqual
(
force
.
getParticleParameters
(
1
)[
0
][
0
],
20
)
self
.
assertEqual
(
force
.
getParticleParameters
(
2
)[
0
][
0
],
30
*
4.184
)
self
.
assertEqual
(
force
.
getParticleParameters
(
2
)[
0
][
0
],
30
*
4.184
)
def
testAmoebaBondForce
(
self
):
""" Tests the AmoebaBondForce API features """
force1
=
AmoebaBondForce
()
force2
=
AmoebaBondForce
()
force1
.
setAmoebaGlobalBondCubic
(
1.5
)
force2
.
setAmoebaGlobalBondCubic
(
1.5
/
angstrom
)
force1
.
setAmoebaGlobalBondQuartic
(
1.5
)
force2
.
setAmoebaGlobalBondQuartic
(
1.5
/
angstrom
**
2
)
self
.
assertEqual
(
force1
.
getAmoebaGlobalBondCubic
(),
1.5
/
nanometer
)
self
.
assertEqual
(
force2
.
getAmoebaGlobalBondCubic
(),
1.5
/
angstrom
)
self
.
assertEqual
(
force1
.
getAmoebaGlobalBondQuartic
(),
1.5
/
nanometer
**
2
)
self
.
assertAlmostEqualUnit
(
force2
.
getAmoebaGlobalBondQuartic
(),
1.5
/
angstrom
**
2
)
force1
.
addBond
(
0
,
1
,
0.15
,
10.0
)
force1
.
addBond
(
1
,
2
,
1.5
*
angstroms
,
10.0
*
kilocalories_per_mole
/
angstroms
**
2
)
self
.
assertEqual
(
force1
.
getNumBonds
(),
2
)
self
.
assertEqual
(
force2
.
getNumBonds
(),
0
)
i
,
j
,
req
,
k
=
force1
.
getBondParameters
(
0
)
self
.
assertEqual
(
req
,
0.15
*
nanometers
)
self
.
assertEqual
(
k
,
10.0
*
kilojoules_per_mole
/
nanometers
**
2
)
i
,
j
,
req
,
k
=
force1
.
getBondParameters
(
1
)
self
.
assertAlmostEqualUnit
(
req
,
1.5
*
angstroms
)
self
.
assertAlmostEqualUnit
(
k
,
10.0
*
kilocalories_per_mole
/
angstroms
**
2
)
def
testAmoebaAngleForce
(
self
):
""" Tests the AmoebaAngleForce API features """
if
__name__
==
'__main__'
:
if
__name__
==
'__main__'
:
unittest
.
main
()
unittest
.
main
()
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