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
47d07e44
"openmmapi/vscode:/vscode.git/clone" did not exist on "3250fb437d7b9481db09f52392d72ffb9cd04e46"
Commit
47d07e44
authored
Mar 27, 2014
by
peastman
Browse files
Fixed some bugs in addExtraParticles() that affect the CHARMM polarizable force field
parent
24cb7109
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
2 deletions
+5
-2
wrappers/python/simtk/openmm/app/modeller.py
wrappers/python/simtk/openmm/app/modeller.py
+5
-2
No files found.
wrappers/python/simtk/openmm/app/modeller.py
View file @
47d07e44
...
@@ -39,6 +39,7 @@ from simtk.openmm.app.topology import Residue
...
@@ -39,6 +39,7 @@ from simtk.openmm.app.topology import Residue
from
simtk.openmm.vec3
import
Vec3
from
simtk.openmm.vec3
import
Vec3
from
simtk.openmm
import
System
,
Context
,
NonbondedForce
,
CustomNonbondedForce
,
HarmonicBondForce
,
HarmonicAngleForce
,
VerletIntegrator
,
LocalEnergyMinimizer
from
simtk.openmm
import
System
,
Context
,
NonbondedForce
,
CustomNonbondedForce
,
HarmonicBondForce
,
HarmonicAngleForce
,
VerletIntegrator
,
LocalEnergyMinimizer
from
simtk.unit
import
nanometer
,
molar
,
elementary_charge
,
amu
,
gram
,
liter
,
degree
,
sqrt
,
acos
,
is_quantity
,
dot
,
norm
from
simtk.unit
import
nanometer
,
molar
,
elementary_charge
,
amu
,
gram
,
liter
,
degree
,
sqrt
,
acos
,
is_quantity
,
dot
,
norm
import
simtk.unit
as
unit
import
element
as
elem
import
element
as
elem
import
os
import
os
import
random
import
random
...
@@ -843,7 +844,9 @@ class Modeller(object):
...
@@ -843,7 +844,9 @@ class Modeller(object):
if
atom
.
element
is
not
None
:
if
atom
.
element
is
not
None
:
newIndex
[
i
]
=
index
newIndex
[
i
]
=
index
index
+=
1
index
+=
1
newTemplate
.
atoms
.
append
(
ForceField
.
_TemplateAtomData
(
atom
.
name
,
atom
.
type
,
atom
.
element
))
newAtom
=
ForceField
.
_TemplateAtomData
(
atom
.
name
,
atom
.
type
,
atom
.
element
)
newAtom
.
externalBonds
=
atom
.
externalBonds
newTemplate
.
atoms
.
append
(
newAtom
)
for
b1
,
b2
in
template
.
bonds
:
for
b1
,
b2
in
template
.
bonds
:
if
b1
in
newIndex
and
b2
in
newIndex
:
if
b1
in
newIndex
and
b2
in
newIndex
:
newTemplate
.
bonds
.
append
((
newIndex
[
b1
],
newIndex
[
b2
]))
newTemplate
.
bonds
.
append
((
newIndex
[
b1
],
newIndex
[
b2
]))
...
@@ -968,7 +971,7 @@ class Modeller(object):
...
@@ -968,7 +971,7 @@ class Modeller(object):
# and hope that energy minimization will fix it.
# and hope that energy minimization will fix it.
knownPositions
=
[
x
for
x
in
templateAtomPositions
if
x
is
not
None
]
knownPositions
=
[
x
for
x
in
templateAtomPositions
if
x
is
not
None
]
position
=
sum
(
knownPositions
)
/
len
(
knownPositions
)
position
=
unit
.
sum
(
knownPositions
)
/
len
(
knownPositions
)
newPositions
.
append
(
position
*
nanometer
)
newPositions
.
append
(
position
*
nanometer
)
for
bond
in
self
.
topology
.
bonds
():
for
bond
in
self
.
topology
.
bonds
():
if
bond
[
0
]
in
newAtoms
and
bond
[
1
]
in
newAtoms
:
if
bond
[
0
]
in
newAtoms
and
bond
[
1
]
in
newAtoms
:
...
...
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