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
30cd2c16
Commit
30cd2c16
authored
Mar 11, 2016
by
ChayaSt
Browse files
added scaled 1-4 LJ as customBondForce
parent
0e05f63b
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
9 deletions
+5
-9
wrappers/python/simtk/openmm/app/forcefield.py
wrappers/python/simtk/openmm/app/forcefield.py
+5
-9
No files found.
wrappers/python/simtk/openmm/app/forcefield.py
View file @
30cd2c16
...
...
@@ -1801,15 +1801,13 @@ class LennardJonesGenerator(object):
self
.
force
.
setCutoffDistance
(
nonbondedCutoff
)
# Create customBondForce for the 1-4 scaled L-J interactions
lj14ScaleForce
=
mm
.
CustomBondForce
(
'(a/r6)^2-b/r
6
; r6=r2*r2*r2; r2=r^2;
'
lj14ScaleForce
=
mm
.
CustomBondForce
(
'(a/r
^
6)^2-
(
b/r
^6)
; r6=r2*r2*r2; r2=r^2;'
'a=acoef;'
'b=bcoef;'
)
lj14ScaleForce
.
addGlobalParameter
(
'lj14scale'
,
self
.
lj14scale
)
lj14ScaleForce
.
addPerBondParameter
(
'ac
e
of'
)
lj14ScaleForce
.
addPerBondParameter
(
'aco
e
f'
)
lj14ScaleForce
.
addPerBondParameter
(
'bcoef'
)
lj14Pairs
=
[]
#acoefScaled = []
#bcoefScaled = []
# Add bonds for 1-4 scaled L-J from dihedrals
for
torsion
in
data
.
propers
:
...
...
@@ -1817,13 +1815,11 @@ class LennardJonesGenerator(object):
for
lj14Pair
in
lj14Pairs
:
i
=
lj_indx_list
[
lj14Pair
[
0
]]
-
1
j
=
lj_indx_list
[
lj14Pair
[
1
]]
-
1
rij
=
(
lj_radii
[
i
]
+
lj_radii
[
j
])
rij6
=
rij
**
6
wdij14
=
self
.
lj14scale
*
(
lj_depths
[
i
]
*
lj_depths
[
j
])
r
min
ij
=
(
lj_radii
[
i
]
+
lj_radii
[
j
])
rij6
=
r
min
ij
**
6
wdij14
=
self
.
lj14scale
*
math
.
sqrt
(
lj_depths
[
i
]
*
lj_depths
[
j
])
acoefScaled
=
(
math
.
sqrt
(
wdij14
)
*
rij6
)
bcoefScaled
=
(
2
*
wdij14
*
rij6
)
#acoefScaled.append(math.sqrt(wdij14)*rij6)
#bcoefScaled.append(2*wdij14*rij6)
lj14ScaleForce
.
addBond
(
lj14Pair
[
0
],
lj14Pair
[
1
],
[
acoefScaled
,
bcoefScaled
])
sys
.
addForce
(
self
.
force
)
...
...
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