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
91920ef4
"vscode:/vscode.git/clone" did not exist on "6c7b87371fdf62dd741f785d88fdec26419194ab"
Commit
91920ef4
authored
Mar 17, 2020
by
Zheng Gong
Browse files
add test case for constraints and rigidWater in CharmmPsfFile
parent
0c646ace
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
20 additions
and
27 deletions
+20
-27
wrappers/python/tests/TestCharmmFiles.py
wrappers/python/tests/TestCharmmFiles.py
+20
-27
No files found.
wrappers/python/tests/TestCharmmFiles.py
View file @
91920ef4
...
...
@@ -366,41 +366,34 @@ class TestCharmmFiles(unittest.TestCase):
psf
=
CharmmPsfFile
(
'systems/water_methanol.psf'
)
params
=
CharmmParameterSet
(
'systems/water_methanol.prm'
)
# the system is made of one water molecule and one methanol molecule
bH
_water
=
[[
0
,
1
],
[
1
,
2
]]
aH
_water
=
[[
0
,
2
]]
bH
_methanol
=
[[
3
,
4
],
[
3
,
5
],
[
3
,
6
],
[
7
,
8
]]
bCO
_methanol
=
[[
3
,
7
]]
aH
_methanol
=
[[
4
,
5
],
[
4
,
6
],
[
5
,
6
],
[
3
,
8
]]
hBonds
_water
=
[[
0
,
1
],
[
1
,
2
]]
hAngles
_water
=
[[
0
,
2
]]
hBonds
_methanol
=
[[
3
,
4
],
[
3
,
5
],
[
3
,
6
],
[
7
,
8
]]
allBonds
_methanol
=
hBonds_methanol
+
[[
3
,
7
]]
hAngles
_methanol
=
[[
4
,
5
],
[
4
,
6
],
[
5
,
6
],
[
3
,
8
]]
system
=
psf
.
createSystem
(
params
,
constraints
=
None
,
rigidWater
=
False
)
assert
system
.
getNumConstraints
()
==
0
self
.
assert
Equal
(
system
.
getNumConstraints
()
,
0
)
system
=
psf
.
createSystem
(
params
,
constraints
=
None
,
rigidWater
=
True
)
assert
system
.
getNumConstraints
()
==
3
for
i
in
range
(
3
):
assert
system
.
getConstraintParameters
(
i
)[:
2
]
in
bH_water
+
aH_water
self
.
assertCountEqual
([
system
.
getConstraintParameters
(
i
)[:
2
]
for
i
in
range
(
system
.
getNumConstraints
())],
hBonds_water
+
hAngles_water
)
system
=
psf
.
createSystem
(
params
,
constraints
=
HBonds
,
rigidWater
=
False
)
assert
system
.
getNumConstraints
()
==
6
for
i
in
range
(
6
):
assert
system
.
getConstraintParameters
(
i
)[:
2
]
in
bH_water
+
bH_methanol
self
.
assertCountEqual
([
system
.
getConstraintParameters
(
i
)[:
2
]
for
i
in
range
(
system
.
getNumConstraints
())],
hBonds_water
+
hBonds_methanol
)
system
=
psf
.
createSystem
(
params
,
constraints
=
HBonds
,
rigidWater
=
True
)
assert
system
.
getNumConstraints
()
==
7
for
i
in
range
(
7
):
assert
system
.
getConstraintParameters
(
i
)[:
2
]
in
bH_water
+
aH_water
+
bH_methanol
self
.
assertCountEqual
([
system
.
getConstraintParameters
(
i
)[:
2
]
for
i
in
range
(
system
.
getNumConstraints
())],
hBonds_water
+
hAngles_water
+
hBonds_methanol
)
system
=
psf
.
createSystem
(
params
,
constraints
=
AllBonds
,
rigidWater
=
False
)
assert
system
.
getNumConstraints
()
==
7
for
i
in
range
(
7
):
assert
system
.
getConstraintParameters
(
i
)[:
2
]
in
bH_water
+
bH_methanol
+
bCO_methanol
self
.
assertCountEqual
([
system
.
getConstraintParameters
(
i
)[:
2
]
for
i
in
range
(
system
.
getNumConstraints
())],
hBonds_water
+
allBonds_methanol
)
system
=
psf
.
createSystem
(
params
,
constraints
=
AllBonds
,
rigidWater
=
True
)
assert
system
.
getNumConstraints
()
==
8
for
i
in
range
(
8
):
assert
system
.
getConstraintParameters
(
i
)[:
2
]
in
bH_water
+
aH_water
+
bH_methanol
+
bCO_methanol
self
.
assertCountEqual
([
system
.
getConstraintParameters
(
i
)[:
2
]
for
i
in
range
(
system
.
getNumConstraints
())],
hBonds_water
+
hAngles_water
+
allBonds_methanol
)
system
=
psf
.
createSystem
(
params
,
constraints
=
HAngles
,
rigidWater
=
False
)
assert
system
.
getNumConstraints
()
==
12
for
i
in
range
(
12
):
assert
system
.
getConstraintParameters
(
i
)[:
2
]
in
bH_water
+
aH_water
+
bH_methanol
+
bCO_methanol
+
aH_methanol
self
.
assertCountEqual
([
system
.
getConstraintParameters
(
i
)[:
2
]
for
i
in
range
(
system
.
getNumConstraints
())],
hBonds_water
+
hAngles_water
+
allBonds_methanol
+
hAngles_methanol
)
system
=
psf
.
createSystem
(
params
,
constraints
=
HAngles
,
rigidWater
=
True
)
assert
system
.
getNumConstraints
()
==
12
for
i
in
range
(
12
):
assert
system
.
getConstraintParameters
(
i
)[:
2
]
in
bH_water
+
aH_water
+
bH_methanol
+
bCO_methanol
+
aH_methanol
self
.
assertCountEqual
([
system
.
getConstraintParameters
(
i
)[:
2
]
for
i
in
range
(
system
.
getNumConstraints
())],
hBonds_water
+
hAngles_water
+
allBonds_methanol
+
hAngles_methanol
)
if
__name__
==
'__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