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
cce1ca81
Commit
cce1ca81
authored
Jul 01, 2013
by
Yutong Zhao
Browse files
Merge pull request #33 from peastman/master
Disable reaction field when using implicit solvent
parents
d952c8ad
b63835e4
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
2 deletions
+17
-2
openmmapi/include/openmm/GBSAOBCForce.h
openmmapi/include/openmm/GBSAOBCForce.h
+8
-2
wrappers/python/simtk/openmm/app/forcefield.py
wrappers/python/simtk/openmm/app/forcefield.py
+7
-0
wrappers/python/simtk/openmm/app/gromacstopfile.py
wrappers/python/simtk/openmm/app/gromacstopfile.py
+1
-0
wrappers/python/simtk/openmm/app/internal/amber_file_parser.py
...ers/python/simtk/openmm/app/internal/amber_file_parser.py
+1
-0
No files found.
openmmapi/include/openmm/GBSAOBCForce.h
View file @
cce1ca81
...
@@ -40,13 +40,19 @@ namespace OpenMM {
...
@@ -40,13 +40,19 @@ namespace OpenMM {
/**
/**
* This class implements an implicit solvation force using the GBSA-OBC model.
* This class implements an implicit solvation force using the GBSA-OBC model.
*
<p>
*
* To use this class, create a GBSAOBCForce object, then call addParticle() once for each particle in the
* To use this class, create a GBSAOBCForce object, then call addParticle() once for each particle in the
* System to define its parameters. The number of particles for which you define GBSA parameters must
* System to define its parameters. The number of particles for which you define GBSA parameters must
* be exactly equal to the number of particles in the System, or else an exception will be thrown when you
* be exactly equal to the number of particles in the System, or else an exception will be thrown when you
* try to create a Context. After a particle has been added, you can modify its force field parameters
* try to create a Context. After a particle has been added, you can modify its force field parameters
* by calling setParticleParameters(). This will have no effect on Contexts that already exist unless you
* by calling setParticleParameters(). This will have no effect on Contexts that already exist unless you
* call updateParametersInContext().
* call updateParametersInContext().
*
* When using this Force, the System should also include a NonbondedForce, and both objects must specify
* identical charges for all particles. Otherwise, the results will not be correct. Furthermore, if the
* nonbonded method is set to CutoffNonPeriodic or CutoffPeriodic, you should call setReactionFieldDielectric(1.0)
* on the NonbondedForce to turn off the reaction field approximation, which does not produce correct results
* when combined with GBSA.
*/
*/
class
OPENMM_EXPORT
GBSAOBCForce
:
public
Force
{
class
OPENMM_EXPORT
GBSAOBCForce
:
public
Force
{
...
@@ -70,7 +76,7 @@ public:
...
@@ -70,7 +76,7 @@ public:
*/
*/
CutoffPeriodic
=
2
,
CutoffPeriodic
=
2
,
};
};
/*
/*
*
* Create a GBSAOBCForce.
* Create a GBSAOBCForce.
*/
*/
GBSAOBCForce
();
GBSAOBCForce
();
...
...
wrappers/python/simtk/openmm/app/forcefield.py
View file @
cce1ca81
...
@@ -1046,6 +1046,13 @@ class GBSAOBCGenerator:
...
@@ -1046,6 +1046,13 @@ class GBSAOBCGenerator:
force
.
setSolventDielectric
(
float
(
args
[
'solventDielectric'
]))
force
.
setSolventDielectric
(
float
(
args
[
'solventDielectric'
]))
sys
.
addForce
(
force
)
sys
.
addForce
(
force
)
def
postprocessSystem
(
self
,
sys
,
data
,
args
):
# Disable the reaction field approximation, since it produces bad results when combined with GB.
for
force
in
sys
.
getForces
():
if
isinstance
(
force
,
mm
.
NonbondedForce
):
force
.
setReactionFieldDielectric
(
1.0
)
parsers
[
"GBSAOBCForce"
]
=
GBSAOBCGenerator
.
parseElement
parsers
[
"GBSAOBCForce"
]
=
GBSAOBCGenerator
.
parseElement
...
...
wrappers/python/simtk/openmm/app/gromacstopfile.py
View file @
cce1ca81
...
@@ -448,6 +448,7 @@ class GromacsTopFile(object):
...
@@ -448,6 +448,7 @@ class GromacsTopFile(object):
gb
.
setSoluteDielectric
(
soluteDielectric
)
gb
.
setSoluteDielectric
(
soluteDielectric
)
gb
.
setSolventDielectric
(
solventDielectric
)
gb
.
setSolventDielectric
(
solventDielectric
)
sys
.
addForce
(
gb
)
sys
.
addForce
(
gb
)
nb
.
setReactionFieldDielectric
(
1.0
)
elif
implicitSolvent
is
not
None
:
elif
implicitSolvent
is
not
None
:
raise
ValueError
(
'Illegal value for implicitSolvent'
)
raise
ValueError
(
'Illegal value for implicitSolvent'
)
bonds
=
None
bonds
=
None
...
...
wrappers/python/simtk/openmm/app/internal/amber_file_parser.py
View file @
cce1ca81
...
@@ -824,6 +824,7 @@ def readAmberSystem(prmtop_filename=None, prmtop_loader=None, shake=None, gbmode
...
@@ -824,6 +824,7 @@ def readAmberSystem(prmtop_filename=None, prmtop_loader=None, shake=None, gbmode
gb
.
setCutoffDistance
(
nonbondedCutoff
)
gb
.
setCutoffDistance
(
nonbondedCutoff
)
else
:
else
:
raise
Exception
(
"Illegal nonbonded method for use with GBSA"
)
raise
Exception
(
"Illegal nonbonded method for use with GBSA"
)
force
.
setReactionFieldDielectric
(
1.0
)
# TODO: Add GBVI terms?
# TODO: Add GBVI terms?
...
...
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