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
71de4b1b
Commit
71de4b1b
authored
Jan 14, 2016
by
peastman
Browse files
Merge pull request #1337 from peastman/extrapolated
AMOEBA extrapolated polarization
parents
83408400
49cbc791
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
4 deletions
+35
-4
plugins/amoeba/serialization/src/AmoebaMultipoleForceProxy.cpp
...ns/amoeba/serialization/src/AmoebaMultipoleForceProxy.cpp
+24
-4
plugins/amoeba/serialization/tests/TestSerializeAmoebaMultipoleForce.cpp
...serialization/tests/TestSerializeAmoebaMultipoleForce.cpp
+8
-0
wrappers/python/simtk/openmm/app/forcefield.py
wrappers/python/simtk/openmm/app/forcefield.py
+2
-0
wrappers/python/src/swig_doxygen/swigInputConfig.py
wrappers/python/src/swig_doxygen/swigInputConfig.py
+1
-0
No files found.
plugins/amoeba/serialization/src/AmoebaMultipoleForceProxy.cpp
View file @
71de4b1b
...
...
@@ -68,7 +68,7 @@ void loadCovalentMap(const SerializationNode& map, std::vector< int >& covalentM
}
void
AmoebaMultipoleForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
2
);
node
.
setIntProperty
(
"version"
,
3
);
const
AmoebaMultipoleForce
&
force
=
*
reinterpret_cast
<
const
AmoebaMultipoleForce
*>
(
object
);
node
.
setIntProperty
(
"nonbondedMethod"
,
force
.
getNonbondedMethod
());
...
...
@@ -87,6 +87,14 @@ void AmoebaMultipoleForceProxy::serialize(const void* object, SerializationNode&
force
.
getPmeGridDimensions
(
gridDimensions
);
SerializationNode
&
gridDimensionsNode
=
node
.
createChildNode
(
"MultipoleParticleGridDimension"
);
gridDimensionsNode
.
setIntProperty
(
"d0"
,
gridDimensions
[
0
]).
setIntProperty
(
"d1"
,
gridDimensions
[
1
]).
setIntProperty
(
"d2"
,
gridDimensions
[
2
]);
SerializationNode
&
coefficients
=
node
.
createChildNode
(
"ExtrapolationCoefficients"
);
vector
<
double
>
coeff
=
force
.
getExtrapolationCoefficients
();
for
(
int
i
=
0
;
i
<
coeff
.
size
();
i
++
)
{
stringstream
key
;
key
<<
"c"
<<
i
;
coefficients
.
setDoubleProperty
(
key
.
str
(),
coeff
[
i
]);
}
std
::
vector
<
std
::
string
>
covalentTypes
;
getCovalentTypes
(
covalentTypes
);
...
...
@@ -124,16 +132,16 @@ void AmoebaMultipoleForceProxy::serialize(const void* object, SerializationNode&
}
void
*
AmoebaMultipoleForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
if
(
node
.
getIntProperty
(
"version"
)
>
2
)
int
version
=
node
.
getIntProperty
(
"version"
);
if
(
version
<
0
||
version
>
3
)
throw
OpenMMException
(
"Unsupported version number"
);
AmoebaMultipoleForce
*
force
=
new
AmoebaMultipoleForce
();
try
{
force
->
setNonbondedMethod
(
static_cast
<
AmoebaMultipoleForce
::
NonbondedMethod
>
(
node
.
getIntProperty
(
"nonbondedMethod"
)));
if
(
node
.
getIntProperty
(
"
version
"
)
=
=
2
)
{
if
(
version
>
=
2
)
force
->
setPolarizationType
(
static_cast
<
AmoebaMultipoleForce
::
PolarizationType
>
(
node
.
getIntProperty
(
"polarizationType"
)));
}
//force->setPmeBSplineOrder(node.getIntProperty("pmeBSplineOrder"));
//force->setMutualInducedIterationMethod(static_cast<AmoebaMultipoleForce::MutualInducedIterationMethod>(node.getIntProperty("mutualInducedIterationMethod")));
force
->
setMutualInducedMaxIterations
(
node
.
getIntProperty
(
"mutualInducedMaxIterations"
));
...
...
@@ -151,6 +159,18 @@ void* AmoebaMultipoleForceProxy::deserialize(const SerializationNode& node) cons
gridDimensions
.
push_back
(
gridDimensionsNode
.
getIntProperty
(
"d2"
));
force
->
setPmeGridDimensions
(
gridDimensions
);
if
(
version
>=
3
)
{
const
SerializationNode
&
coefficients
=
node
.
getChildNode
(
"ExtrapolationCoefficients"
);
vector
<
double
>
coeff
;
for
(
int
i
=
0
;
;
i
++
)
{
stringstream
key
;
key
<<
"c"
<<
i
;
if
(
coefficients
.
getProperties
().
find
(
key
.
str
())
==
coefficients
.
getProperties
().
end
())
break
;
coeff
.
push_back
(
coefficients
.
getDoubleProperty
(
key
.
str
()));
}
force
->
setExtrapolationCoefficients
(
coeff
);
}
std
::
vector
<
std
::
string
>
covalentTypes
;
getCovalentTypes
(
covalentTypes
);
...
...
plugins/amoeba/serialization/tests/TestSerializeAmoebaMultipoleForce.cpp
View file @
71de4b1b
...
...
@@ -74,6 +74,12 @@ void testSerialization() {
force1
.
setMutualInducedTargetEpsilon
(
1.0e-05
);
//force1.setElectricConstant(138.93);
force1
.
setEwaldErrorTolerance
(
1.0e-05
);
vector
<
double
>
coeff
;
coeff
.
push_back
(
0.0
);
coeff
.
push_back
(
-
0.1
);
coeff
.
push_back
(
1.1
);
force1
.
setExtrapolationCoefficients
(
coeff
);
std
::
vector
<
std
::
string
>
covalentTypes
;
getCovalentTypes
(
covalentTypes
);
...
...
@@ -125,6 +131,8 @@ void testSerialization() {
ASSERT_EQUAL
(
gridDimension1
[
jj
],
gridDimension2
[
jj
]);
}
ASSERT_EQUAL_CONTAINERS
(
force1
.
getExtrapolationCoefficients
(),
force2
.
getExtrapolationCoefficients
());
ASSERT_EQUAL
(
force1
.
getNumMultipoles
(),
force2
.
getNumMultipoles
());
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force1
.
getNumMultipoles
());
ii
++
)
{
...
...
wrappers/python/simtk/openmm/app/forcefield.py
View file @
71de4b1b
...
...
@@ -3760,6 +3760,8 @@ class AmoebaMultipoleGenerator:
polarizationType
=
args
[
'polarization'
]
if
(
polarizationType
.
lower
()
==
'direct'
):
force
.
setPolarizationType
(
mm
.
AmoebaMultipoleForce
.
Direct
)
elif
(
polarizationType
.
lower
()
==
'extrapolated'
):
force
.
setPolarizationType
(
mm
.
AmoebaMultipoleForce
.
Extrapolated
)
else
:
force
.
setPolarizationType
(
mm
.
AmoebaMultipoleForce
.
Mutual
)
...
...
wrappers/python/src/swig_doxygen/swigInputConfig.py
View file @
71de4b1b
...
...
@@ -247,6 +247,7 @@ UNITS = {
(
"AmoebaMultipoleForce"
,
"getPmeBSplineOrder"
)
:
(
None
,()),
(
"AmoebaMultipoleForce"
,
"getMutualInducedMaxIterations"
)
:
(
None
,
()),
(
"AmoebaMultipoleForce"
,
"getMutualInducedTargetEpsilon"
)
:
(
None
,
()),
(
"AmoebaMultipoleForce"
,
"getExtrapolationCoefficients"
)
:
(
None
,
()),
(
"AmoebaMultipoleForce"
,
"getEwaldErrorTolerance"
)
:
(
None
,
()),
(
"AmoebaMultipoleForce"
,
"getPmeGridDimensions"
)
:
(
None
,()),
...
...
Prev
1
2
Next
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