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
097c5b75
Unverified
Commit
097c5b75
authored
Jun 02, 2022
by
Peter Eastman
Committed by
GitHub
Jun 02, 2022
Browse files
Support multiple XML files with AMOEBA GK (#3625)
parent
c47fc7ce
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
14 deletions
+26
-14
wrappers/python/openmm/app/forcefield.py
wrappers/python/openmm/app/forcefield.py
+26
-14
No files found.
wrappers/python/openmm/app/forcefield.py
View file @
097c5b75
...
@@ -5518,16 +5518,21 @@ class AmoebaWcaDispersionGenerator(object):
...
@@ -5518,16 +5518,21 @@ class AmoebaWcaDispersionGenerator(object):
# <WcaDispersion class="1" radius="0.1855" epsilon="0.46024" />
# <WcaDispersion class="1" radius="0.1855" epsilon="0.46024" />
# <WcaDispersion class="2" radius="0.191" epsilon="0.422584" />
# <WcaDispersion class="2" radius="0.191" epsilon="0.422584" />
generator
=
AmoebaWcaDispersionGenerator
(
element
.
attrib
[
'epso'
],
existing
=
[
f
for
f
in
forceField
.
_forces
if
isinstance
(
f
,
AmoebaWcaDispersionGenerator
)]
element
.
attrib
[
'epsh'
],
if
len
(
existing
)
==
0
:
element
.
attrib
[
'rmino'
],
generator
=
AmoebaWcaDispersionGenerator
(
element
.
attrib
[
'epso'
],
element
.
attrib
[
'rminh'
],
element
.
attrib
[
'epsh'
],
element
.
attrib
[
'awater'
],
element
.
attrib
[
'rmino'
],
element
.
attrib
[
'slevy'
],
element
.
attrib
[
'rminh'
],
element
.
attrib
[
'dispoff'
],
element
.
attrib
[
'awater'
],
element
.
attrib
[
'shctd'
])
element
.
attrib
[
'slevy'
],
forceField
.
_forces
.
append
(
generator
)
element
.
attrib
[
'dispoff'
],
generator
.
params
=
ForceField
.
_AtomTypeParameters
(
forceField
,
'AmoebaWcaDispersionForce'
,
'WcaDispersion'
,
(
'radius'
,
'epsilon'
))
element
.
attrib
[
'shctd'
])
forceField
.
registerGenerator
(
generator
)
generator
.
params
=
ForceField
.
_AtomTypeParameters
(
forceField
,
'AmoebaWcaDispersionForce'
,
'WcaDispersion'
,
(
'radius'
,
'epsilon'
))
else
:
# Multiple <AmoebaWcaDispersionForce> tags were found, probably in different files. Simply add more types to the existing one.
generator
=
existing
[
0
]
generator
.
params
.
parseDefinitions
(
element
)
generator
.
params
.
parseDefinitions
(
element
)
#=========================================================================================
#=========================================================================================
...
@@ -5750,10 +5755,17 @@ class AmoebaGeneralizedKirkwoodGenerator(object):
...
@@ -5750,10 +5755,17 @@ class AmoebaGeneralizedKirkwoodGenerator(object):
# <GeneralizedKirkwood type="1" charge="-0.22620" shct="0.79" />
# <GeneralizedKirkwood type="1" charge="-0.22620" shct="0.79" />
# <GeneralizedKirkwood type="2" charge="-0.15245" shct="0.72" />
# <GeneralizedKirkwood type="2" charge="-0.15245" shct="0.72" />
generator
=
AmoebaGeneralizedKirkwoodGenerator
(
forceField
,
element
.
attrib
[
'solventDielectric'
],
element
.
attrib
[
'soluteDielectric'
],
existing
=
[
f
for
f
in
forceField
.
_forces
if
isinstance
(
f
,
AmoebaGeneralizedKirkwoodGenerator
)]
element
.
attrib
[
'includeCavityTerm'
],
if
len
(
existing
)
==
0
:
element
.
attrib
[
'probeRadius'
],
element
.
attrib
[
'surfaceAreaFactor'
])
generator
=
AmoebaGeneralizedKirkwoodGenerator
(
forceField
,
element
.
attrib
[
'solventDielectric'
],
forceField
.
_forces
.
append
(
generator
)
element
.
attrib
[
'soluteDielectric'
],
element
.
attrib
[
'includeCavityTerm'
],
element
.
attrib
[
'probeRadius'
],
element
.
attrib
[
'surfaceAreaFactor'
])
forceField
.
registerGenerator
(
generator
)
else
:
# Multiple <AmoebaGeneralizedKirkwoodFprce> tags were found, probably in different files. Simply add more types to the existing one.
generator
=
existing
[
0
]
#=========================================================================================
#=========================================================================================
...
...
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