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
73183c61
Commit
73183c61
authored
May 31, 2016
by
ChayaSt
Browse files
resolved conflict
parents
0e218233
32e08b87
Changes
267
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
55 additions
and
23 deletions
+55
-23
plugins/amoeba/serialization/src/AmoebaStretchBendForceProxy.cpp
.../amoeba/serialization/src/AmoebaStretchBendForceProxy.cpp
+5
-2
plugins/amoeba/serialization/src/AmoebaTorsionTorsionForceProxy.cpp
...oeba/serialization/src/AmoebaTorsionTorsionForceProxy.cpp
+5
-2
plugins/amoeba/serialization/tests/TestSerializeAmoebaAngleForce.cpp
...eba/serialization/tests/TestSerializeAmoebaAngleForce.cpp
+2
-0
plugins/amoeba/serialization/tests/TestSerializeAmoebaBondForce.cpp
...oeba/serialization/tests/TestSerializeAmoebaBondForce.cpp
+2
-0
plugins/amoeba/serialization/tests/TestSerializeAmoebaInPlaneAngleForce.cpp
...ialization/tests/TestSerializeAmoebaInPlaneAngleForce.cpp
+2
-0
plugins/amoeba/serialization/tests/TestSerializeAmoebaOutOfPlaneBendForce.cpp
...lization/tests/TestSerializeAmoebaOutOfPlaneBendForce.cpp
+2
-0
plugins/amoeba/serialization/tests/TestSerializeAmoebaPiTorsionForce.cpp
...serialization/tests/TestSerializeAmoebaPiTorsionForce.cpp
+2
-0
plugins/amoeba/serialization/tests/TestSerializeAmoebaStretchBendForce.cpp
...rialization/tests/TestSerializeAmoebaStretchBendForce.cpp
+2
-0
plugins/amoeba/serialization/tests/TestSerializeAmoebaTorsionTorsionForce.cpp
...lization/tests/TestSerializeAmoebaTorsionTorsionForce.cpp
+2
-0
plugins/drude/platforms/cuda/tests/TestCudaDrudeForce.cpp
plugins/drude/platforms/cuda/tests/TestCudaDrudeForce.cpp
+1
-1
plugins/drude/platforms/cuda/tests/TestCudaDrudeLangevinIntegrator.cpp
.../platforms/cuda/tests/TestCudaDrudeLangevinIntegrator.cpp
+1
-1
plugins/drude/platforms/cuda/tests/TestCudaDrudeSCFIntegrator.cpp
...drude/platforms/cuda/tests/TestCudaDrudeSCFIntegrator.cpp
+2
-2
plugins/drude/platforms/opencl/tests/TestOpenCLDrudeForce.cpp
...ins/drude/platforms/opencl/tests/TestOpenCLDrudeForce.cpp
+1
-1
plugins/drude/platforms/opencl/tests/TestOpenCLDrudeLangevinIntegrator.cpp
...tforms/opencl/tests/TestOpenCLDrudeLangevinIntegrator.cpp
+1
-1
plugins/drude/platforms/opencl/tests/TestOpenCLDrudeSCFIntegrator.cpp
...e/platforms/opencl/tests/TestOpenCLDrudeSCFIntegrator.cpp
+2
-2
plugins/rpmd/platforms/cuda/tests/TestCudaRpmd.cpp
plugins/rpmd/platforms/cuda/tests/TestCudaRpmd.cpp
+1
-1
plugins/rpmd/platforms/opencl/tests/TestOpenCLRpmd.cpp
plugins/rpmd/platforms/opencl/tests/TestOpenCLRpmd.cpp
+1
-1
serialization/src/CMAPTorsionForceProxy.cpp
serialization/src/CMAPTorsionForceProxy.cpp
+7
-3
serialization/src/CustomAngleForceProxy.cpp
serialization/src/CustomAngleForceProxy.cpp
+7
-3
serialization/src/CustomBondForceProxy.cpp
serialization/src/CustomBondForceProxy.cpp
+7
-3
No files found.
plugins/amoeba/serialization/src/AmoebaStretchBendForceProxy.cpp
View file @
73183c61
...
...
@@ -42,9 +42,10 @@ AmoebaStretchBendForceProxy::AmoebaStretchBendForceProxy() : SerializationProxy(
}
void
AmoebaStretchBendForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
3
);
node
.
setIntProperty
(
"version"
,
4
);
const
AmoebaStretchBendForce
&
force
=
*
reinterpret_cast
<
const
AmoebaStretchBendForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
SerializationNode
&
bonds
=
node
.
createChildNode
(
"StretchBendAngles"
);
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumStretchBends
());
ii
++
)
{
int
particle1
,
particle2
,
particle3
;
...
...
@@ -57,12 +58,14 @@ void AmoebaStretchBendForceProxy::serialize(const void* object, SerializationNod
void
*
AmoebaStretchBendForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
int
version
=
node
.
getIntProperty
(
"version"
);
if
(
version
<
1
||
version
>
3
)
if
(
version
<
1
||
version
>
4
)
throw
OpenMMException
(
"Unsupported version number"
);
AmoebaStretchBendForce
*
force
=
new
AmoebaStretchBendForce
();
try
{
if
(
version
>
2
)
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
if
(
version
>
3
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
bonds
=
node
.
getChildNode
(
"StretchBendAngles"
);
for
(
unsigned
int
ii
=
0
;
ii
<
(
int
)
bonds
.
getChildren
().
size
();
ii
++
)
{
const
SerializationNode
&
bond
=
bonds
.
getChildren
()[
ii
];
...
...
plugins/amoeba/serialization/src/AmoebaTorsionTorsionForceProxy.cpp
View file @
73183c61
...
...
@@ -63,9 +63,10 @@ static void loadGrid(const SerializationNode& grid, std::vector< std::vector< st
}
void
AmoebaTorsionTorsionForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
2
);
node
.
setIntProperty
(
"version"
,
3
);
const
AmoebaTorsionTorsionForce
&
force
=
*
reinterpret_cast
<
const
AmoebaTorsionTorsionForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
// grid[xIdx][yIdx][6 values]
...
...
@@ -118,13 +119,15 @@ void AmoebaTorsionTorsionForceProxy::serialize(const void* object, Serialization
void
*
AmoebaTorsionTorsionForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
int
version
=
node
.
getIntProperty
(
"version"
);
if
(
version
<
1
||
version
>
2
)
if
(
version
<
1
||
version
>
3
)
throw
OpenMMException
(
"Unsupported version number"
);
AmoebaTorsionTorsionForce
*
force
=
new
AmoebaTorsionTorsionForce
();
try
{
if
(
version
>
1
)
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
if
(
version
>
2
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
grids
=
node
.
getChildNode
(
"TorsionTorsionGrids"
);
const
std
::
vector
<
SerializationNode
>&
gridList
=
grids
.
getChildren
();
for
(
unsigned
int
ii
=
0
;
ii
<
gridList
.
size
();
ii
++
)
{
...
...
plugins/amoeba/serialization/tests/TestSerializeAmoebaAngleForce.cpp
View file @
73183c61
...
...
@@ -54,6 +54,7 @@ void testSerialization() {
force1
.
addAngle
(
0
,
2
,
3
,
2.0
,
2.1
);
force1
.
addAngle
(
2
,
3
,
5
,
3.0
,
2.2
);
force1
.
addAngle
(
5
,
1
,
8
,
4.0
,
2.3
);
force1
.
setUsesPeriodicBoundaryConditions
(
true
);
// Serialize and then deserialize it.
...
...
@@ -64,6 +65,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
AmoebaAngleForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force1
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force1
.
usesPeriodicBoundaryConditions
(),
force2
.
usesPeriodicBoundaryConditions
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalAngleCubic
(),
force2
.
getAmoebaGlobalAngleCubic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalAngleQuartic
(),
force2
.
getAmoebaGlobalAngleQuartic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalAnglePentic
(),
force2
.
getAmoebaGlobalAnglePentic
());
...
...
plugins/amoeba/serialization/tests/TestSerializeAmoebaBondForce.cpp
View file @
73183c61
...
...
@@ -52,6 +52,7 @@ void testSerialization() {
force1
.
addBond
(
0
,
2
,
2.0
,
2.1
);
force1
.
addBond
(
2
,
3
,
3.0
,
2.2
);
force1
.
addBond
(
5
,
1
,
4.0
,
2.3
);
force1
.
setUsesPeriodicBoundaryConditions
(
true
);
// Serialize and then deserialize it.
...
...
@@ -62,6 +63,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
AmoebaBondForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force1
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force1
.
usesPeriodicBoundaryConditions
(),
force2
.
usesPeriodicBoundaryConditions
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalBondCubic
(),
force2
.
getAmoebaGlobalBondCubic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalBondQuartic
(),
force2
.
getAmoebaGlobalBondQuartic
());
ASSERT_EQUAL
(
force1
.
getNumBonds
(),
force2
.
getNumBonds
());
...
...
plugins/amoeba/serialization/tests/TestSerializeAmoebaInPlaneAngleForce.cpp
View file @
73183c61
...
...
@@ -56,6 +56,7 @@ void testSerialization() {
force1
.
addAngle
(
0
,
2
,
3
,
5
,
2.0
,
2.1
);
force1
.
addAngle
(
2
,
3
,
5
,
6
,
3.0
,
2.2
);
force1
.
addAngle
(
5
,
1
,
8
,
8
,
4.0
,
2.3
);
force1
.
setUsesPeriodicBoundaryConditions
(
true
);
// Serialize and then deserialize it.
...
...
@@ -67,6 +68,7 @@ void testSerialization() {
AmoebaInPlaneAngleForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force1
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force1
.
usesPeriodicBoundaryConditions
(),
force2
.
usesPeriodicBoundaryConditions
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalInPlaneAngleCubic
(),
force2
.
getAmoebaGlobalInPlaneAngleCubic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalInPlaneAngleQuartic
(),
force2
.
getAmoebaGlobalInPlaneAngleQuartic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalInPlaneAnglePentic
(),
force2
.
getAmoebaGlobalInPlaneAnglePentic
());
...
...
plugins/amoeba/serialization/tests/TestSerializeAmoebaOutOfPlaneBendForce.cpp
View file @
73183c61
...
...
@@ -56,6 +56,7 @@ void testSerialization() {
force1
.
addOutOfPlaneBend
(
0
,
2
,
3
,
5
,
2.1
);
force1
.
addOutOfPlaneBend
(
2
,
3
,
5
,
6
,
2.2
);
force1
.
addOutOfPlaneBend
(
5
,
1
,
8
,
8
,
2.3
);
force1
.
setUsesPeriodicBoundaryConditions
(
true
);
// Serialize and then deserialize it.
...
...
@@ -67,6 +68,7 @@ void testSerialization() {
AmoebaOutOfPlaneBendForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force1
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force1
.
usesPeriodicBoundaryConditions
(),
force2
.
usesPeriodicBoundaryConditions
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalOutOfPlaneBendCubic
(),
force2
.
getAmoebaGlobalOutOfPlaneBendCubic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalOutOfPlaneBendQuartic
(),
force2
.
getAmoebaGlobalOutOfPlaneBendQuartic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalOutOfPlaneBendPentic
(),
force2
.
getAmoebaGlobalOutOfPlaneBendPentic
());
...
...
plugins/amoeba/serialization/tests/TestSerializeAmoebaPiTorsionForce.cpp
View file @
73183c61
...
...
@@ -50,6 +50,7 @@ void testSerialization() {
force1
.
addPiTorsion
(
0
,
2
,
3
,
5
,
12
,
13
,
2.1
);
force1
.
addPiTorsion
(
2
,
3
,
5
,
6
,
81
,
91
,
2.2
);
force1
.
addPiTorsion
(
5
,
1
,
8
,
8
,
101
,
102
,
2.3
);
force1
.
setUsesPeriodicBoundaryConditions
(
true
);
// Serialize and then deserialize it.
...
...
@@ -60,6 +61,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
AmoebaPiTorsionForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force1
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force1
.
usesPeriodicBoundaryConditions
(),
force2
.
usesPeriodicBoundaryConditions
());
ASSERT_EQUAL
(
force1
.
getNumPiTorsions
(),
force2
.
getNumPiTorsions
());
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force1
.
getNumPiTorsions
());
ii
++
)
{
int
a1
,
a2
,
a3
,
a4
,
a5
,
a6
,
b1
,
b2
,
b3
,
b4
,
b5
,
b6
;
...
...
plugins/amoeba/serialization/tests/TestSerializeAmoebaStretchBendForce.cpp
View file @
73183c61
...
...
@@ -49,6 +49,7 @@ void testSerialization() {
force1
.
addStretchBend
(
0
,
1
,
3
,
1.0
,
1.2
,
150.1
,
83.2
,
100.
);
force1
.
addStretchBend
(
2
,
4
,
4
,
1.1
,
2.2
,
180.1
,
89.2
,
100.
);
force1
.
addStretchBend
(
5
,
0
,
1
,
3.1
,
8.2
,
140.1
,
98.2
,
100.
);
force1
.
setUsesPeriodicBoundaryConditions
(
true
);
// Serialize and then deserialize it.
...
...
@@ -59,6 +60,7 @@ void testSerialization() {
// Compare the two forces to see if they are identical.
AmoebaStretchBendForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force1
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force1
.
usesPeriodicBoundaryConditions
(),
force2
.
usesPeriodicBoundaryConditions
());
ASSERT_EQUAL
(
force1
.
getNumStretchBends
(),
force2
.
getNumStretchBends
());
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force1
.
getNumStretchBends
());
ii
++
)
{
int
p11
,
p12
,
p13
;
...
...
plugins/amoeba/serialization/tests/TestSerializeAmoebaTorsionTorsionForce.cpp
View file @
73183c61
...
...
@@ -90,6 +90,7 @@ void testSerialization() {
for
(
unsigned
int
ii
=
0
;
ii
<
5
;
ii
++
)
{
force1
.
addTorsionTorsion
(
ii
,
ii
+
1
,
ii
+
3
,
ii
+
4
,
ii
+
5
,
((
ii
%
2
)
?
1
:
0
),
(
ii
%
4
));
}
force1
.
setUsesPeriodicBoundaryConditions
(
true
);
// Serialize and then deserialize it.
...
...
@@ -101,6 +102,7 @@ void testSerialization() {
AmoebaTorsionTorsionForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force1
.
getForceGroup
(),
force2
.
getForceGroup
());
ASSERT_EQUAL
(
force1
.
usesPeriodicBoundaryConditions
(),
force2
.
usesPeriodicBoundaryConditions
());
ASSERT_EQUAL
(
force1
.
getNumTorsionTorsions
(),
force2
.
getNumTorsionTorsions
());
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force1
.
getNumTorsionTorsions
());
ii
++
)
{
...
...
plugins/drude/platforms/cuda/tests/TestCudaDrudeForce.cpp
View file @
73183c61
...
...
@@ -197,7 +197,7 @@ int main(int argc, char* argv[]) {
try
{
registerDrudeCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"
Cuda
Precision"
,
std
::
string
(
argv
[
1
]));
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"Precision"
,
std
::
string
(
argv
[
1
]));
testSingleParticle
();
testAnisotropicParticle
();
testThole
();
...
...
plugins/drude/platforms/cuda/tests/TestCudaDrudeLangevinIntegrator.cpp
View file @
73183c61
...
...
@@ -183,7 +183,7 @@ int main(int argc, char* argv[]) {
try
{
registerDrudeCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"
Cuda
Precision"
,
string
(
argv
[
1
]));
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"Precision"
,
string
(
argv
[
1
]));
testSinglePair
();
testWater
();
}
...
...
plugins/drude/platforms/cuda/tests/TestCudaDrudeSCFIntegrator.cpp
View file @
73183c61
...
...
@@ -110,7 +110,7 @@ void testWater() {
State
state
=
context
.
getState
(
State
::
Energy
);
double
initialEnergy
;
int
numSteps
=
1000
;
double
maxNorm
=
(
platform
.
getPropertyValue
(
context
,
"
Cuda
Precision"
)
==
"double"
?
1.0
:
5.0
);
double
maxNorm
=
(
platform
.
getPropertyValue
(
context
,
"Precision"
)
==
"double"
?
1.0
:
5.0
);
for
(
int
i
=
0
;
i
<
numSteps
;
i
++
)
{
integ
.
step
(
1
);
state
=
context
.
getState
(
State
::
Energy
|
State
::
Forces
);
...
...
@@ -131,7 +131,7 @@ int main(int argc, char* argv[]) {
try
{
registerDrudeCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"
Cuda
Precision"
,
string
(
argv
[
1
]));
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"Precision"
,
string
(
argv
[
1
]));
testWater
();
}
catch
(
const
std
::
exception
&
e
)
{
...
...
plugins/drude/platforms/opencl/tests/TestOpenCLDrudeForce.cpp
View file @
73183c61
...
...
@@ -197,7 +197,7 @@ int main(int argc, char* argv[]) {
try
{
registerDrudeOpenCLKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"OpenCL"
).
setPropertyDefaultValue
(
"
OpenCL
Precision"
,
std
::
string
(
argv
[
1
]));
Platform
::
getPlatformByName
(
"OpenCL"
).
setPropertyDefaultValue
(
"Precision"
,
std
::
string
(
argv
[
1
]));
testSingleParticle
();
testAnisotropicParticle
();
testThole
();
...
...
plugins/drude/platforms/opencl/tests/TestOpenCLDrudeLangevinIntegrator.cpp
View file @
73183c61
...
...
@@ -183,7 +183,7 @@ int main(int argc, char* argv[]) {
try
{
registerDrudeOpenCLKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"OpenCL"
).
setPropertyDefaultValue
(
"
OpenCL
Precision"
,
string
(
argv
[
1
]));
Platform
::
getPlatformByName
(
"OpenCL"
).
setPropertyDefaultValue
(
"Precision"
,
string
(
argv
[
1
]));
testSinglePair
();
testWater
();
}
...
...
plugins/drude/platforms/opencl/tests/TestOpenCLDrudeSCFIntegrator.cpp
View file @
73183c61
...
...
@@ -110,7 +110,7 @@ void testWater() {
State
state
=
context
.
getState
(
State
::
Energy
);
double
initialEnergy
;
int
numSteps
=
1000
;
double
maxNorm
=
(
platform
.
getPropertyValue
(
context
,
"
OpenCL
Precision"
)
==
"double"
?
1.0
:
5.0
);
double
maxNorm
=
(
platform
.
getPropertyValue
(
context
,
"Precision"
)
==
"double"
?
1.0
:
5.0
);
for
(
int
i
=
0
;
i
<
numSteps
;
i
++
)
{
integ
.
step
(
1
);
state
=
context
.
getState
(
State
::
Energy
|
State
::
Forces
);
...
...
@@ -131,7 +131,7 @@ int main(int argc, char* argv[]) {
try
{
registerDrudeOpenCLKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"OpenCL"
).
setPropertyDefaultValue
(
"
OpenCL
Precision"
,
string
(
argv
[
1
]));
Platform
::
getPlatformByName
(
"OpenCL"
).
setPropertyDefaultValue
(
"Precision"
,
string
(
argv
[
1
]));
testWater
();
}
catch
(
const
std
::
exception
&
e
)
{
...
...
plugins/rpmd/platforms/cuda/tests/TestCudaRpmd.cpp
View file @
73183c61
...
...
@@ -554,7 +554,7 @@ int main(int argc, char* argv[]) {
try
{
registerRPMDCudaKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"
Cuda
Precision"
,
string
(
argv
[
1
]));
Platform
::
getPlatformByName
(
"CUDA"
).
setPropertyDefaultValue
(
"Precision"
,
string
(
argv
[
1
]));
testFreeParticles
();
testParaHydrogen
();
testCMMotionRemoval
();
...
...
plugins/rpmd/platforms/opencl/tests/TestOpenCLRpmd.cpp
View file @
73183c61
...
...
@@ -555,7 +555,7 @@ int main(int argc, char* argv[]) {
try
{
registerRPMDOpenCLKernelFactories
();
if
(
argc
>
1
)
Platform
::
getPlatformByName
(
"OpenCL"
).
setPropertyDefaultValue
(
"
OpenCL
Precision"
,
string
(
argv
[
1
]));
Platform
::
getPlatformByName
(
"OpenCL"
).
setPropertyDefaultValue
(
"Precision"
,
string
(
argv
[
1
]));
testFreeParticles
();
testParaHydrogen
();
testCMMotionRemoval
();
...
...
serialization/src/CMAPTorsionForceProxy.cpp
View file @
73183c61
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,9 +42,10 @@ CMAPTorsionForceProxy::CMAPTorsionForceProxy() : SerializationProxy("CMAPTorsion
}
void
CMAPTorsionForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
2
);
const
CMAPTorsionForce
&
force
=
*
reinterpret_cast
<
const
CMAPTorsionForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
SerializationNode
&
maps
=
node
.
createChildNode
(
"Maps"
);
for
(
int
i
=
0
;
i
<
force
.
getNumMaps
();
i
++
)
{
int
size
;
...
...
@@ -63,11 +64,14 @@ void CMAPTorsionForceProxy::serialize(const void* object, SerializationNode& nod
}
void
*
CMAPTorsionForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
if
(
node
.
getIntProperty
(
"version"
)
!=
1
)
int
version
=
node
.
getIntProperty
(
"version"
);
if
(
version
<
1
||
version
>
2
)
throw
OpenMMException
(
"Unsupported version number"
);
CMAPTorsionForce
*
force
=
new
CMAPTorsionForce
();
try
{
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
maps
=
node
.
getChildNode
(
"Maps"
);
for
(
int
i
=
0
;
i
<
(
int
)
maps
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
map
=
maps
.
getChildren
()[
i
];
...
...
serialization/src/CustomAngleForceProxy.cpp
View file @
73183c61
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,9 +42,10 @@ CustomAngleForceProxy::CustomAngleForceProxy() : SerializationProxy("CustomAngle
}
void
CustomAngleForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
2
);
const
CustomAngleForce
&
force
=
*
reinterpret_cast
<
const
CustomAngleForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
SerializationNode
&
perAngleParams
=
node
.
createChildNode
(
"PerAngleParameters"
);
for
(
int
i
=
0
;
i
<
force
.
getNumPerAngleParameters
();
i
++
)
{
...
...
@@ -70,12 +71,15 @@ void CustomAngleForceProxy::serialize(const void* object, SerializationNode& nod
}
void
*
CustomAngleForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
if
(
node
.
getIntProperty
(
"version"
)
!=
1
)
int
version
=
node
.
getIntProperty
(
"version"
);
if
(
version
<
1
||
version
>
2
)
throw
OpenMMException
(
"Unsupported version number"
);
CustomAngleForce
*
force
=
NULL
;
try
{
CustomAngleForce
*
force
=
new
CustomAngleForce
(
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
perAngleParams
=
node
.
getChildNode
(
"PerAngleParameters"
);
for
(
int
i
=
0
;
i
<
(
int
)
perAngleParams
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
parameter
=
perAngleParams
.
getChildren
()[
i
];
...
...
serialization/src/CustomBondForceProxy.cpp
View file @
73183c61
...
...
@@ -6,7 +6,7 @@
* Biological Structures at Stanford, funded under the NIH Roadmap for *
* Medical Research, grant U54 GM072970. See https://simtk.org. *
* *
* Portions copyright (c) 2010-201
4
Stanford University and the Authors. *
* Portions copyright (c) 2010-201
6
Stanford University and the Authors. *
* Authors: Peter Eastman *
* Contributors: *
* *
...
...
@@ -42,9 +42,10 @@ CustomBondForceProxy::CustomBondForceProxy() : SerializationProxy("CustomBondFor
}
void
CustomBondForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
node
.
setIntProperty
(
"version"
,
2
);
const
CustomBondForce
&
force
=
*
reinterpret_cast
<
const
CustomBondForce
*>
(
object
);
node
.
setIntProperty
(
"forceGroup"
,
force
.
getForceGroup
());
node
.
setBoolProperty
(
"usesPeriodic"
,
force
.
usesPeriodicBoundaryConditions
());
node
.
setStringProperty
(
"energy"
,
force
.
getEnergyFunction
());
SerializationNode
&
perBondParams
=
node
.
createChildNode
(
"PerBondParameters"
);
for
(
int
i
=
0
;
i
<
force
.
getNumPerBondParameters
();
i
++
)
{
...
...
@@ -70,12 +71,15 @@ void CustomBondForceProxy::serialize(const void* object, SerializationNode& node
}
void
*
CustomBondForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
if
(
node
.
getIntProperty
(
"version"
)
!=
1
)
int
version
=
node
.
getIntProperty
(
"version"
);
if
(
version
<
1
||
version
>
2
)
throw
OpenMMException
(
"Unsupported version number"
);
CustomBondForce
*
force
=
NULL
;
try
{
CustomBondForce
*
force
=
new
CustomBondForce
(
node
.
getStringProperty
(
"energy"
));
force
->
setForceGroup
(
node
.
getIntProperty
(
"forceGroup"
,
0
));
if
(
version
>
1
)
force
->
setUsesPeriodicBoundaryConditions
(
node
.
getBoolProperty
(
"usesPeriodic"
));
const
SerializationNode
&
perBondParams
=
node
.
getChildNode
(
"PerBondParameters"
);
for
(
int
i
=
0
;
i
<
(
int
)
perBondParams
.
getChildren
().
size
();
i
++
)
{
const
SerializationNode
&
parameter
=
perBondParams
.
getChildren
()[
i
];
...
...
Prev
1
…
7
8
9
10
11
12
13
14
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