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
03e33772
Commit
03e33772
authored
May 31, 2016
by
ChayaSt
Browse files
using sigma instead of rmin
parent
73183c61
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
10 deletions
+10
-10
wrappers/python/simtk/openmm/app/forcefield.py
wrappers/python/simtk/openmm/app/forcefield.py
+9
-9
wrappers/python/tests/TestForceField.py
wrappers/python/tests/TestForceField.py
+1
-1
No files found.
wrappers/python/simtk/openmm/app/forcefield.py
View file @
03e33772
...
@@ -1759,10 +1759,10 @@ class LennardJonesGenerator(object):
...
@@ -1759,10 +1759,10 @@ class LennardJonesGenerator(object):
if
None
not
in
types
:
if
None
not
in
types
:
type1
=
types
[
0
][
0
]
type1
=
types
[
0
][
0
]
type2
=
types
[
1
][
0
]
type2
=
types
[
1
][
0
]
e
mi
n
=
_convertParameterToNumber
(
parameters
[
'e
mi
n'
])
e
psilo
n
=
_convertParameterToNumber
(
parameters
[
'e
psilo
n'
])
rmin
=
_convertParameterToNumber
(
parameters
[
'
rmin
'
])
sigma
=
_convertParameterToNumber
(
parameters
[
'
sigma
'
])
self
.
nbfix_types
[(
type1
,
type2
)]
=
[
emin
,
rmi
n
]
self
.
nbfix_types
[(
type1
,
type2
)]
=
[
sigma
,
epsilo
n
]
self
.
nbfix_types
[(
type2
,
type1
)]
=
[
emin
,
rmi
n
]
self
.
nbfix_types
[(
type2
,
type1
)]
=
[
sigma
,
epsilo
n
]
def
registerLennardJones
(
self
,
parameters
):
def
registerLennardJones
(
self
,
parameters
):
self
.
lj_types
.
registerAtom
(
parameters
)
self
.
lj_types
.
registerAtom
(
parameters
)
...
@@ -1817,20 +1817,20 @@ class LennardJonesGenerator(object):
...
@@ -1817,20 +1817,20 @@ class LennardJonesGenerator(object):
for
n
in
range
(
num_lj_types
):
for
n
in
range
(
num_lj_types
):
pair
=
(
lj_type_list
[
m
],
lj_type_list
[
n
])
pair
=
(
lj_type_list
[
m
],
lj_type_list
[
n
])
if
pair
in
self
.
nbfix_types
:
if
pair
in
self
.
nbfix_types
:
wdij
=
self
.
nbfix_types
[
pair
][
0
]
wdij
=
self
.
nbfix_types
[
pair
][
1
]
rij
=
self
.
nbfix_types
[
pair
][
1
]
rij
=
self
.
nbfix_types
[
pair
][
0
]
*
2
**
(
1.0
/
6
)
/
2
rij6
=
rij
**
6
rij6
=
rij
**
6
acoef
[
m
+
num_lj_types
*
n
]
=
math
.
sqrt
(
wdij
)
*
rij6
acoef
[
m
+
num_lj_types
*
n
]
=
wdij
*
rij6
**
2
bcoef
[
m
+
num_lj_types
*
n
]
=
2
*
wdij
*
rij6
bcoef
[
m
+
num_lj_types
*
n
]
=
2
*
wdij
*
rij6
continue
continue
else
:
else
:
rij
=
(
reverse_map
[
m
][
0
]
+
reverse_map
[
n
][
0
])
*
2
**
(
1.0
/
6
)
/
2
rij
=
(
reverse_map
[
m
][
0
]
+
reverse_map
[
n
][
0
])
*
2
**
(
1.0
/
6
)
/
2
rij6
=
rij
**
6
rij6
=
rij
**
6
wdij
=
math
.
sqrt
(
reverse_map
[
m
][
-
1
]
*
reverse_map
[
n
][
-
1
])
wdij
=
math
.
sqrt
(
reverse_map
[
m
][
-
1
]
*
reverse_map
[
n
][
-
1
])
acoef
[
m
+
num_lj_types
*
n
]
=
math
.
sqrt
(
wdij
)
*
rij6
acoef
[
m
+
num_lj_types
*
n
]
=
wdij
*
rij6
**
2
bcoef
[
m
+
num_lj_types
*
n
]
=
2
*
wdij
*
rij6
bcoef
[
m
+
num_lj_types
*
n
]
=
2
*
wdij
*
rij6
self
.
force
=
mm
.
CustomNonbondedForce
(
'a
^2
/r^12-b/r6;
r6=r2*r2*r2; r2=r^2;
'
self
.
force
=
mm
.
CustomNonbondedForce
(
'a/r^12-b/r
^
6;'
'a=acoef(type1, type2);'
'a=acoef(type1, type2);'
'b=bcoef(type1, type2)'
)
'b=bcoef(type1, type2)'
)
self
.
force
.
addTabulatedFunction
(
'acoef'
,
self
.
force
.
addTabulatedFunction
(
'acoef'
,
...
...
wrappers/python/tests/TestForceField.py
View file @
03e33772
...
@@ -759,7 +759,7 @@ class AmoebaTestForceField(unittest.TestCase):
...
@@ -759,7 +759,7 @@ class AmoebaTestForceField(unittest.TestCase):
<LennardJonesForce lj14scale="1.0">
<LennardJonesForce lj14scale="1.0">
<Atom type="CLA" sigma="0.404468018036" epsilon="0.6276"/>
<Atom type="CLA" sigma="0.404468018036" epsilon="0.6276"/>
<Atom type="SOD" sigma="0.251367073323" epsilon="0.1962296"/>
<Atom type="SOD" sigma="0.251367073323" epsilon="0.1962296"/>
<NBFixPair type1="CLA" type2="SOD"
emin="0.350933" rmi
n="0.3
731
"/>
<NBFixPair type1="CLA" type2="SOD"
sigma="0.664788623476" epsilo
n="0.3
50933
"/>
</LennardJonesForce>
</LennardJonesForce>
</ForceField> """
</ForceField> """
ff
=
ForceField
(
StringIO
(
xml
))
ff
=
ForceField
(
StringIO
(
xml
))
...
...
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