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
72c70cfe
Unverified
Commit
72c70cfe
authored
Mar 17, 2021
by
Andy Simmonett
Committed by
GitHub
Mar 17, 2021
Browse files
Fix PSF setBox function for Triclinic case (#3072)
parent
07b7d2d3
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
2 deletions
+32
-2
wrappers/python/openmm/app/charmmpsffile.py
wrappers/python/openmm/app/charmmpsffile.py
+1
-1
wrappers/python/tests/TestCharmmFiles.py
wrappers/python/tests/TestCharmmFiles.py
+31
-1
No files found.
wrappers/python/openmm/app/charmmpsffile.py
View file @
72c70cfe
...
@@ -786,7 +786,7 @@ class CharmmPsfFile(object):
...
@@ -786,7 +786,7 @@ class CharmmPsfFile(object):
# Add the periodic box if there is one
# Add the periodic box if there is one
if
self
.
box_vectors
is
not
None
:
if
self
.
box_vectors
is
not
None
:
topology
.
set
UnitCellDimension
s
(
self
.
box
Length
s
)
topology
.
set
PeriodicBoxVector
s
(
self
.
box
_vector
s
)
return
topology
return
topology
...
...
wrappers/python/tests/TestCharmmFiles.py
View file @
72c70cfe
...
@@ -170,6 +170,36 @@ class TestCharmmFiles(unittest.TestCase):
...
@@ -170,6 +170,36 @@ class TestCharmmFiles(unittest.TestCase):
ene
=
state
.
getPotentialEnergy
().
value_in_unit
(
kilocalories_per_mole
)
ene
=
state
.
getPotentialEnergy
().
value_in_unit
(
kilocalories_per_mole
)
self
.
assertAlmostEqual
(
ene
,
-
292.73015
,
delta
=
1.0
)
self
.
assertAlmostEqual
(
ene
,
-
292.73015
,
delta
=
1.0
)
def
test_PSFSetUnitCellDimensions
(
self
):
"""Test that setting the box via unit cell dimensions works correctly."""
psf
=
CharmmPsfFile
(
'systems/ala3_solv_drude.psf'
)
# Orthorhombic
psf
.
setBox
(
2.1
*
nanometer
,
2.3
*
nanometer
,
2.4
*
nanometer
)
pbv1
=
psf
.
topology
.
getPeriodicBoxVectors
()
self
.
assertAlmostEqual
(
pbv1
[
0
][
0
]
/
nanometers
,
2.1
)
self
.
assertAlmostEqual
(
pbv1
[
0
][
1
]
/
nanometers
,
0.0
)
self
.
assertAlmostEqual
(
pbv1
[
0
][
2
]
/
nanometers
,
0.0
)
self
.
assertAlmostEqual
(
pbv1
[
1
][
0
]
/
nanometers
,
0.0
)
self
.
assertAlmostEqual
(
pbv1
[
1
][
1
]
/
nanometers
,
2.3
)
self
.
assertAlmostEqual
(
pbv1
[
1
][
2
]
/
nanometers
,
0.0
)
self
.
assertAlmostEqual
(
pbv1
[
2
][
0
]
/
nanometers
,
0.0
)
self
.
assertAlmostEqual
(
pbv1
[
2
][
1
]
/
nanometers
,
0.0
)
self
.
assertAlmostEqual
(
pbv1
[
2
][
2
]
/
nanometers
,
2.4
)
# Triclinic
psf
.
setBox
(
2.1
*
nanometer
,
2.3
*
nanometer
,
2.4
*
nanometer
,
65
*
degrees
,
75
*
degrees
,
85
*
degrees
)
pbv2
=
psf
.
topology
.
getPeriodicBoxVectors
()
self
.
assertAlmostEqual
(
pbv2
[
0
][
0
]
/
nanometers
,
2.1
)
self
.
assertAlmostEqual
(
pbv2
[
0
][
1
]
/
nanometers
,
0.0
)
self
.
assertAlmostEqual
(
pbv2
[
0
][
2
]
/
nanometers
,
0.0
)
self
.
assertAlmostEqual
(
pbv2
[
1
][
0
]
/
nanometers
,
0.20045820831961367
)
self
.
assertAlmostEqual
(
pbv2
[
1
][
1
]
/
nanometers
,
2.2912478056110146
)
self
.
assertAlmostEqual
(
pbv2
[
1
][
2
]
/
nanometers
,
0.0
)
self
.
assertAlmostEqual
(
pbv2
[
2
][
0
]
/
nanometers
,
0.6211657082460498
)
self
.
assertAlmostEqual
(
pbv2
[
2
][
1
]
/
nanometers
,
0.963813269981581
)
self
.
assertAlmostEqual
(
pbv2
[
2
][
2
]
/
nanometers
,
2.1083683604879377
)
def
test_Drude
(
self
):
def
test_Drude
(
self
):
"""Test CHARMM systems with Drude force field"""
"""Test CHARMM systems with Drude force field"""
warnings
.
filterwarnings
(
'ignore'
,
category
=
CharmmPSFWarning
)
warnings
.
filterwarnings
(
'ignore'
,
category
=
CharmmPSFWarning
)
...
...
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