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
c6ebf6e2
Commit
c6ebf6e2
authored
Sep 28, 2012
by
Peter Eastman
Browse files
Removed the word "harmonic" from lots of places it didn't belong, including class and method names
parent
58b094ce
Changes
62
Hide whitespace changes
Inline
Side-by-side
Showing
20 changed files
with
214 additions
and
214 deletions
+214
-214
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceBondForce.h
...s/reference/src/SimTKReference/AmoebaReferenceBondForce.h
+8
-8
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceInPlaneAngleForce.cpp
...e/src/SimTKReference/AmoebaReferenceInPlaneAngleForce.cpp
+7
-7
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceInPlaneAngleForce.h
...nce/src/SimTKReference/AmoebaReferenceInPlaneAngleForce.h
+12
-12
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceOutOfPlaneBendForce.cpp
...src/SimTKReference/AmoebaReferenceOutOfPlaneBendForce.cpp
+1
-1
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferencePiTorsionForce.cpp
...ence/src/SimTKReference/AmoebaReferencePiTorsionForce.cpp
+1
-1
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceStretchBendForce.cpp
...ce/src/SimTKReference/AmoebaReferenceStretchBendForce.cpp
+1
-1
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaAngleForce.cpp
...atforms/reference/tests/TestReferenceAmoebaAngleForce.cpp
+25
-25
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaBondForce.cpp
...latforms/reference/tests/TestReferenceAmoebaBondForce.cpp
+26
-26
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaInPlaneAngleForce.cpp
.../reference/tests/TestReferenceAmoebaInPlaneAngleForce.cpp
+26
-26
plugins/amoeba/serialization/include/openmm/serialization/AmoebaAngleForceProxy.h
...tion/include/openmm/serialization/AmoebaAngleForceProxy.h
+6
-6
plugins/amoeba/serialization/include/openmm/serialization/AmoebaBondForceProxy.h
...ation/include/openmm/serialization/AmoebaBondForceProxy.h
+6
-6
plugins/amoeba/serialization/include/openmm/serialization/AmoebaInPlaneAngleForceProxy.h
...clude/openmm/serialization/AmoebaInPlaneAngleForceProxy.h
+6
-6
plugins/amoeba/serialization/src/AmoebaAngleForceProxy.cpp
plugins/amoeba/serialization/src/AmoebaAngleForceProxy.cpp
+15
-15
plugins/amoeba/serialization/src/AmoebaBondForceProxy.cpp
plugins/amoeba/serialization/src/AmoebaBondForceProxy.cpp
+11
-11
plugins/amoeba/serialization/src/AmoebaInPlaneAngleForceProxy.cpp
...amoeba/serialization/src/AmoebaInPlaneAngleForceProxy.cpp
+15
-15
plugins/amoeba/serialization/src/AmoebaSerializationProxyRegistration.cpp
...erialization/src/AmoebaSerializationProxyRegistration.cpp
+9
-9
plugins/amoeba/serialization/tests/TestSerializeAmoebaAngleForce.cpp
...eba/serialization/tests/TestSerializeAmoebaAngleForce.cpp
+13
-13
plugins/amoeba/serialization/tests/TestSerializeAmoebaBondForce.cpp
...oeba/serialization/tests/TestSerializeAmoebaBondForce.cpp
+9
-9
plugins/amoeba/serialization/tests/TestSerializeAmoebaInPlaneAngleForce.cpp
...ialization/tests/TestSerializeAmoebaInPlaneAngleForce.cpp
+13
-13
wrappers/python/simtk/openmm/app/data/amoeba2009.xml
wrappers/python/simtk/openmm/app/data/amoeba2009.xml
+4
-4
No files found.
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReference
Harmonic
BondForce.h
→
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceBondForce.h
View file @
c6ebf6e2
...
...
@@ -22,15 +22,15 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef __AmoebaReference
Harmonic
BondForce_H__
#define __AmoebaReference
Harmonic
BondForce_H__
#ifndef __AmoebaReferenceBondForce_H__
#define __AmoebaReferenceBondForce_H__
#include "SimTKUtilities/RealVec.h"
#include <vector>
// ---------------------------------------------------------------------------------------
class
AmoebaReference
Harmonic
BondForce
{
class
AmoebaReferenceBondForce
{
public:
...
...
@@ -40,7 +40,7 @@ public:
--------------------------------------------------------------------------------------- */
AmoebaReference
Harmonic
BondForce
(
){};
AmoebaReferenceBondForce
(
){};
/**---------------------------------------------------------------------------------------
...
...
@@ -48,12 +48,12 @@ public:
--------------------------------------------------------------------------------------- */
~
AmoebaReference
Harmonic
BondForce
(
){};
~
AmoebaReferenceBondForce
(
){};
/**---------------------------------------------------------------------------------------
Calculate Amoeba
harmonic
bond ixns (force and energy)
Calculate Amoeba bond ixns (force and energy)
@param numBonds number of bonds
@param posData particle positions
...
...
@@ -81,7 +81,7 @@ private:
/**---------------------------------------------------------------------------------------
Calculate Amoeba
harmonic
bond ixns (force and energy)
Calculate Amoeba bond ixns (force and energy)
@param positionAtomA Cartesian coordinates of atom A
@param positionAtomB Cartesian coordinates of atom B
...
...
@@ -104,4 +104,4 @@ private:
// ---------------------------------------------------------------------------------------
#endif // _AmoebaReference
Harmonic
BondForce___
#endif // _AmoebaReferenceBondForce___
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReference
Harmonic
InPlaneAngleForce.cpp
→
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceInPlaneAngleForce.cpp
View file @
c6ebf6e2
...
...
@@ -23,7 +23,7 @@
*/
#include "AmoebaReferenceForce.h"
#include "AmoebaReference
Harmonic
InPlaneAngleForce.h"
#include "AmoebaReferenceInPlaneAngleForce.h"
using
std
::
vector
;
using
OpenMM
::
RealVec
;
...
...
@@ -46,7 +46,7 @@ using OpenMM::RealVec;
--------------------------------------------------------------------------------------- */
RealOpenMM
AmoebaReference
Harmonic
InPlaneAngleForce
::
getPrefactorsGivenAngleCosine
(
RealOpenMM
cosine
,
RealOpenMM
AmoebaReferenceInPlaneAngleForce
::
getPrefactorsGivenAngleCosine
(
RealOpenMM
cosine
,
RealOpenMM
idealAngle
,
RealOpenMM
angleK
,
RealOpenMM
angleCubic
,
RealOpenMM
angleQuartic
,
RealOpenMM
anglePentic
,
RealOpenMM
angleSextic
,
...
...
@@ -62,7 +62,7 @@ RealOpenMM AmoebaReferenceHarmonicInPlaneAngleForce::getPrefactorsGivenAngleCosi
static
const
RealOpenMM
five
=
5.0
;
static
const
RealOpenMM
six
=
6.0
;
// static const std::string methodName = "AmoebaReference
Harmonic
InPlaneAngleForce::getPrefactorsGivenAngleCosine";
// static const std::string methodName = "AmoebaReferenceInPlaneAngleForce::getPrefactorsGivenAngleCosine";
// ---------------------------------------------------------------------------------------
...
...
@@ -96,7 +96,7 @@ RealOpenMM AmoebaReferenceHarmonicInPlaneAngleForce::getPrefactorsGivenAngleCosi
/**---------------------------------------------------------------------------------------
Calculate Amoeba
harmonic
angle ixn (force and energy)
Calculate Amoeba angle ixn (force and energy)
@param positionAtomA Cartesian coordinates of atom A
@param positionAtomB Cartesian coordinates of atom B
...
...
@@ -114,7 +114,7 @@ RealOpenMM AmoebaReferenceHarmonicInPlaneAngleForce::getPrefactorsGivenAngleCosi
--------------------------------------------------------------------------------------- */
RealOpenMM
AmoebaReference
Harmonic
InPlaneAngleForce
::
calculateAngleIxn
(
const
RealVec
&
positionAtomA
,
const
RealVec
&
positionAtomB
,
RealOpenMM
AmoebaReferenceInPlaneAngleForce
::
calculateAngleIxn
(
const
RealVec
&
positionAtomA
,
const
RealVec
&
positionAtomB
,
const
RealVec
&
positionAtomC
,
const
RealVec
&
positionAtomD
,
RealOpenMM
angle
,
RealOpenMM
angleK
,
RealOpenMM
angleCubic
,
RealOpenMM
angleQuartic
,
...
...
@@ -123,7 +123,7 @@ RealOpenMM AmoebaReferenceHarmonicInPlaneAngleForce::calculateAngleIxn( const Re
// ---------------------------------------------------------------------------------------
//static const std::string methodName = "AmoebaReference
Harmonic
InPlaneAngleForce::calculate
HarmonicForce
";
//static const std::string methodName = "AmoebaReferenceInPlaneAngleForce::calculate
AngleIxn
";
static
const
RealOpenMM
zero
=
0.0
;
static
const
RealOpenMM
one
=
1.0
;
...
...
@@ -245,7 +245,7 @@ RealOpenMM AmoebaReferenceHarmonicInPlaneAngleForce::calculateAngleIxn( const Re
}
RealOpenMM
AmoebaReference
Harmonic
InPlaneAngleForce
::
calculateForceAndEnergy
(
int
numAngles
,
vector
<
RealVec
>&
posData
,
RealOpenMM
AmoebaReferenceInPlaneAngleForce
::
calculateForceAndEnergy
(
int
numAngles
,
vector
<
RealVec
>&
posData
,
const
std
::
vector
<
int
>&
particle1
,
const
std
::
vector
<
int
>&
particle2
,
const
std
::
vector
<
int
>&
particle3
,
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReference
Harmonic
InPlaneAngleForce.h
→
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceInPlaneAngleForce.h
View file @
c6ebf6e2
...
...
@@ -22,15 +22,15 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef __AmoebaReference
Harmonic
InPlaneAngleForce_H__
#define __AmoebaReference
Harmonic
InPlaneAngleForce_H__
#ifndef __AmoebaReferenceInPlaneAngleForce_H__
#define __AmoebaReferenceInPlaneAngleForce_H__
#include "SimTKUtilities/RealVec.h"
#include <vector>
// ---------------------------------------------------------------------------------------
class
AmoebaReference
Harmonic
InPlaneAngleForce
{
class
AmoebaReferenceInPlaneAngleForce
{
public:
...
...
@@ -40,7 +40,7 @@ public:
--------------------------------------------------------------------------------------- */
AmoebaReference
Harmonic
InPlaneAngleForce
(
){};
AmoebaReferenceInPlaneAngleForce
(
){};
/**---------------------------------------------------------------------------------------
...
...
@@ -48,11 +48,11 @@ public:
--------------------------------------------------------------------------------------- */
~
AmoebaReference
Harmonic
InPlaneAngleForce
(
){};
~
AmoebaReferenceInPlaneAngleForce
(
){};
/**---------------------------------------------------------------------------------------
Calculate Amoeba
harmonic
in-plane angle ixns (force and energy)
Calculate Amoeba in-plane angle ixns (force and energy)
@param numBonds number of angles
@param posData particle positions
...
...
@@ -80,10 +80,10 @@ public:
const
std
::
vector
<
int
>&
particle4
,
const
std
::
vector
<
RealOpenMM
>&
angle
,
const
std
::
vector
<
RealOpenMM
>&
kQuadratic
,
RealOpenMM
global
Harmonic
AngleCubic
,
RealOpenMM
global
Harmonic
AngleQuartic
,
RealOpenMM
global
Harmonic
AnglePentic
,
RealOpenMM
global
Harmonic
AngleSextic
,
RealOpenMM
globalAngleCubic
,
RealOpenMM
globalAngleQuartic
,
RealOpenMM
globalAnglePentic
,
RealOpenMM
globalAngleSextic
,
std
::
vector
<
OpenMM
::
RealVec
>&
forceData
)
const
;
private:
...
...
@@ -113,7 +113,7 @@ private:
/**---------------------------------------------------------------------------------------
Calculate Amoeba
harmonic
angle ixn (force and energy)
Calculate Amoeba angle ixn (force and energy)
@param positionAtomA Cartesian coordinates of atom A
@param positionAtomB Cartesian coordinates of atom B
...
...
@@ -142,4 +142,4 @@ private:
// ---------------------------------------------------------------------------------------
#endif // _AmoebaReference
Harmonic
InPlaneAngleForce___
#endif // _AmoebaReferenceInPlaneAngleForce___
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceOutOfPlaneBendForce.cpp
View file @
c6ebf6e2
...
...
@@ -57,7 +57,7 @@ RealOpenMM AmoebaReferenceOutOfPlaneBendForce::calculateOutOfPlaneBendIxn( const
// ---------------------------------------------------------------------------------------
//static const std::string methodName = "AmoebaReferenceOutOfPlaneBendForce::calculate
HarmonicForce
";
//static const std::string methodName = "AmoebaReferenceOutOfPlaneBendForce::calculate
OutOfPlaneBendIxn
";
static
const
RealOpenMM
zero
=
0.0
;
static
const
RealOpenMM
one
=
1.0
;
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferencePiTorsionForce.cpp
View file @
c6ebf6e2
...
...
@@ -53,7 +53,7 @@ RealOpenMM AmoebaReferencePiTorsionForce::calculatePiTorsionIxn( const RealVec&
// ---------------------------------------------------------------------------------------
//static const std::string methodName = "AmoebaReferencePiTorsionForce::calculate
HarmonicForce
";
//static const std::string methodName = "AmoebaReferencePiTorsionForce::calculate
PiTorsionIxn
";
static
const
RealOpenMM
zero
=
0.0
;
static
const
RealOpenMM
one
=
1.0
;
...
...
plugins/amoeba/platforms/reference/src/SimTKReference/AmoebaReferenceStretchBendForce.cpp
View file @
c6ebf6e2
...
...
@@ -57,7 +57,7 @@ RealOpenMM AmoebaReferenceStretchBendForce::calculateStretchBendIxn( const RealV
// ---------------------------------------------------------------------------------------
//static const std::string methodName = "AmoebaReferenceStretchBendForce::calculate
HarmonicForce
";
//static const std::string methodName = "AmoebaReferenceStretchBendForce::calculate
StretchBendIxn
";
static
const
RealOpenMM
zero
=
0.0
;
static
const
RealOpenMM
one
=
1.0
;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoeba
Harmonic
AngleForce.cpp
→
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaAngleForce.cpp
View file @
c6ebf6e2
...
...
@@ -30,7 +30,7 @@
* -------------------------------------------------------------------------- */
/**
* This tests the Cuda implementation of CudaAmoeba
Harmonic
AngleForce.
* This tests the Cuda implementation of CudaAmoebaAngleForce.
*/
#include "openmm/internal/AssertionUtilities.h"
...
...
@@ -117,21 +117,21 @@ static void getPrefactorsGivenAngleCosine( double cosine, double idealAngle, dou
return
;
}
static
void
computeAmoeba
Harmonic
AngleForce
(
int
bondIndex
,
std
::
vector
<
Vec3
>&
positions
,
Amoeba
Harmonic
AngleForce
&
a
moeba
Harmonic
AngleForce
,
static
void
computeAmoebaAngleForce
(
int
bondIndex
,
std
::
vector
<
Vec3
>&
positions
,
AmoebaAngleForce
&
A
moebaAngleForce
,
std
::
vector
<
Vec3
>&
forces
,
double
*
energy
,
FILE
*
log
)
{
int
particle1
,
particle2
,
particle3
;
double
idealAngle
;
double
quadraticK
;
a
moeba
Harmonic
AngleForce
.
getAngleParameters
(
bondIndex
,
particle1
,
particle2
,
particle3
,
idealAngle
,
quadraticK
);
A
moebaAngleForce
.
getAngleParameters
(
bondIndex
,
particle1
,
particle2
,
particle3
,
idealAngle
,
quadraticK
);
double
cubicK
=
a
moeba
Harmonic
AngleForce
.
getAmoebaGlobal
Harmonic
AngleCubic
();
double
quarticK
=
a
moeba
Harmonic
AngleForce
.
getAmoebaGlobal
Harmonic
AngleQuartic
();
double
penticK
=
a
moeba
Harmonic
AngleForce
.
getAmoebaGlobal
Harmonic
AnglePentic
();
double
sexticK
=
a
moeba
Harmonic
AngleForce
.
getAmoebaGlobal
Harmonic
AngleSextic
();
double
cubicK
=
A
moebaAngleForce
.
getAmoebaGlobalAngleCubic
();
double
quarticK
=
A
moebaAngleForce
.
getAmoebaGlobalAngleQuartic
();
double
penticK
=
A
moebaAngleForce
.
getAmoebaGlobalAnglePentic
();
double
sexticK
=
A
moebaAngleForce
.
getAmoebaGlobalAngleSextic
();
#ifdef AMOEBA_DEBUG
if
(
log
){
(
void
)
fprintf
(
log
,
"computeAmoeba
Harmonic
AngleForce: bond %d [%d %d %d] ang=%10.3f k=%10.3f [%10.3e %10.3e %10.3e %10.3e]
\n
"
,
(
void
)
fprintf
(
log
,
"computeAmoebaAngleForce: bond %d [%d %d %d] ang=%10.3f k=%10.3f [%10.3e %10.3e %10.3e %10.3e]
\n
"
,
bondIndex
,
particle1
,
particle2
,
particle3
,
idealAngle
,
quadraticK
,
cubicK
,
quarticK
,
penticK
,
sexticK
);
(
void
)
fflush
(
log
);
}
...
...
@@ -198,7 +198,7 @@ static void computeAmoebaHarmonicAngleForce(int bondIndex, std::vector<Vec3>& p
*
energy
+=
energyTerm
;
}
static
void
computeAmoeba
Harmonic
AngleForces
(
Context
&
context
,
Amoeba
Harmonic
AngleForce
&
a
moeba
Harmonic
AngleForce
,
static
void
computeAmoebaAngleForces
(
Context
&
context
,
AmoebaAngleForce
&
A
moebaAngleForce
,
std
::
vector
<
Vec3
>&
expectedForces
,
double
*
expectedEnergy
,
FILE
*
log
)
{
// get positions and zero forces
...
...
@@ -214,13 +214,13 @@ static void computeAmoebaHarmonicAngleForces( Context& context, AmoebaHarmonicAn
// calculates forces/energy
*
expectedEnergy
=
0.0
;
for
(
int
ii
=
0
;
ii
<
a
moeba
Harmonic
AngleForce
.
getNumAngles
();
ii
++
){
computeAmoeba
Harmonic
AngleForce
(
ii
,
positions
,
a
moeba
Harmonic
AngleForce
,
expectedForces
,
expectedEnergy
,
log
);
for
(
int
ii
=
0
;
ii
<
A
moebaAngleForce
.
getNumAngles
();
ii
++
){
computeAmoebaAngleForce
(
ii
,
positions
,
A
moebaAngleForce
,
expectedForces
,
expectedEnergy
,
log
);
}
#ifdef AMOEBA_DEBUG
if
(
log
){
(
void
)
fprintf
(
log
,
"computeAmoeba
Harmonic
AngleForces: expected energy=%14.7e
\n
"
,
*
expectedEnergy
);
(
void
)
fprintf
(
log
,
"computeAmoebaAngleForces: expected energy=%14.7e
\n
"
,
*
expectedEnergy
);
for
(
unsigned
int
ii
=
0
;
ii
<
positions
.
size
();
ii
++
){
(
void
)
fprintf
(
log
,
"%6u [%14.7e %14.7e %14.7e]
\n
"
,
ii
,
expectedForces
[
ii
][
0
],
expectedForces
[
ii
][
1
],
expectedForces
[
ii
][
2
]
);
}
...
...
@@ -231,19 +231,19 @@ static void computeAmoebaHarmonicAngleForces( Context& context, AmoebaHarmonicAn
}
void
compareWithExpectedForceAndEnergy
(
Context
&
context
,
Amoeba
Harmonic
AngleForce
&
a
moeba
Harmonic
AngleForce
,
void
compareWithExpectedForceAndEnergy
(
Context
&
context
,
AmoebaAngleForce
&
A
moebaAngleForce
,
double
tolerance
,
const
std
::
string
&
idString
,
FILE
*
log
)
{
std
::
vector
<
Vec3
>
expectedForces
;
double
expectedEnergy
;
computeAmoeba
Harmonic
AngleForces
(
context
,
a
moeba
Harmonic
AngleForce
,
expectedForces
,
&
expectedEnergy
,
log
);
computeAmoebaAngleForces
(
context
,
A
moebaAngleForce
,
expectedForces
,
&
expectedEnergy
,
log
);
State
state
=
context
.
getState
(
State
::
Forces
|
State
::
Energy
);
const
std
::
vector
<
Vec3
>
forces
=
state
.
getForces
();
#ifdef AMOEBA_DEBUG
if
(
log
){
(
void
)
fprintf
(
log
,
"computeAmoeba
Harmonic
AngleForces: expected energy=%14.7e %14.7e
\n
"
,
expectedEnergy
,
state
.
getPotentialEnergy
()
);
(
void
)
fprintf
(
log
,
"computeAmoebaAngleForces: expected energy=%14.7e %14.7e
\n
"
,
expectedEnergy
,
state
.
getPotentialEnergy
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
forces
.
size
();
ii
++
){
(
void
)
fprintf
(
log
,
"%6u [%14.7e %14.7e %14.7e] [%14.7e %14.7e %14.7e]
\n
"
,
ii
,
expectedForces
[
ii
][
0
],
expectedForces
[
ii
][
1
],
expectedForces
[
ii
][
2
],
forces
[
ii
][
0
],
forces
[
ii
][
1
],
forces
[
ii
][
2
]
);
...
...
@@ -268,7 +268,7 @@ void testOneAngle( FILE* log ) {
LangevinIntegrator
integrator
(
0.0
,
0.1
,
0.01
);
Amoeba
Harmonic
AngleForce
*
amoeba
Harmonic
AngleForce
=
new
Amoeba
Harmonic
AngleForce
();
AmoebaAngleForce
*
amoebaAngleForce
=
new
AmoebaAngleForce
();
double
angle
=
100.0
;
double
quadraticK
=
1.0
;
...
...
@@ -276,14 +276,14 @@ void testOneAngle( FILE* log ) {
double
quarticK
=
1.0e-02
;
double
penticK
=
1.0e-03
;
double
sexticK
=
1.0e-04
;
amoeba
Harmonic
AngleForce
->
addAngle
(
0
,
1
,
2
,
angle
,
quadraticK
);
amoebaAngleForce
->
addAngle
(
0
,
1
,
2
,
angle
,
quadraticK
);
amoeba
Harmonic
AngleForce
->
setAmoebaGlobal
Harmonic
AngleCubic
(
cubicK
);
amoeba
Harmonic
AngleForce
->
setAmoebaGlobal
Harmonic
AngleQuartic
(
quarticK
);
amoeba
Harmonic
AngleForce
->
setAmoebaGlobal
Harmonic
AnglePentic
(
penticK
);
amoeba
Harmonic
AngleForce
->
setAmoebaGlobal
Harmonic
AngleSextic
(
sexticK
);
amoebaAngleForce
->
setAmoebaGlobalAngleCubic
(
cubicK
);
amoebaAngleForce
->
setAmoebaGlobalAngleQuartic
(
quarticK
);
amoebaAngleForce
->
setAmoebaGlobalAnglePentic
(
penticK
);
amoebaAngleForce
->
setAmoebaGlobalAngleSextic
(
sexticK
);
system
.
addForce
(
amoeba
Harmonic
AngleForce
);
system
.
addForce
(
amoebaAngleForce
);
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
"Reference"
));
std
::
vector
<
Vec3
>
positions
(
numberOfParticles
);
...
...
@@ -293,16 +293,16 @@ void testOneAngle( FILE* log ) {
positions
[
2
]
=
Vec3
(
0
,
0
,
1
);
context
.
setPositions
(
positions
);
compareWithExpectedForceAndEnergy
(
context
,
*
amoeba
Harmonic
AngleForce
,
TOL
,
"testOneAngle"
,
log
);
compareWithExpectedForceAndEnergy
(
context
,
*
amoebaAngleForce
,
TOL
,
"testOneAngle"
,
log
);
}
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
try
{
std
::
cout
<<
"TestCudaAmoeba
Harmonic
AngleForce running test..."
<<
std
::
endl
;
std
::
cout
<<
"TestCudaAmoebaAngleForce running test..."
<<
std
::
endl
;
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
//FILE* log = fopen( "Amoeba
Harmonic
AngleForce.log", "w" );;
//FILE* log = fopen( "AmoebaAngleForce.log", "w" );;
FILE
*
log
=
NULL
;
//FILE* log = stderr;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoeba
Harmonic
BondForce.cpp
→
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaBondForce.cpp
View file @
c6ebf6e2
...
...
@@ -30,7 +30,7 @@
* -------------------------------------------------------------------------- */
/**
* This tests the Reference implementation of
Harmonic
BondForce.
* This tests the Reference implementation of
Amoeba
BondForce.
*/
#include "openmm/internal/AssertionUtilities.h"
...
...
@@ -45,15 +45,15 @@ using namespace OpenMM;
const
double
TOL
=
1e-5
;
static
void
computeAmoeba
Harmonic
BondForce
(
int
bondIndex
,
std
::
vector
<
Vec3
>&
positions
,
Amoeba
Harmonic
BondForce
&
a
moeba
Harmonic
BondForce
,
static
void
computeAmoebaBondForce
(
int
bondIndex
,
std
::
vector
<
Vec3
>&
positions
,
AmoebaBondForce
&
A
moebaBondForce
,
std
::
vector
<
Vec3
>&
forces
,
double
*
energy
)
{
int
particle1
,
particle2
;
double
bondLength
;
double
quadraticK
;
double
cubicK
=
a
moeba
Harmonic
BondForce
.
getAmoebaGlobal
Harmonic
BondCubic
();
double
quarticK
=
a
moeba
Harmonic
BondForce
.
getAmoebaGlobal
Harmonic
BondQuartic
();
a
moeba
Harmonic
BondForce
.
getBondParameters
(
bondIndex
,
particle1
,
particle2
,
bondLength
,
quadraticK
);
double
cubicK
=
A
moebaBondForce
.
getAmoebaGlobalBondCubic
();
double
quarticK
=
A
moebaBondForce
.
getAmoebaGlobalBondQuartic
();
A
moebaBondForce
.
getBondParameters
(
bondIndex
,
particle1
,
particle2
,
bondLength
,
quadraticK
);
double
deltaR
[
3
];
double
r2
=
0.0
;
...
...
@@ -81,7 +81,7 @@ static void computeAmoebaHarmonicBondForce(int bondIndex, std::vector<Vec3>& po
}
static
void
computeAmoeba
Harmonic
BondForces
(
Context
&
context
,
Amoeba
Harmonic
BondForce
&
a
moeba
Harmonic
BondForce
,
static
void
computeAmoebaBondForces
(
Context
&
context
,
AmoebaBondForce
&
A
moebaBondForce
,
std
::
vector
<
Vec3
>&
expectedForces
,
double
*
expectedEnergy
,
FILE
*
log
)
{
// get positions and zero forces
...
...
@@ -97,12 +97,12 @@ static void computeAmoebaHarmonicBondForces( Context& context, AmoebaHarmonicBon
// calculates forces/energy
*
expectedEnergy
=
0.0
;
for
(
int
ii
=
0
;
ii
<
a
moeba
Harmonic
BondForce
.
getNumBonds
();
ii
++
){
computeAmoeba
Harmonic
BondForce
(
ii
,
positions
,
a
moeba
Harmonic
BondForce
,
expectedForces
,
expectedEnergy
);
for
(
int
ii
=
0
;
ii
<
A
moebaBondForce
.
getNumBonds
();
ii
++
){
computeAmoebaBondForce
(
ii
,
positions
,
A
moebaBondForce
,
expectedForces
,
expectedEnergy
);
}
#ifdef AMOEBA_DEBUG
if
(
log
){
(
void
)
fprintf
(
log
,
"computeAmoeba
Harmonic
BondForces: expected energy=%15.7e
\n
"
,
*
expectedEnergy
);
(
void
)
fprintf
(
log
,
"computeAmoebaBondForces: expected energy=%15.7e
\n
"
,
*
expectedEnergy
);
for
(
unsigned
int
ii
=
0
;
ii
<
positions
.
size
();
ii
++
){
(
void
)
fprintf
(
log
,
"%6u [%15.7e %15.7e %15.7e]
\n
"
,
ii
,
expectedForces
[
ii
][
0
],
expectedForces
[
ii
][
1
],
expectedForces
[
ii
][
2
]
);
}
...
...
@@ -113,17 +113,17 @@ static void computeAmoebaHarmonicBondForces( Context& context, AmoebaHarmonicBon
}
void
compareWithExpectedForceAndEnergy
(
Context
&
context
,
Amoeba
Harmonic
BondForce
&
a
moeba
Harmonic
BondForce
,
double
tolerance
,
const
std
::
string
&
idString
,
FILE
*
log
)
{
void
compareWithExpectedForceAndEnergy
(
Context
&
context
,
AmoebaBondForce
&
A
moebaBondForce
,
double
tolerance
,
const
std
::
string
&
idString
,
FILE
*
log
)
{
std
::
vector
<
Vec3
>
expectedForces
;
double
expectedEnergy
;
computeAmoeba
Harmonic
BondForces
(
context
,
a
moeba
Harmonic
BondForce
,
expectedForces
,
&
expectedEnergy
,
NULL
);
computeAmoebaBondForces
(
context
,
A
moebaBondForce
,
expectedForces
,
&
expectedEnergy
,
NULL
);
State
state
=
context
.
getState
(
State
::
Forces
|
State
::
Energy
);
const
std
::
vector
<
Vec3
>
forces
=
state
.
getForces
();
#ifdef AMOEBA_DEBUG
if
(
log
){
(
void
)
fprintf
(
log
,
"computeAmoeba
Harmonic
BondForces: expected energy=%15.7e %15.7e
\n
"
,
expectedEnergy
,
state
.
getPotentialEnergy
()
);
(
void
)
fprintf
(
log
,
"computeAmoebaBondForces: expected energy=%15.7e %15.7e
\n
"
,
expectedEnergy
,
state
.
getPotentialEnergy
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
forces
.
size
();
ii
++
){
(
void
)
fprintf
(
log
,
"%6u [%15.7e %15.7e %15.7e] [%15.7e %15.7e %15.7e]
\n
"
,
ii
,
expectedForces
[
ii
][
0
],
expectedForces
[
ii
][
1
],
expectedForces
[
ii
][
2
],
forces
[
ii
][
0
],
forces
[
ii
][
1
],
forces
[
ii
][
2
]
);
...
...
@@ -147,17 +147,17 @@ void testOneBond( FILE* log ) {
LangevinIntegrator
integrator
(
0.0
,
0.1
,
0.01
);
Amoeba
Harmonic
BondForce
*
amoeba
Harmonic
BondForce
=
new
Amoeba
Harmonic
BondForce
();
AmoebaBondForce
*
amoebaBondForce
=
new
AmoebaBondForce
();
double
bondLength
=
1.5
;
double
quadraticK
=
1.0
;
double
cubicK
=
2.0
;
double
quarticicK
=
3.0
;
amoeba
Harmonic
BondForce
->
setAmoebaGlobal
Harmonic
BondCubic
(
cubicK
);
amoeba
Harmonic
BondForce
->
setAmoebaGlobal
Harmonic
BondQuartic
(
quarticicK
);
amoeba
Harmonic
BondForce
->
addBond
(
0
,
1
,
bondLength
,
quadraticK
);
amoebaBondForce
->
setAmoebaGlobalBondCubic
(
cubicK
);
amoebaBondForce
->
setAmoebaGlobalBondQuartic
(
quarticicK
);
amoebaBondForce
->
addBond
(
0
,
1
,
bondLength
,
quadraticK
);
system
.
addForce
(
amoeba
Harmonic
BondForce
);
system
.
addForce
(
amoebaBondForce
);
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
"Reference"
));
std
::
vector
<
Vec3
>
positions
(
2
);
...
...
@@ -165,7 +165,7 @@ void testOneBond( FILE* log ) {
positions
[
1
]
=
Vec3
(
0
,
0
,
0
);
context
.
setPositions
(
positions
);
compareWithExpectedForceAndEnergy
(
context
,
*
amoeba
Harmonic
BondForce
,
TOL
,
"testOneBond"
,
log
);
compareWithExpectedForceAndEnergy
(
context
,
*
amoebaBondForce
,
TOL
,
"testOneBond"
,
log
);
}
void
testTwoBond
(
FILE
*
log
)
{
...
...
@@ -178,18 +178,18 @@ void testTwoBond( FILE* log ) {
LangevinIntegrator
integrator
(
0.0
,
0.1
,
0.01
);
Amoeba
Harmonic
BondForce
*
amoeba
Harmonic
BondForce
=
new
Amoeba
Harmonic
BondForce
();
AmoebaBondForce
*
amoebaBondForce
=
new
AmoebaBondForce
();
double
bondLength
=
1.5
;
double
quadraticK
=
1.0
;
double
cubicK
=
2.0
;
double
quarticicK
=
3.0
;
amoeba
Harmonic
BondForce
->
setAmoebaGlobal
Harmonic
BondCubic
(
cubicK
);
amoeba
Harmonic
BondForce
->
setAmoebaGlobal
Harmonic
BondQuartic
(
quarticicK
);
amoeba
Harmonic
BondForce
->
addBond
(
0
,
1
,
bondLength
,
quadraticK
);
amoeba
Harmonic
BondForce
->
addBond
(
1
,
2
,
bondLength
,
quadraticK
);
amoebaBondForce
->
setAmoebaGlobalBondCubic
(
cubicK
);
amoebaBondForce
->
setAmoebaGlobalBondQuartic
(
quarticicK
);
amoebaBondForce
->
addBond
(
0
,
1
,
bondLength
,
quadraticK
);
amoebaBondForce
->
addBond
(
1
,
2
,
bondLength
,
quadraticK
);
system
.
addForce
(
amoeba
Harmonic
BondForce
);
system
.
addForce
(
amoebaBondForce
);
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
"Reference"
));
std
::
vector
<
Vec3
>
positions
(
3
);
...
...
@@ -198,13 +198,13 @@ void testTwoBond( FILE* log ) {
positions
[
2
]
=
Vec3
(
1
,
0
,
1
);
context
.
setPositions
(
positions
);
compareWithExpectedForceAndEnergy
(
context
,
*
amoeba
Harmonic
BondForce
,
TOL
,
"testTwoBond"
,
log
);
compareWithExpectedForceAndEnergy
(
context
,
*
amoebaBondForce
,
TOL
,
"testTwoBond"
,
log
);
}
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
try
{
std
::
cout
<<
"TestReferenceAmoeba
Harmonic
BondForce running test..."
<<
std
::
endl
;
std
::
cout
<<
"TestReferenceAmoebaBondForce running test..."
<<
std
::
endl
;
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
FILE
*
log
=
NULL
;
//FILE* log = stderr;
...
...
plugins/amoeba/platforms/reference/tests/TestReferenceAmoeba
Harmonic
InPlaneAngleForce.cpp
→
plugins/amoeba/platforms/reference/tests/TestReferenceAmoebaInPlaneAngleForce.cpp
View file @
c6ebf6e2
...
...
@@ -30,7 +30,7 @@
* -------------------------------------------------------------------------- */
/**
* This tests the Reference implementation of ReferenceAmoeba
Harmonic
InPlaneAngleForce.
* This tests the Reference implementation of ReferenceAmoebaInPlaneAngleForce.
*/
#include "openmm/internal/AssertionUtilities.h"
...
...
@@ -119,21 +119,21 @@ static void getPrefactorsGivenInPlaneAngleCosine( double cosine, double idealInP
return
;
}
static
void
computeAmoeba
Harmonic
InPlaneAngleForce
(
int
bondIndex
,
std
::
vector
<
Vec3
>&
positions
,
Amoeba
Harmonic
InPlaneAngleForce
&
a
moeba
Harmonic
InPlaneAngleForce
,
static
void
computeAmoebaInPlaneAngleForce
(
int
bondIndex
,
std
::
vector
<
Vec3
>&
positions
,
AmoebaInPlaneAngleForce
&
A
moebaInPlaneAngleForce
,
std
::
vector
<
Vec3
>&
forces
,
double
*
energy
,
FILE
*
log
)
{
int
particle1
,
particle2
,
particle3
,
particle4
;
double
idealInPlaneAngle
;
double
quadraticK
;
a
moeba
Harmonic
InPlaneAngleForce
.
getAngleParameters
(
bondIndex
,
particle1
,
particle2
,
particle3
,
particle4
,
idealInPlaneAngle
,
quadraticK
);
A
moebaInPlaneAngleForce
.
getAngleParameters
(
bondIndex
,
particle1
,
particle2
,
particle3
,
particle4
,
idealInPlaneAngle
,
quadraticK
);
double
cubicK
=
a
moeba
Harmonic
InPlaneAngleForce
.
getAmoebaGlobal
Harmonic
InPlaneAngleCubic
();
double
quarticK
=
a
moeba
Harmonic
InPlaneAngleForce
.
getAmoebaGlobal
Harmonic
InPlaneAngleQuartic
();
double
penticK
=
a
moeba
Harmonic
InPlaneAngleForce
.
getAmoebaGlobal
Harmonic
InPlaneAnglePentic
();
double
sexticK
=
a
moeba
Harmonic
InPlaneAngleForce
.
getAmoebaGlobal
Harmonic
InPlaneAngleSextic
();
double
cubicK
=
A
moebaInPlaneAngleForce
.
getAmoebaGlobalInPlaneAngleCubic
();
double
quarticK
=
A
moebaInPlaneAngleForce
.
getAmoebaGlobalInPlaneAngleQuartic
();
double
penticK
=
A
moebaInPlaneAngleForce
.
getAmoebaGlobalInPlaneAnglePentic
();
double
sexticK
=
A
moebaInPlaneAngleForce
.
getAmoebaGlobalInPlaneAngleSextic
();
#ifdef AMOEBA_DEBUG
if
(
log
){
(
void
)
fprintf
(
log
,
"computeAmoeba
Harmonic
InPlaneAngleForce: bond %d [%d %d %d %d] ang=%10.3f k=%10.3f [%10.3e %10.3e %10.3e %10.3e]
\n
"
,
(
void
)
fprintf
(
log
,
"computeAmoebaInPlaneAngleForce: bond %d [%d %d %d %d] ang=%10.3f k=%10.3f [%10.3e %10.3e %10.3e %10.3e]
\n
"
,
bondIndex
,
particle1
,
particle2
,
particle3
,
particle4
,
idealInPlaneAngle
,
quadraticK
,
cubicK
,
quarticK
,
penticK
,
sexticK
);
(
void
)
fflush
(
log
);
}
...
...
@@ -180,7 +180,7 @@ static void computeAmoebaHarmonicInPlaneAngleForce(int bondIndex, std::vector<V
if
(
rAp2
<=
0.0
&&
rCp2
<=
0.0
){
#ifdef AMOEBA_DEBUG
if
(
log
){
(
void
)
fprintf
(
log
,
"computeAmoeba
Harmonic
InPlaneAngleForce: rAp2 or rCp2 <= 0.0
\n
"
);
(
void
)
fprintf
(
log
,
"computeAmoebaInPlaneAngleForce: rAp2 or rCp2 <= 0.0
\n
"
);
(
void
)
fflush
(
log
);
}
#endif
...
...
@@ -275,7 +275,7 @@ static void computeAmoebaHarmonicInPlaneAngleForce(int bondIndex, std::vector<V
}
static
void
computeAmoeba
Harmonic
InPlaneAngleForces
(
Context
&
context
,
Amoeba
Harmonic
InPlaneAngleForce
&
a
moeba
Harmonic
InPlaneAngleForce
,
static
void
computeAmoebaInPlaneAngleForces
(
Context
&
context
,
AmoebaInPlaneAngleForce
&
A
moebaInPlaneAngleForce
,
std
::
vector
<
Vec3
>&
expectedForces
,
double
*
expectedEnergy
,
FILE
*
log
)
{
// get positions and zero forces
...
...
@@ -291,12 +291,12 @@ static void computeAmoebaHarmonicInPlaneAngleForces( Context& context, AmoebaHar
// calculates forces/energy
*
expectedEnergy
=
0.0
;
for
(
int
ii
=
0
;
ii
<
a
moeba
Harmonic
InPlaneAngleForce
.
getNumAngles
();
ii
++
){
computeAmoeba
Harmonic
InPlaneAngleForce
(
ii
,
positions
,
a
moeba
Harmonic
InPlaneAngleForce
,
expectedForces
,
expectedEnergy
,
log
);
for
(
int
ii
=
0
;
ii
<
A
moebaInPlaneAngleForce
.
getNumAngles
();
ii
++
){
computeAmoebaInPlaneAngleForce
(
ii
,
positions
,
A
moebaInPlaneAngleForce
,
expectedForces
,
expectedEnergy
,
log
);
}
#ifdef AMOEBA_DEBUG
if
(
log
){
(
void
)
fprintf
(
log
,
"computeAmoeba
Harmonic
InPlaneAngleForces: expected energy=%14.7e
\n
"
,
*
expectedEnergy
);
(
void
)
fprintf
(
log
,
"computeAmoebaInPlaneAngleForces: expected energy=%14.7e
\n
"
,
*
expectedEnergy
);
for
(
unsigned
int
ii
=
0
;
ii
<
positions
.
size
();
ii
++
){
(
void
)
fprintf
(
log
,
"%6u [%14.7e %14.7e %14.7e]
\n
"
,
ii
,
expectedForces
[
ii
][
0
],
expectedForces
[
ii
][
1
],
expectedForces
[
ii
][
2
]
);
}
...
...
@@ -307,18 +307,18 @@ static void computeAmoebaHarmonicInPlaneAngleForces( Context& context, AmoebaHar
}
void
compareWithExpectedForceAndEnergy
(
Context
&
context
,
Amoeba
Harmonic
InPlaneAngleForce
&
a
moeba
Harmonic
InPlaneAngleForce
,
void
compareWithExpectedForceAndEnergy
(
Context
&
context
,
AmoebaInPlaneAngleForce
&
A
moebaInPlaneAngleForce
,
double
tolerance
,
const
std
::
string
&
idString
,
FILE
*
log
)
{
std
::
vector
<
Vec3
>
expectedForces
;
double
expectedEnergy
;
computeAmoeba
Harmonic
InPlaneAngleForces
(
context
,
a
moeba
Harmonic
InPlaneAngleForce
,
expectedForces
,
&
expectedEnergy
,
log
);
computeAmoebaInPlaneAngleForces
(
context
,
A
moebaInPlaneAngleForce
,
expectedForces
,
&
expectedEnergy
,
log
);
State
state
=
context
.
getState
(
State
::
Forces
|
State
::
Energy
);
const
std
::
vector
<
Vec3
>
forces
=
state
.
getForces
();
#ifdef AMOEBA_DEBUG
if
(
log
){
(
void
)
fprintf
(
log
,
"computeAmoeba
Harmonic
InPlaneAngleForces: expected energy=%14.7e %14.7e
\n
"
,
expectedEnergy
,
state
.
getPotentialEnergy
()
);
(
void
)
fprintf
(
log
,
"computeAmoebaInPlaneAngleForces: expected energy=%14.7e %14.7e
\n
"
,
expectedEnergy
,
state
.
getPotentialEnergy
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
forces
.
size
();
ii
++
){
(
void
)
fprintf
(
log
,
"%6u [%14.7e %14.7e %14.7e] [%14.7e %14.7e %14.7e]
\n
"
,
ii
,
expectedForces
[
ii
][
0
],
expectedForces
[
ii
][
1
],
expectedForces
[
ii
][
2
],
forces
[
ii
][
0
],
forces
[
ii
][
1
],
forces
[
ii
][
2
]
);
...
...
@@ -343,7 +343,7 @@ void testOneAngle( FILE* log ) {
LangevinIntegrator
integrator
(
0.0
,
0.1
,
0.01
);
Amoeba
Harmonic
InPlaneAngleForce
*
amoeba
Harmonic
InPlaneAngleForce
=
new
Amoeba
Harmonic
InPlaneAngleForce
();
AmoebaInPlaneAngleForce
*
amoebaInPlaneAngleForce
=
new
AmoebaInPlaneAngleForce
();
double
angle
=
65.0
;
double
quadraticK
=
1.0
;
...
...
@@ -351,14 +351,14 @@ void testOneAngle( FILE* log ) {
double
quarticK
=
0.0e-02
;
double
penticK
=
0.0e-03
;
double
sexticK
=
0.0e-04
;
amoeba
Harmonic
InPlaneAngleForce
->
addAngle
(
0
,
1
,
2
,
3
,
angle
,
quadraticK
);
amoebaInPlaneAngleForce
->
addAngle
(
0
,
1
,
2
,
3
,
angle
,
quadraticK
);
amoeba
Harmonic
InPlaneAngleForce
->
setAmoebaGlobal
Harmonic
InPlaneAngleCubic
(
cubicK
);
amoeba
Harmonic
InPlaneAngleForce
->
setAmoebaGlobal
Harmonic
InPlaneAngleQuartic
(
quarticK
);
amoeba
Harmonic
InPlaneAngleForce
->
setAmoebaGlobal
Harmonic
InPlaneAnglePentic
(
penticK
);
amoeba
Harmonic
InPlaneAngleForce
->
setAmoebaGlobal
Harmonic
InPlaneAngleSextic
(
sexticK
);
amoebaInPlaneAngleForce
->
setAmoebaGlobalInPlaneAngleCubic
(
cubicK
);
amoebaInPlaneAngleForce
->
setAmoebaGlobalInPlaneAngleQuartic
(
quarticK
);
amoebaInPlaneAngleForce
->
setAmoebaGlobalInPlaneAnglePentic
(
penticK
);
amoebaInPlaneAngleForce
->
setAmoebaGlobalInPlaneAngleSextic
(
sexticK
);
system
.
addForce
(
amoeba
Harmonic
InPlaneAngleForce
);
system
.
addForce
(
amoebaInPlaneAngleForce
);
Context
context
(
system
,
integrator
,
Platform
::
getPlatformByName
(
"Reference"
));
std
::
vector
<
Vec3
>
positions
(
numberOfParticles
);
...
...
@@ -369,18 +369,18 @@ void testOneAngle( FILE* log ) {
positions
[
3
]
=
Vec3
(
1
,
1
,
1
);
context
.
setPositions
(
positions
);
compareWithExpectedForceAndEnergy
(
context
,
*
amoeba
Harmonic
InPlaneAngleForce
,
TOL
,
"testOneInPlaneAngle"
,
log
);
compareWithExpectedForceAndEnergy
(
context
,
*
amoebaInPlaneAngleForce
,
TOL
,
"testOneInPlaneAngle"
,
log
);
}
int
main
(
int
numberOfArguments
,
char
*
argv
[]
)
{
try
{
std
::
cout
<<
"TestReferenceAmoeba
Harmonic
InPlaneAngleForce running test..."
<<
std
::
endl
;
std
::
cout
<<
"TestReferenceAmoebaInPlaneAngleForce running test..."
<<
std
::
endl
;
Platform
::
loadPluginsFromDirectory
(
Platform
::
getDefaultPluginsDirectory
()
);
FILE
*
log
=
NULL
;
//FILE* log = stderr;
//FILE* log = fopen( "Amoeba
Harmonic
InPlaneAngleForce.log", "w" );;
//FILE* log = fopen( "AmoebaInPlaneAngleForce.log", "w" );;
testOneAngle
(
NULL
);
#ifdef AMOEBA_DEBUG
...
...
plugins/amoeba/serialization/include/openmm/serialization/Amoeba
Harmonic
AngleForceProxy.h
→
plugins/amoeba/serialization/include/openmm/serialization/AmoebaAngleForceProxy.h
View file @
c6ebf6e2
#ifndef OPENMM_AMOEBA_
HARMONIC_
ANGLE_FORCE_PROXY_H_
#define OPENMM_AMOEBA_
HARMONIC_
ANGLE_FORCE_PROXY_H_
#ifndef OPENMM_AMOEBA_ANGLE_FORCE_PROXY_H_
#define OPENMM_AMOEBA_ANGLE_FORCE_PROXY_H_
/* -------------------------------------------------------------------------- *
* OpenMMAmoeba *
...
...
@@ -38,16 +38,16 @@
namespace
OpenMM
{
/**
* This is a proxy for serializing Amoeba
Harmonic
AngleForce objects.
* This is a proxy for serializing AmoebaAngleForce objects.
*/
class
OPENMM_EXPORT
Amoeba
Harmonic
AngleForceProxy
:
public
SerializationProxy
{
class
OPENMM_EXPORT
AmoebaAngleForceProxy
:
public
SerializationProxy
{
public:
Amoeba
Harmonic
AngleForceProxy
();
AmoebaAngleForceProxy
();
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
void
*
deserialize
(
const
SerializationNode
&
node
)
const
;
};
}
// namespace OpenMM
#endif
/*OPENMM_AMOEBA_
HARMONIC_
ANGLE_FORCE_PROXY_H_*/
#endif
/*OPENMM_AMOEBA_ANGLE_FORCE_PROXY_H_*/
plugins/amoeba/serialization/include/openmm/serialization/Amoeba
HarmonicInPlaneAngle
ForceProxy.h
→
plugins/amoeba/serialization/include/openmm/serialization/Amoeba
Bond
ForceProxy.h
View file @
c6ebf6e2
#ifndef OPENMM_AMOEBA_
HARMONIC_IN_PLANE_ANGLE
_FORCE_PROXY_H_
#define OPENMM_AMOEBA_
HARMONIC_IN_PLANE_ANGLE
_FORCE_PROXY_H_
#ifndef OPENMM_AMOEBA_
BOND
_FORCE_PROXY_H_
#define OPENMM_AMOEBA_
BOND
_FORCE_PROXY_H_
/* -------------------------------------------------------------------------- *
* OpenMMAmoeba *
...
...
@@ -38,16 +38,16 @@
namespace
OpenMM
{
/**
* This is a proxy for serializing Amoeba
HarmonicInPlaneAngle
Force objects.
* This is a proxy for serializing Amoeba
Bond
Force objects.
*/
class
OPENMM_EXPORT
Amoeba
HarmonicInPlaneAngle
ForceProxy
:
public
SerializationProxy
{
class
OPENMM_EXPORT
Amoeba
Bond
ForceProxy
:
public
SerializationProxy
{
public:
Amoeba
HarmonicInPlaneAngle
ForceProxy
();
Amoeba
Bond
ForceProxy
();
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
void
*
deserialize
(
const
SerializationNode
&
node
)
const
;
};
}
// namespace OpenMM
#endif
/*OPENMM_AMOEBA_
HARMONIC_IN_PLANE_ANGLE
_FORCE_PROXY_H_*/
#endif
/*OPENMM_AMOEBA_
BOND
_FORCE_PROXY_H_*/
plugins/amoeba/serialization/include/openmm/serialization/Amoeba
HarmonicBond
ForceProxy.h
→
plugins/amoeba/serialization/include/openmm/serialization/Amoeba
InPlaneAngle
ForceProxy.h
View file @
c6ebf6e2
#ifndef OPENMM_AMOEBA_
HARMONIC_BOND
_FORCE_PROXY_H_
#define OPENMM_AMOEBA_
HARMONIC_BOND
_FORCE_PROXY_H_
#ifndef OPENMM_AMOEBA_
IN_PLANE_ANGLE
_FORCE_PROXY_H_
#define OPENMM_AMOEBA_
IN_PLANE_ANGLE
_FORCE_PROXY_H_
/* -------------------------------------------------------------------------- *
* OpenMMAmoeba *
...
...
@@ -38,16 +38,16 @@
namespace
OpenMM
{
/**
* This is a proxy for serializing Amoeba
HarmonicBond
Force objects.
* This is a proxy for serializing Amoeba
InPlaneAngle
Force objects.
*/
class
OPENMM_EXPORT
Amoeba
HarmonicBond
ForceProxy
:
public
SerializationProxy
{
class
OPENMM_EXPORT
Amoeba
InPlaneAngle
ForceProxy
:
public
SerializationProxy
{
public:
Amoeba
HarmonicBond
ForceProxy
();
Amoeba
InPlaneAngle
ForceProxy
();
void
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
;
void
*
deserialize
(
const
SerializationNode
&
node
)
const
;
};
}
// namespace OpenMM
#endif
/*OPENMM_AMOEBA_
HARMONIC_BOND
_FORCE_PROXY_H_*/
#endif
/*OPENMM_AMOEBA_
IN_PLANE_ANGLE
_FORCE_PROXY_H_*/
plugins/amoeba/serialization/src/Amoeba
Harmonic
AngleForceProxy.cpp
→
plugins/amoeba/serialization/src/AmoebaAngleForceProxy.cpp
View file @
c6ebf6e2
...
...
@@ -29,27 +29,27 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/serialization/Amoeba
Harmonic
AngleForceProxy.h"
#include "openmm/serialization/AmoebaAngleForceProxy.h"
#include "openmm/serialization/SerializationNode.h"
#include "openmm/Force.h"
#include "openmm/Amoeba
Harmonic
AngleForce.h"
#include "openmm/AmoebaAngleForce.h"
#include <sstream>
using
namespace
OpenMM
;
using
namespace
std
;
Amoeba
Harmonic
AngleForceProxy
::
Amoeba
Harmonic
AngleForceProxy
()
:
SerializationProxy
(
"Amoeba
Harmonic
AngleForce"
)
{
AmoebaAngleForceProxy
::
AmoebaAngleForceProxy
()
:
SerializationProxy
(
"AmoebaAngleForce"
)
{
}
void
Amoeba
Harmonic
AngleForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
AmoebaAngleForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
const
Amoeba
Harmonic
AngleForce
&
force
=
*
reinterpret_cast
<
const
Amoeba
Harmonic
AngleForce
*>
(
object
);
const
AmoebaAngleForce
&
force
=
*
reinterpret_cast
<
const
AmoebaAngleForce
*>
(
object
);
node
.
setDoubleProperty
(
"
HarmonicAngleC
ubic"
,
force
.
getAmoebaGlobal
Harmonic
AngleCubic
());
node
.
setDoubleProperty
(
"
HarmonicAngleQ
uartic"
,
force
.
getAmoebaGlobal
Harmonic
AngleQuartic
());
node
.
setDoubleProperty
(
"
HarmonicAngleP
entic"
,
force
.
getAmoebaGlobal
Harmonic
AnglePentic
());
node
.
setDoubleProperty
(
"
HarmonicAngleS
extic"
,
force
.
getAmoebaGlobal
Harmonic
AngleSextic
());
node
.
setDoubleProperty
(
"
c
ubic"
,
force
.
getAmoebaGlobalAngleCubic
());
node
.
setDoubleProperty
(
"
q
uartic"
,
force
.
getAmoebaGlobalAngleQuartic
());
node
.
setDoubleProperty
(
"
p
entic"
,
force
.
getAmoebaGlobalAnglePentic
());
node
.
setDoubleProperty
(
"
s
extic"
,
force
.
getAmoebaGlobalAngleSextic
());
SerializationNode
&
bonds
=
node
.
createChildNode
(
"Angles"
).
setIntProperty
(
"size"
,
force
.
getNumAngles
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumAngles
());
ii
++
)
{
...
...
@@ -60,16 +60,16 @@ void AmoebaHarmonicAngleForceProxy::serialize(const void* object, SerializationN
}
}
void
*
Amoeba
Harmonic
AngleForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
void
*
AmoebaAngleForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
if
(
node
.
getIntProperty
(
"version"
)
!=
1
)
throw
OpenMMException
(
"Unsupported version number"
);
Amoeba
Harmonic
AngleForce
*
force
=
new
Amoeba
Harmonic
AngleForce
();
AmoebaAngleForce
*
force
=
new
AmoebaAngleForce
();
try
{
force
->
setAmoebaGlobal
Harmonic
AngleCubic
(
node
.
getDoubleProperty
(
"
HarmonicAngleC
ubic"
));
force
->
setAmoebaGlobal
Harmonic
AngleQuartic
(
node
.
getDoubleProperty
(
"
HarmonicAngleQ
uartic"
));
force
->
setAmoebaGlobal
Harmonic
AnglePentic
(
node
.
getDoubleProperty
(
"
HarmonicAngleP
entic"
));
force
->
setAmoebaGlobal
Harmonic
AngleSextic
(
node
.
getDoubleProperty
(
"
HarmonicAngleS
extic"
));
force
->
setAmoebaGlobalAngleCubic
(
node
.
getDoubleProperty
(
"
c
ubic"
));
force
->
setAmoebaGlobalAngleQuartic
(
node
.
getDoubleProperty
(
"
q
uartic"
));
force
->
setAmoebaGlobalAnglePentic
(
node
.
getDoubleProperty
(
"
p
entic"
));
force
->
setAmoebaGlobalAngleSextic
(
node
.
getDoubleProperty
(
"
s
extic"
));
const
SerializationNode
&
bonds
=
node
.
getChildNode
(
"Angles"
);
for
(
unsigned
int
ii
=
0
;
ii
<
bonds
.
getChildren
().
size
();
ii
++
)
{
...
...
plugins/amoeba/serialization/src/Amoeba
Harmonic
BondForceProxy.cpp
→
plugins/amoeba/serialization/src/AmoebaBondForceProxy.cpp
View file @
c6ebf6e2
...
...
@@ -29,24 +29,24 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/serialization/Amoeba
Harmonic
BondForceProxy.h"
#include "openmm/serialization/AmoebaBondForceProxy.h"
#include "openmm/serialization/SerializationNode.h"
#include "openmm/Force.h"
#include "openmm/Amoeba
Harmonic
BondForce.h"
#include "openmm/AmoebaBondForce.h"
#include <sstream>
using
namespace
OpenMM
;
using
namespace
std
;
Amoeba
Harmonic
BondForceProxy
::
Amoeba
Harmonic
BondForceProxy
()
:
SerializationProxy
(
"Amoeba
Harmonic
BondForce"
)
{
AmoebaBondForceProxy
::
AmoebaBondForceProxy
()
:
SerializationProxy
(
"AmoebaBondForce"
)
{
}
void
Amoeba
Harmonic
BondForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
AmoebaBondForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
const
Amoeba
Harmonic
BondForce
&
force
=
*
reinterpret_cast
<
const
Amoeba
Harmonic
BondForce
*>
(
object
);
const
AmoebaBondForce
&
force
=
*
reinterpret_cast
<
const
AmoebaBondForce
*>
(
object
);
node
.
setDoubleProperty
(
"
HarmonicBondC
ubic"
,
force
.
getAmoebaGlobal
Harmonic
BondCubic
());
node
.
setDoubleProperty
(
"
HarmonicBondQ
uartic"
,
force
.
getAmoebaGlobal
Harmonic
BondQuartic
());
node
.
setDoubleProperty
(
"
c
ubic"
,
force
.
getAmoebaGlobalBondCubic
());
node
.
setDoubleProperty
(
"
q
uartic"
,
force
.
getAmoebaGlobalBondQuartic
());
SerializationNode
&
bonds
=
node
.
createChildNode
(
"Bonds"
).
setIntProperty
(
"size"
,
force
.
getNumBonds
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumBonds
());
ii
++
)
{
...
...
@@ -57,13 +57,13 @@ void AmoebaHarmonicBondForceProxy::serialize(const void* object, SerializationNo
}
}
void
*
Amoeba
Harmonic
BondForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
void
*
AmoebaBondForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
if
(
node
.
getIntProperty
(
"version"
)
!=
1
)
throw
OpenMMException
(
"Unsupported version number"
);
Amoeba
Harmonic
BondForce
*
force
=
new
Amoeba
Harmonic
BondForce
();
AmoebaBondForce
*
force
=
new
AmoebaBondForce
();
try
{
force
->
setAmoebaGlobal
Harmonic
BondCubic
(
node
.
getDoubleProperty
(
"
HarmonicB
ondCubic"
));
force
->
setAmoebaGlobal
Harmonic
BondQuartic
(
node
.
getDoubleProperty
(
"
HarmonicBondQ
uartic"
));
force
->
setAmoebaGlobalBondCubic
(
node
.
getDoubleProperty
(
"
c
ondCubic"
));
force
->
setAmoebaGlobalBondQuartic
(
node
.
getDoubleProperty
(
"
q
uartic"
));
const
SerializationNode
&
bonds
=
node
.
getChildNode
(
"Bonds"
);
for
(
unsigned
int
ii
=
0
;
ii
<
(
int
)
bonds
.
getChildren
().
size
();
ii
++
)
{
const
SerializationNode
&
bond
=
bonds
.
getChildren
()[
ii
];
...
...
plugins/amoeba/serialization/src/Amoeba
Harmonic
InPlaneAngleForceProxy.cpp
→
plugins/amoeba/serialization/src/AmoebaInPlaneAngleForceProxy.cpp
View file @
c6ebf6e2
...
...
@@ -29,27 +29,27 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/serialization/Amoeba
Harmonic
InPlaneAngleForceProxy.h"
#include "openmm/serialization/AmoebaInPlaneAngleForceProxy.h"
#include "openmm/serialization/SerializationNode.h"
#include "openmm/Force.h"
#include "openmm/Amoeba
Harmonic
InPlaneAngleForce.h"
#include "openmm/AmoebaInPlaneAngleForce.h"
#include <sstream>
using
namespace
OpenMM
;
using
namespace
std
;
Amoeba
Harmonic
InPlaneAngleForceProxy
::
Amoeba
Harmonic
InPlaneAngleForceProxy
()
:
SerializationProxy
(
"Amoeba
Harmonic
InPlaneAngleForce"
)
{
AmoebaInPlaneAngleForceProxy
::
AmoebaInPlaneAngleForceProxy
()
:
SerializationProxy
(
"AmoebaInPlaneAngleForce"
)
{
}
void
Amoeba
Harmonic
InPlaneAngleForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
void
AmoebaInPlaneAngleForceProxy
::
serialize
(
const
void
*
object
,
SerializationNode
&
node
)
const
{
node
.
setIntProperty
(
"version"
,
1
);
const
Amoeba
Harmonic
InPlaneAngleForce
&
force
=
*
reinterpret_cast
<
const
Amoeba
Harmonic
InPlaneAngleForce
*>
(
object
);
const
AmoebaInPlaneAngleForce
&
force
=
*
reinterpret_cast
<
const
AmoebaInPlaneAngleForce
*>
(
object
);
node
.
setDoubleProperty
(
"
HarmonicInPlaneAngleC
ubic"
,
force
.
getAmoebaGlobal
Harmonic
InPlaneAngleCubic
());
node
.
setDoubleProperty
(
"
HarmonicInPlaneAngleQ
uartic"
,
force
.
getAmoebaGlobal
Harmonic
InPlaneAngleQuartic
());
node
.
setDoubleProperty
(
"
HarmonicInPlaneAngleP
entic"
,
force
.
getAmoebaGlobal
Harmonic
InPlaneAnglePentic
());
node
.
setDoubleProperty
(
"
HarmonicInPlaneAngleS
extic"
,
force
.
getAmoebaGlobal
Harmonic
InPlaneAngleSextic
());
node
.
setDoubleProperty
(
"
c
ubic"
,
force
.
getAmoebaGlobalInPlaneAngleCubic
());
node
.
setDoubleProperty
(
"
q
uartic"
,
force
.
getAmoebaGlobalInPlaneAngleQuartic
());
node
.
setDoubleProperty
(
"
p
entic"
,
force
.
getAmoebaGlobalInPlaneAnglePentic
());
node
.
setDoubleProperty
(
"
s
extic"
,
force
.
getAmoebaGlobalInPlaneAngleSextic
());
SerializationNode
&
bonds
=
node
.
createChildNode
(
"InPlaneAngles"
).
setIntProperty
(
"size"
,
force
.
getNumAngles
()
);
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force
.
getNumAngles
());
ii
++
)
{
...
...
@@ -60,16 +60,16 @@ void AmoebaHarmonicInPlaneAngleForceProxy::serialize(const void* object, Seriali
}
}
void
*
Amoeba
Harmonic
InPlaneAngleForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
void
*
AmoebaInPlaneAngleForceProxy
::
deserialize
(
const
SerializationNode
&
node
)
const
{
if
(
node
.
getIntProperty
(
"version"
)
!=
1
)
throw
OpenMMException
(
"Unsupported version number"
);
Amoeba
Harmonic
InPlaneAngleForce
*
force
=
new
Amoeba
Harmonic
InPlaneAngleForce
();
AmoebaInPlaneAngleForce
*
force
=
new
AmoebaInPlaneAngleForce
();
try
{
force
->
setAmoebaGlobal
Harmonic
InPlaneAngleCubic
(
node
.
getDoubleProperty
(
"
HarmonicInPlaneAngleC
ubic"
));
force
->
setAmoebaGlobal
Harmonic
InPlaneAngleQuartic
(
node
.
getDoubleProperty
(
"
HarmonicInPlaneAngleQ
uartic"
));
force
->
setAmoebaGlobal
Harmonic
InPlaneAnglePentic
(
node
.
getDoubleProperty
(
"
HarmonicInPlaneAngleP
entic"
));
force
->
setAmoebaGlobal
Harmonic
InPlaneAngleSextic
(
node
.
getDoubleProperty
(
"
HarmonicInPlaneAngleS
extic"
));
force
->
setAmoebaGlobalInPlaneAngleCubic
(
node
.
getDoubleProperty
(
"
c
ubic"
));
force
->
setAmoebaGlobalInPlaneAngleQuartic
(
node
.
getDoubleProperty
(
"
q
uartic"
));
force
->
setAmoebaGlobalInPlaneAnglePentic
(
node
.
getDoubleProperty
(
"
p
entic"
));
force
->
setAmoebaGlobalInPlaneAngleSextic
(
node
.
getDoubleProperty
(
"
s
extic"
));
const
SerializationNode
&
bonds
=
node
.
getChildNode
(
"InPlaneAngles"
);
for
(
unsigned
int
ii
=
0
;
ii
<
bonds
.
getChildren
().
size
();
ii
++
)
{
...
...
plugins/amoeba/serialization/src/AmoebaSerializationProxyRegistration.cpp
View file @
c6ebf6e2
...
...
@@ -41,9 +41,9 @@
#include "openmm/OpenMMException.h"
#include "openmm/AmoebaGeneralizedKirkwoodForce.h"
#include "openmm/Amoeba
Harmonic
BondForce.h"
#include "openmm/Amoeba
Harmonic
AngleForce.h"
#include "openmm/Amoeba
Harmonic
InPlaneAngleForce.h"
#include "openmm/AmoebaBondForce.h"
#include "openmm/AmoebaAngleForce.h"
#include "openmm/AmoebaInPlaneAngleForce.h"
#include "openmm/AmoebaMultipoleForce.h"
#include "openmm/AmoebaOutOfPlaneBendForce.h"
#include "openmm/AmoebaPiTorsionForce.h"
...
...
@@ -55,9 +55,9 @@
#include "openmm/serialization/SerializationProxy.h"
#include "openmm/serialization/AmoebaGeneralizedKirkwoodForceProxy.h"
#include "openmm/serialization/Amoeba
Harmonic
BondForceProxy.h"
#include "openmm/serialization/Amoeba
Harmonic
AngleForceProxy.h"
#include "openmm/serialization/Amoeba
Harmonic
InPlaneAngleForceProxy.h"
#include "openmm/serialization/AmoebaBondForceProxy.h"
#include "openmm/serialization/AmoebaAngleForceProxy.h"
#include "openmm/serialization/AmoebaInPlaneAngleForceProxy.h"
#include "openmm/serialization/AmoebaMultipoleForceProxy.h"
#include "openmm/serialization/AmoebaOutOfPlaneBendForceProxy.h"
#include "openmm/serialization/AmoebaPiTorsionForceProxy.h"
...
...
@@ -82,9 +82,9 @@ using namespace OpenMM;
extern
"C"
void
registerAmoebaSerializationProxies
()
{
SerializationProxy
::
registerProxy
(
typeid
(
AmoebaGeneralizedKirkwoodForce
),
new
AmoebaGeneralizedKirkwoodForceProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
Amoeba
Harmonic
BondForce
),
new
Amoeba
Harmonic
BondForceProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
Amoeba
Harmonic
AngleForce
),
new
Amoeba
Harmonic
AngleForceProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
Amoeba
Harmonic
InPlaneAngleForce
),
new
Amoeba
Harmonic
InPlaneAngleForceProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
AmoebaBondForce
),
new
AmoebaBondForceProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
AmoebaAngleForce
),
new
AmoebaAngleForceProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
AmoebaInPlaneAngleForce
),
new
AmoebaInPlaneAngleForceProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
AmoebaMultipoleForce
),
new
AmoebaMultipoleForceProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
AmoebaOutOfPlaneBendForce
),
new
AmoebaOutOfPlaneBendForceProxy
());
SerializationProxy
::
registerProxy
(
typeid
(
AmoebaPiTorsionForce
),
new
AmoebaPiTorsionForceProxy
());
...
...
plugins/amoeba/serialization/tests/TestSerializeAmoeba
Harmonic
AngleForce.cpp
→
plugins/amoeba/serialization/tests/TestSerializeAmoebaAngleForce.cpp
View file @
c6ebf6e2
...
...
@@ -30,7 +30,7 @@
* -------------------------------------------------------------------------- */
#include "openmm/internal/AssertionUtilities.h"
#include "openmm/Amoeba
Harmonic
AngleForce.h"
#include "openmm/AmoebaAngleForce.h"
#include "openmm/serialization/XmlSerializer.h"
#include <iostream>
#include <sstream>
...
...
@@ -41,11 +41,11 @@ using namespace std;
void
testSerialization
()
{
// Create a Force.
Amoeba
Harmonic
AngleForce
force1
;
force1
.
setAmoebaGlobal
Harmonic
AngleCubic
(
12.3
);
force1
.
setAmoebaGlobal
Harmonic
AngleQuartic
(
98.7
);
force1
.
setAmoebaGlobal
Harmonic
AnglePentic
(
91.7
);
force1
.
setAmoebaGlobal
Harmonic
AngleSextic
(
93.7
);
AmoebaAngleForce
force1
;
force1
.
setAmoebaGlobalAngleCubic
(
12.3
);
force1
.
setAmoebaGlobalAngleQuartic
(
98.7
);
force1
.
setAmoebaGlobalAnglePentic
(
91.7
);
force1
.
setAmoebaGlobalAngleSextic
(
93.7
);
force1
.
addAngle
(
0
,
1
,
3
,
1.0
,
2.0
);
force1
.
addAngle
(
0
,
2
,
3
,
2.0
,
2.1
);
force1
.
addAngle
(
2
,
3
,
5
,
3.0
,
2.2
);
...
...
@@ -54,15 +54,15 @@ void testSerialization() {
// Serialize and then deserialize it.
stringstream
buffer
;
XmlSerializer
::
serialize
<
Amoeba
Harmonic
AngleForce
>
(
&
force1
,
"Force"
,
buffer
);
Amoeba
Harmonic
AngleForce
*
copy
=
XmlSerializer
::
deserialize
<
Amoeba
Harmonic
AngleForce
>
(
buffer
);
XmlSerializer
::
serialize
<
AmoebaAngleForce
>
(
&
force1
,
"Force"
,
buffer
);
AmoebaAngleForce
*
copy
=
XmlSerializer
::
deserialize
<
AmoebaAngleForce
>
(
buffer
);
// Compare the two forces to see if they are identical.
Amoeba
Harmonic
AngleForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force1
.
getAmoebaGlobal
Harmonic
AngleCubic
(),
force2
.
getAmoebaGlobal
Harmonic
AngleCubic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobal
Harmonic
AngleQuartic
(),
force2
.
getAmoebaGlobal
Harmonic
AngleQuartic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobal
Harmonic
AnglePentic
(),
force2
.
getAmoebaGlobal
Harmonic
AnglePentic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobal
Harmonic
AngleSextic
(),
force2
.
getAmoebaGlobal
Harmonic
AngleSextic
());
AmoebaAngleForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalAngleCubic
(),
force2
.
getAmoebaGlobalAngleCubic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalAngleQuartic
(),
force2
.
getAmoebaGlobalAngleQuartic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalAnglePentic
(),
force2
.
getAmoebaGlobalAnglePentic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalAngleSextic
(),
force2
.
getAmoebaGlobalAngleSextic
());
ASSERT_EQUAL
(
force1
.
getNumAngles
(),
force2
.
getNumAngles
());
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force1
.
getNumAngles
());
ii
++
)
{
int
a1
,
a2
,
a3
,
b1
,
b2
,
b3
;
...
...
plugins/amoeba/serialization/tests/TestSerializeAmoeba
Harmonic
BondForce.cpp
→
plugins/amoeba/serialization/tests/TestSerializeAmoebaBondForce.cpp
View file @
c6ebf6e2
...
...
@@ -30,7 +30,7 @@
* -------------------------------------------------------------------------- */
#include "openmm/internal/AssertionUtilities.h"
#include "openmm/Amoeba
Harmonic
BondForce.h"
#include "openmm/AmoebaBondForce.h"
#include "openmm/serialization/XmlSerializer.h"
#include <iostream>
#include <sstream>
...
...
@@ -41,9 +41,9 @@ using namespace std;
void
testSerialization
()
{
// Create a Force.
Amoeba
Harmonic
BondForce
force1
;
force1
.
setAmoebaGlobal
Harmonic
BondCubic
(
12.3
);
force1
.
setAmoebaGlobal
Harmonic
BondQuartic
(
98.7
);
AmoebaBondForce
force1
;
force1
.
setAmoebaGlobalBondCubic
(
12.3
);
force1
.
setAmoebaGlobalBondQuartic
(
98.7
);
force1
.
addBond
(
0
,
1
,
1.0
,
2.0
);
force1
.
addBond
(
0
,
2
,
2.0
,
2.1
);
force1
.
addBond
(
2
,
3
,
3.0
,
2.2
);
...
...
@@ -52,13 +52,13 @@ void testSerialization() {
// Serialize and then deserialize it.
stringstream
buffer
;
XmlSerializer
::
serialize
<
Amoeba
Harmonic
BondForce
>
(
&
force1
,
"Force"
,
buffer
);
Amoeba
Harmonic
BondForce
*
copy
=
XmlSerializer
::
deserialize
<
Amoeba
Harmonic
BondForce
>
(
buffer
);
XmlSerializer
::
serialize
<
AmoebaBondForce
>
(
&
force1
,
"Force"
,
buffer
);
AmoebaBondForce
*
copy
=
XmlSerializer
::
deserialize
<
AmoebaBondForce
>
(
buffer
);
// Compare the two forces to see if they are identical.
Amoeba
Harmonic
BondForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force1
.
getAmoebaGlobal
Harmonic
BondCubic
(),
force2
.
getAmoebaGlobal
Harmonic
BondCubic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobal
Harmonic
BondQuartic
(),
force2
.
getAmoebaGlobal
Harmonic
BondQuartic
());
AmoebaBondForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalBondCubic
(),
force2
.
getAmoebaGlobalBondCubic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalBondQuartic
(),
force2
.
getAmoebaGlobalBondQuartic
());
ASSERT_EQUAL
(
force1
.
getNumBonds
(),
force2
.
getNumBonds
());
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force1
.
getNumBonds
());
ii
++
)
{
int
a1
,
a2
,
b1
,
b2
;
...
...
plugins/amoeba/serialization/tests/TestSerializeAmoeba
Harmonic
InPlaneAngleForce.cpp
→
plugins/amoeba/serialization/tests/TestSerializeAmoebaInPlaneAngleForce.cpp
View file @
c6ebf6e2
...
...
@@ -30,7 +30,7 @@
* -------------------------------------------------------------------------- */
#include "openmm/internal/AssertionUtilities.h"
#include "openmm/Amoeba
Harmonic
InPlaneAngleForce.h"
#include "openmm/AmoebaInPlaneAngleForce.h"
#include "openmm/serialization/XmlSerializer.h"
#include <iostream>
#include <sstream>
...
...
@@ -41,12 +41,12 @@ using namespace std;
void
testSerialization
()
{
// Create a Force.
Amoeba
Harmonic
InPlaneAngleForce
force1
;
AmoebaInPlaneAngleForce
force1
;
force1
.
setAmoebaGlobal
Harmonic
InPlaneAngleCubic
(
12.3
);
force1
.
setAmoebaGlobal
Harmonic
InPlaneAngleQuartic
(
98.7
);
force1
.
setAmoebaGlobal
Harmonic
InPlaneAnglePentic
(
91.7
);
force1
.
setAmoebaGlobal
Harmonic
InPlaneAngleSextic
(
93.7
);
force1
.
setAmoebaGlobalInPlaneAngleCubic
(
12.3
);
force1
.
setAmoebaGlobalInPlaneAngleQuartic
(
98.7
);
force1
.
setAmoebaGlobalInPlaneAnglePentic
(
91.7
);
force1
.
setAmoebaGlobalInPlaneAngleSextic
(
93.7
);
force1
.
addAngle
(
0
,
1
,
3
,
4
,
1.0
,
2.0
);
force1
.
addAngle
(
0
,
2
,
3
,
5
,
2.0
,
2.1
);
...
...
@@ -56,16 +56,16 @@ void testSerialization() {
// Serialize and then deserialize it.
stringstream
buffer
;
XmlSerializer
::
serialize
<
Amoeba
Harmonic
InPlaneAngleForce
>
(
&
force1
,
"Force"
,
buffer
);
Amoeba
Harmonic
InPlaneAngleForce
*
copy
=
XmlSerializer
::
deserialize
<
Amoeba
Harmonic
InPlaneAngleForce
>
(
buffer
);
XmlSerializer
::
serialize
<
AmoebaInPlaneAngleForce
>
(
&
force1
,
"Force"
,
buffer
);
AmoebaInPlaneAngleForce
*
copy
=
XmlSerializer
::
deserialize
<
AmoebaInPlaneAngleForce
>
(
buffer
);
// Compare the two forces to see if they are identical.
Amoeba
Harmonic
InPlaneAngleForce
&
force2
=
*
copy
;
AmoebaInPlaneAngleForce
&
force2
=
*
copy
;
ASSERT_EQUAL
(
force1
.
getAmoebaGlobal
Harmonic
InPlaneAngleCubic
(),
force2
.
getAmoebaGlobal
Harmonic
InPlaneAngleCubic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobal
Harmonic
InPlaneAngleQuartic
(),
force2
.
getAmoebaGlobal
Harmonic
InPlaneAngleQuartic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobal
Harmonic
InPlaneAnglePentic
(),
force2
.
getAmoebaGlobal
Harmonic
InPlaneAnglePentic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobal
Harmonic
InPlaneAngleSextic
(),
force2
.
getAmoebaGlobal
Harmonic
InPlaneAngleSextic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalInPlaneAngleCubic
(),
force2
.
getAmoebaGlobalInPlaneAngleCubic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalInPlaneAngleQuartic
(),
force2
.
getAmoebaGlobalInPlaneAngleQuartic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalInPlaneAnglePentic
(),
force2
.
getAmoebaGlobalInPlaneAnglePentic
());
ASSERT_EQUAL
(
force1
.
getAmoebaGlobalInPlaneAngleSextic
(),
force2
.
getAmoebaGlobalInPlaneAngleSextic
());
ASSERT_EQUAL
(
force1
.
getNumAngles
(),
force2
.
getNumAngles
());
for
(
unsigned
int
ii
=
0
;
ii
<
static_cast
<
unsigned
int
>
(
force1
.
getNumAngles
());
ii
++
)
{
...
...
wrappers/python/simtk/openmm/app/data/amoeba2009.xml
View file @
c6ebf6e2
...
...
@@ -3543,7 +3543,7 @@
<Atom name="LI" type="382"/>
</Residue>
</Residues>
<Amoeba
Harmonic
BondForce bond-cubic="-25.5" bond-quartic="379.3125">
<AmoebaBondForce bond-cubic="-25.5" bond-quartic="379.3125">
<Bond class1="1" class2="2" length="0.1437" k="156900.0"/>
<Bond class1="1" class2="3" length="0.1345" k="201668.8"/>
<Bond class1="1" class2="4" length="0.1028" k="203760.8"/>
...
...
@@ -3664,8 +3664,8 @@
<Bond class1="69" class2="69" length="0.1513" k="133929.84"/>
<Bond class1="70" class2="71" length="0.148" k="325054.96"/>
<Bond class1="73" class2="74" length="0.09572" k="221584.64"/>
</Amoeba
Harmonic
BondForce>
<Amoeba
Harmonic
AngleForce angle-cubic="-0.014" angle-quartic="5.6e-05" angle-pentic="-7e-07" angle-sextic="2.2e-08">
</AmoebaBondForce>
<AmoebaAngleForce angle-cubic="-0.014" angle-quartic="5.6e-05" angle-pentic="-7e-07" angle-sextic="2.2e-08">
<Angle class1="2" class2="1" class3="3" k="0.0637259642196" angle1="122.00" />
<Angle class1="2" class2="1" class3="4" k="0.0407846171005" angle1="117.00" />
<Angle class1="3" class2="1" class3="4" k="0.0458826942381" angle1="121.00" />
...
...
@@ -3962,7 +3962,7 @@
<Angle class1="62" class2="70" class3="71" k="0.0966850329139" angle1="110.00" />
<Angle class1="71" class2="70" class3="71" k="0.114553793281" angle1="121.20" />
<Angle class1="74" class2="73" class3="74" k="0.0433973816335" angle1="108.50" />
</Amoeba
Harmonic
AngleForce>
</AmoebaAngleForce>
<AmoebaOutOfPlaneBendForce type="ALLINGER" opbend-cubic="-0.014" opbend-quartic="5.6e-05" opbend-pentic="-7e-07" opbend-sextic="2.2e-08">
<Angle class1="2" class2="1" class3="0" class4="0" k="0.0531474541591"/>
<Angle class1="3" class2="1" class3="0" class4="0" k="0.0898536095496"/>
Prev
1
2
3
4
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