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
4a27946c
Commit
4a27946c
authored
Dec 23, 2015
by
Jason Swails
Browse files
Fix parameter checking.
parent
0804c333
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
19 deletions
+3
-19
wrappers/python/simtk/openmm/app/internal/customgbforces.py
wrappers/python/simtk/openmm/app/internal/customgbforces.py
+3
-19
No files found.
wrappers/python/simtk/openmm/app/internal/customgbforces.py
View file @
4a27946c
...
...
@@ -328,7 +328,7 @@ class GBSAGBnForce(CustomGBForce):
def
addParticle
(
self
,
parameters
):
parameters
=
list
(
parameters
)
parameters
[
0
]
=
strip_unit
(
parameters
[
0
],
u
.
elementary_charge
)
parameters
[
1
]
=
strip_unit
(
parameters
[
0
],
u
.
nanometer
)
parameters
[
1
]
=
strip_unit
(
parameters
[
1
],
u
.
nanometer
)
if
parameters
[
1
]
<
0.1
or
parameters
[
1
]
>
0.2
:
raise
ValueError
(
'Radii must be between 1 and 2 Angstroms for neck lookup'
)
CustomGBForce
.
addParticle
(
self
,
parameters
)
...
...
@@ -336,7 +336,7 @@ class GBSAGBnForce(CustomGBForce):
def
setParticleParameters
(
self
,
idx
,
parameters
):
parameters
=
list
(
parameters
)
parameters
[
0
]
=
strip_unit
(
parameters
[
0
],
u
.
elementary_charge
)
parameters
[
1
]
=
strip_unit
(
parameters
[
0
],
u
.
nanometer
)
parameters
[
1
]
=
strip_unit
(
parameters
[
1
],
u
.
nanometer
)
if
parameters
[
1
]
<
0.1
or
parameters
[
1
]
>
0.2
:
raise
ValueError
(
'Radii must be between 1 and 2 Angstroms for neck lookup'
)
CustomGBForce
.
setParticleParameters
(
self
,
idx
,
parameters
)
...
...
@@ -344,7 +344,7 @@ class GBSAGBnForce(CustomGBForce):
"""
Amber Equivalents: igb = 8
"""
class
GBSAGBn2Force
(
Custom
GBForce
):
class
GBSAGBn2Force
(
GBSA
GB
n
Force
):
def
__init__
(
self
,
solventDielectric
=
78.5
,
soluteDielectric
=
1
,
SA
=
None
,
cutoff
=
None
,
kappa
=
0.0
):
...
...
@@ -374,22 +374,6 @@ class GBSAGBn2Force(CustomGBForce):
"psi=I*or; radius=or+offset; offset=0.0195141"
,
CustomGBForce
.
SingleParticle
)
_createEnergyTerms
(
self
,
solventDielectric
,
soluteDielectric
,
SA
,
cutoff
,
kappa
,
0.0195141
)
def
addParticle
(
self
,
parameters
):
parameters
=
list
(
parameters
)
parameters
[
0
]
=
strip_unit
(
parameters
[
0
],
u
.
elementary_charge
)
parameters
[
1
]
=
strip_unit
(
parameters
[
0
],
u
.
nanometer
)
if
parameters
[
1
]
<
0.1
or
parameters
[
1
]
>
0.2
:
raise
ValueError
(
'Radii must be between 1 and 2 Angstroms for neck lookup'
)
CustomGBForce
.
addParticle
(
self
,
parameters
)
def
setParticleParameters
(
self
,
idx
,
parameters
):
parameters
=
list
(
parameters
)
parameters
[
0
]
=
strip_unit
(
parameters
[
0
],
u
.
elementary_charge
)
parameters
[
1
]
=
strip_unit
(
parameters
[
0
],
u
.
nanometer
)
if
parameters
[
1
]
<
0.1
or
parameters
[
1
]
>
0.2
:
raise
ValueError
(
'Radii must be between 1 and 2 Angstroms for neck lookup'
)
CustomGBForce
.
setParticleParameters
(
self
,
idx
,
parameters
)
def
convertParameters
(
params
,
gbmodel
):
"""Convert the GB parameters from the file into the values expected by the appropriate CustomGBForce."""
if
gbmodel
==
'GBn2'
:
...
...
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