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
234425d1
Commit
234425d1
authored
Jul 12, 2018
by
huangj
Browse files
Finish implementing charmm parser for systems with lonepairs and/or with Drude particles.
parent
00e88bff
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
18 deletions
+26
-18
wrappers/python/simtk/openmm/app/charmmparameterset.py
wrappers/python/simtk/openmm/app/charmmparameterset.py
+16
-15
wrappers/python/simtk/openmm/app/charmmpsffile.py
wrappers/python/simtk/openmm/app/charmmpsffile.py
+10
-3
No files found.
wrappers/python/simtk/openmm/app/charmmparameterset.py
View file @
234425d1
...
...
@@ -12,7 +12,7 @@ the ParmEd program and was ported for use with OpenMM.
Copyright (c) 2014 the Authors
Author: Jason M. Swails
Contributors:
Contributors:
Jing Huang
Date: Sep. 17, 2014
Permission is hereby granted, free of charge, to any person obtaining a
...
...
@@ -497,6 +497,7 @@ class CharmmParameterSet(object):
except
IndexError
:
raise
CharmmFileError
(
'Could not parse NBFIX terms.'
)
self
.
nbfix_types
[(
min
(
at1
,
at2
),
max
(
at1
,
at2
))]
=
(
emin
,
rmin
)
continue
# Here parse the possible nbthole section
if
section
==
'NBTHOLE'
:
words
=
line
.
split
()
...
...
wrappers/python/simtk/openmm/app/charmmpsffile.py
View file @
234425d1
...
...
@@ -869,6 +869,13 @@ class CharmmPsfFile(object):
raise
StopIteration
except
StopIteration
:
pass
# test if the system containing the Drude particles
has_drude_particle
=
False
try
:
if
self
.
drudeconsts_list
:
has_drude_particle
=
True
except
AttributeError
:
pass
# Set up the constraints
if
verbose
and
(
constraints
is
not
None
and
not
rigidWater
):
...
...
@@ -1219,7 +1226,7 @@ class CharmmPsfFile(object):
cforce
.
addParticle
((
i
-
1
,))
# adjust for indexing from 0
# Add NBTHOLE terms
if
IsDrudePSF
and
has_nbthole_terms
:
if
has_drude_particle
and
has_nbthole_terms
:
nbt_idx_list
=
[
0
for
atom
in
self
.
atom_list
]
nbt_alpha_list
=
[
0
for
atom
in
self
.
atom_list
]
# only save alpha for NBThole pairs
num_nbt_types
=
0
...
...
@@ -1314,7 +1321,7 @@ class CharmmPsfFile(object):
idxa
=
lpsite
[
0
]
parent_exclude_list
[
idx
].
append
(
idxa
)
force
.
addException
(
idx
,
idxa
,
0.0
,
0.1
,
0.0
)
if
IsDrudePSF
:
if
has_drude_particle
:
for
pair
in
self
.
drudepair_list
:
idx
=
pair
[
0
]
idxa
=
pair
[
1
]
...
...
@@ -1346,7 +1353,7 @@ class CharmmPsfFile(object):
system
.
addForce
(
force
)
# Add Drude particles (Drude force)
if
IsDrudePSF
:
if
has_drude_particle
:
if
verbose
:
print
(
'Adding Drude force and Thole screening...'
)
drudeforce
=
mm
.
DrudeForce
()
drudeforce
.
setForceGroup
(
7
)
...
...
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