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
48f9a1e1
"wrappers/python/vscode:/vscode.git/clone" did not exist on "b8e5b36b7925d05fc5e6dad0bcfa15c0d5e64fc5"
Unverified
Commit
48f9a1e1
authored
Nov 18, 2021
by
Peter Eastman
Committed by
GitHub
Nov 18, 2021
Browse files
Fixed error in computing charges for Gromacs implicit solvent (#3337)
parent
f9a2fc6b
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
2 deletions
+7
-2
wrappers/python/openmm/app/gromacstopfile.py
wrappers/python/openmm/app/gromacstopfile.py
+3
-2
wrappers/python/tests/TestGromacsTopFile.py
wrappers/python/tests/TestGromacsTopFile.py
+4
-0
No files found.
wrappers/python/openmm/app/gromacstopfile.py
View file @
48f9a1e1
...
@@ -614,7 +614,9 @@ class GromacsTopFile(object):
...
@@ -614,7 +614,9 @@ class GromacsTopFile(object):
passed for the constraints argument
passed for the constraints argument
implicitSolvent : object=None
implicitSolvent : object=None
If not None, the implicit solvent model to use. The only allowed
If not None, the implicit solvent model to use. The only allowed
value is OBC2.
value is OBC2. This option is deprecated, since Gromacs 2019 and later
no longer support implicit solvent. It will be removed in a future
release.
soluteDielectric : float=1.0
soluteDielectric : float=1.0
The solute dielectric constant to use in the implicit solvent model.
The solute dielectric constant to use in the implicit solvent model.
solventDielectric : float=78.5
solventDielectric : float=78.5
...
@@ -934,7 +936,6 @@ class GromacsTopFile(object):
...
@@ -934,7 +936,6 @@ class GromacsTopFile(object):
epsilon
=
float
(
params
[
7
])
epsilon
=
float
(
params
[
7
])
lj
.
addParticle
([
math
.
sqrt
(
4
*
epsilon
*
sigma
**
6
),
math
.
sqrt
(
4
*
epsilon
*
sigma
**
12
)])
lj
.
addParticle
([
math
.
sqrt
(
4
*
epsilon
*
sigma
**
6
),
math
.
sqrt
(
4
*
epsilon
*
sigma
**
12
)])
for
fields
in
moleculeType
.
atoms
:
if
implicitSolvent
is
OBC2
:
if
implicitSolvent
is
OBC2
:
if
fields
[
1
]
not
in
self
.
_implicitTypes
:
if
fields
[
1
]
not
in
self
.
_implicitTypes
:
raise
ValueError
(
'No implicit solvent parameters specified for atom type: '
+
fields
[
1
])
raise
ValueError
(
'No implicit solvent parameters specified for atom type: '
+
fields
[
1
])
...
...
wrappers/python/tests/TestGromacsTopFile.py
View file @
48f9a1e1
...
@@ -161,10 +161,14 @@ class TestGromacsTopFile(unittest.TestCase):
...
@@ -161,10 +161,14 @@ class TestGromacsTopFile(unittest.TestCase):
found_matching_solvent_dielectric
=
True
found_matching_solvent_dielectric
=
True
if
force
.
getSoluteDielectric
()
==
0.9
:
if
force
.
getSoluteDielectric
()
==
0.9
:
found_matching_solute_dielectric
=
True
found_matching_solute_dielectric
=
True
gbcharges
=
[
force
.
getParticleParameters
(
i
)[
0
]
for
i
in
range
(
system
.
getNumParticles
())]
if
isinstance
(
force
,
NonbondedForce
):
if
isinstance
(
force
,
NonbondedForce
):
self
.
assertEqual
(
force
.
getReactionFieldDielectric
(),
1.0
)
self
.
assertEqual
(
force
.
getReactionFieldDielectric
(),
1.0
)
nbcharges
=
[
force
.
getParticleParameters
(
i
)[
0
]
for
i
in
range
(
system
.
getNumParticles
())]
self
.
assertTrue
(
found_matching_solvent_dielectric
and
self
.
assertTrue
(
found_matching_solvent_dielectric
and
found_matching_solute_dielectric
)
found_matching_solute_dielectric
)
for
q1
,
q2
in
zip
(
gbcharges
,
nbcharges
):
self
.
assertEqual
(
q1
,
q2
)
def
test_HydrogenMass
(
self
):
def
test_HydrogenMass
(
self
):
"""Test that altering the mass of hydrogens works correctly."""
"""Test that altering the mass of hydrogens works correctly."""
...
...
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