Commit c6ebf6e2 authored by Peter Eastman's avatar Peter Eastman
Browse files

Removed the word "harmonic" from lots of places it didn't belong, including class and method names

parent 58b094ce
......@@ -22,15 +22,15 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef __AmoebaReferenceHarmonicBondForce_H__
#define __AmoebaReferenceHarmonicBondForce_H__
#ifndef __AmoebaReferenceBondForce_H__
#define __AmoebaReferenceBondForce_H__
#include "SimTKUtilities/RealVec.h"
#include <vector>
// ---------------------------------------------------------------------------------------
class AmoebaReferenceHarmonicBondForce {
class AmoebaReferenceBondForce {
public:
......@@ -40,7 +40,7 @@ public:
--------------------------------------------------------------------------------------- */
AmoebaReferenceHarmonicBondForce( ){};
AmoebaReferenceBondForce( ){};
/**---------------------------------------------------------------------------------------
......@@ -48,12 +48,12 @@ public:
--------------------------------------------------------------------------------------- */
~AmoebaReferenceHarmonicBondForce( ){};
~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 // _AmoebaReferenceHarmonicBondForce___
#endif // _AmoebaReferenceBondForce___
......@@ -23,7 +23,7 @@
*/
#include "AmoebaReferenceForce.h"
#include "AmoebaReferenceHarmonicInPlaneAngleForce.h"
#include "AmoebaReferenceInPlaneAngleForce.h"
using std::vector;
using OpenMM::RealVec;
......@@ -46,7 +46,7 @@ using OpenMM::RealVec;
--------------------------------------------------------------------------------------- */
RealOpenMM AmoebaReferenceHarmonicInPlaneAngleForce::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 = "AmoebaReferenceHarmonicInPlaneAngleForce::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 AmoebaReferenceHarmonicInPlaneAngleForce::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 = "AmoebaReferenceHarmonicInPlaneAngleForce::calculateHarmonicForce";
//static const std::string methodName = "AmoebaReferenceInPlaneAngleForce::calculateAngleIxn";
static const RealOpenMM zero = 0.0;
static const RealOpenMM one = 1.0;
......@@ -245,7 +245,7 @@ RealOpenMM AmoebaReferenceHarmonicInPlaneAngleForce::calculateAngleIxn( const Re
}
RealOpenMM AmoebaReferenceHarmonicInPlaneAngleForce::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,
......
......@@ -22,15 +22,15 @@
* WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*/
#ifndef __AmoebaReferenceHarmonicInPlaneAngleForce_H__
#define __AmoebaReferenceHarmonicInPlaneAngleForce_H__
#ifndef __AmoebaReferenceInPlaneAngleForce_H__
#define __AmoebaReferenceInPlaneAngleForce_H__
#include "SimTKUtilities/RealVec.h"
#include <vector>
// ---------------------------------------------------------------------------------------
class AmoebaReferenceHarmonicInPlaneAngleForce {
class AmoebaReferenceInPlaneAngleForce {
public:
......@@ -40,7 +40,7 @@ public:
--------------------------------------------------------------------------------------- */
AmoebaReferenceHarmonicInPlaneAngleForce( ){};
AmoebaReferenceInPlaneAngleForce( ){};
/**---------------------------------------------------------------------------------------
......@@ -48,11 +48,11 @@ public:
--------------------------------------------------------------------------------------- */
~AmoebaReferenceHarmonicInPlaneAngleForce( ){};
~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 globalHarmonicAngleCubic,
RealOpenMM globalHarmonicAngleQuartic,
RealOpenMM globalHarmonicAnglePentic,
RealOpenMM globalHarmonicAngleSextic,
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 // _AmoebaReferenceHarmonicInPlaneAngleForce___
#endif // _AmoebaReferenceInPlaneAngleForce___
......@@ -57,7 +57,7 @@ RealOpenMM AmoebaReferenceOutOfPlaneBendForce::calculateOutOfPlaneBendIxn( const
// ---------------------------------------------------------------------------------------
//static const std::string methodName = "AmoebaReferenceOutOfPlaneBendForce::calculateHarmonicForce";
//static const std::string methodName = "AmoebaReferenceOutOfPlaneBendForce::calculateOutOfPlaneBendIxn";
static const RealOpenMM zero = 0.0;
static const RealOpenMM one = 1.0;
......
......@@ -53,7 +53,7 @@ RealOpenMM AmoebaReferencePiTorsionForce::calculatePiTorsionIxn( const RealVec&
// ---------------------------------------------------------------------------------------
//static const std::string methodName = "AmoebaReferencePiTorsionForce::calculateHarmonicForce";
//static const std::string methodName = "AmoebaReferencePiTorsionForce::calculatePiTorsionIxn";
static const RealOpenMM zero = 0.0;
static const RealOpenMM one = 1.0;
......
......@@ -57,7 +57,7 @@ RealOpenMM AmoebaReferenceStretchBendForce::calculateStretchBendIxn( const RealV
// ---------------------------------------------------------------------------------------
//static const std::string methodName = "AmoebaReferenceStretchBendForce::calculateHarmonicForce";
//static const std::string methodName = "AmoebaReferenceStretchBendForce::calculateStretchBendIxn";
static const RealOpenMM zero = 0.0;
static const RealOpenMM one = 1.0;
......
......@@ -30,7 +30,7 @@
* -------------------------------------------------------------------------- */
/**
* This tests the Cuda implementation of CudaAmoebaHarmonicAngleForce.
* 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 computeAmoebaHarmonicAngleForce(int bondIndex, std::vector<Vec3>& positions, AmoebaHarmonicAngleForce& amoebaHarmonicAngleForce,
static void computeAmoebaAngleForce(int bondIndex, std::vector<Vec3>& positions, AmoebaAngleForce& AmoebaAngleForce,
std::vector<Vec3>& forces, double* energy, FILE* log ) {
int particle1, particle2, particle3;
double idealAngle;
double quadraticK;
amoebaHarmonicAngleForce.getAngleParameters(bondIndex, particle1, particle2, particle3, idealAngle, quadraticK );
AmoebaAngleForce.getAngleParameters(bondIndex, particle1, particle2, particle3, idealAngle, quadraticK );
double cubicK = amoebaHarmonicAngleForce.getAmoebaGlobalHarmonicAngleCubic();
double quarticK = amoebaHarmonicAngleForce.getAmoebaGlobalHarmonicAngleQuartic();
double penticK = amoebaHarmonicAngleForce.getAmoebaGlobalHarmonicAnglePentic();
double sexticK = amoebaHarmonicAngleForce.getAmoebaGlobalHarmonicAngleSextic();
double cubicK = AmoebaAngleForce.getAmoebaGlobalAngleCubic();
double quarticK = AmoebaAngleForce.getAmoebaGlobalAngleQuartic();
double penticK = AmoebaAngleForce.getAmoebaGlobalAnglePentic();
double sexticK = AmoebaAngleForce.getAmoebaGlobalAngleSextic();
#ifdef AMOEBA_DEBUG
if( log ){
(void) fprintf( log, "computeAmoebaHarmonicAngleForce: 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 computeAmoebaHarmonicAngleForces( Context& context, AmoebaHarmonicAngleForce& amoebaHarmonicAngleForce,
static void computeAmoebaAngleForces( Context& context, AmoebaAngleForce& AmoebaAngleForce,
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 < amoebaHarmonicAngleForce.getNumAngles(); ii++ ){
computeAmoebaHarmonicAngleForce(ii, positions, amoebaHarmonicAngleForce, expectedForces, expectedEnergy, log );
for( int ii = 0; ii < AmoebaAngleForce.getNumAngles(); ii++ ){
computeAmoebaAngleForce(ii, positions, AmoebaAngleForce, expectedForces, expectedEnergy, log );
}
#ifdef AMOEBA_DEBUG
if( log ){
(void) fprintf( log, "computeAmoebaHarmonicAngleForces: 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, AmoebaHarmonicAngleForce& amoebaHarmonicAngleForce,
void compareWithExpectedForceAndEnergy( Context& context, AmoebaAngleForce& AmoebaAngleForce,
double tolerance, const std::string& idString, FILE* log) {
std::vector<Vec3> expectedForces;
double expectedEnergy;
computeAmoebaHarmonicAngleForces( context, amoebaHarmonicAngleForce, expectedForces, &expectedEnergy, log );
computeAmoebaAngleForces( context, AmoebaAngleForce, 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, "computeAmoebaHarmonicAngleForces: 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);
AmoebaHarmonicAngleForce* amoebaHarmonicAngleForce = new AmoebaHarmonicAngleForce();
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;
amoebaHarmonicAngleForce->addAngle(0, 1, 2, angle, quadraticK);
amoebaAngleForce->addAngle(0, 1, 2, angle, quadraticK);
amoebaHarmonicAngleForce->setAmoebaGlobalHarmonicAngleCubic(cubicK);
amoebaHarmonicAngleForce->setAmoebaGlobalHarmonicAngleQuartic(quarticK);
amoebaHarmonicAngleForce->setAmoebaGlobalHarmonicAnglePentic(penticK);
amoebaHarmonicAngleForce->setAmoebaGlobalHarmonicAngleSextic(sexticK);
amoebaAngleForce->setAmoebaGlobalAngleCubic(cubicK);
amoebaAngleForce->setAmoebaGlobalAngleQuartic(quarticK);
amoebaAngleForce->setAmoebaGlobalAnglePentic(penticK);
amoebaAngleForce->setAmoebaGlobalAngleSextic(sexticK);
system.addForce(amoebaHarmonicAngleForce);
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, *amoebaHarmonicAngleForce, TOL, "testOneAngle", log );
compareWithExpectedForceAndEnergy( context, *amoebaAngleForce, TOL, "testOneAngle", log );
}
int main( int numberOfArguments, char* argv[] ) {
try {
std::cout << "TestCudaAmoebaHarmonicAngleForce running test..." << std::endl;
std::cout << "TestCudaAmoebaAngleForce running test..." << std::endl;
Platform::loadPluginsFromDirectory( Platform::getDefaultPluginsDirectory() );
//FILE* log = fopen( "AmoebaHarmonicAngleForce.log", "w" );;
//FILE* log = fopen( "AmoebaAngleForce.log", "w" );;
FILE* log = NULL;
//FILE* log = stderr;
......
......@@ -30,7 +30,7 @@
* -------------------------------------------------------------------------- */
/**
* This tests the Reference implementation of HarmonicBondForce.
* This tests the Reference implementation of AmoebaBondForce.
*/
#include "openmm/internal/AssertionUtilities.h"
......@@ -45,15 +45,15 @@ using namespace OpenMM;
const double TOL = 1e-5;
static void computeAmoebaHarmonicBondForce(int bondIndex, std::vector<Vec3>& positions, AmoebaHarmonicBondForce& amoebaHarmonicBondForce,
static void computeAmoebaBondForce(int bondIndex, std::vector<Vec3>& positions, AmoebaBondForce& AmoebaBondForce,
std::vector<Vec3>& forces, double* energy ) {
int particle1, particle2;
double bondLength;
double quadraticK;
double cubicK = amoebaHarmonicBondForce.getAmoebaGlobalHarmonicBondCubic();
double quarticK = amoebaHarmonicBondForce.getAmoebaGlobalHarmonicBondQuartic();
amoebaHarmonicBondForce.getBondParameters(bondIndex, particle1, particle2, bondLength, quadraticK );
double cubicK = AmoebaBondForce.getAmoebaGlobalBondCubic();
double quarticK = AmoebaBondForce.getAmoebaGlobalBondQuartic();
AmoebaBondForce.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 computeAmoebaHarmonicBondForces( Context& context, AmoebaHarmonicBondForce& amoebaHarmonicBondForce,
static void computeAmoebaBondForces( Context& context, AmoebaBondForce& AmoebaBondForce,
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 < amoebaHarmonicBondForce.getNumBonds(); ii++ ){
computeAmoebaHarmonicBondForce(ii, positions, amoebaHarmonicBondForce, expectedForces, expectedEnergy );
for( int ii = 0; ii < AmoebaBondForce.getNumBonds(); ii++ ){
computeAmoebaBondForce(ii, positions, AmoebaBondForce, expectedForces, expectedEnergy );
}
#ifdef AMOEBA_DEBUG
if( log ){
(void) fprintf( log, "computeAmoebaHarmonicBondForces: 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, AmoebaHarmonicBondForce& amoebaHarmonicBondForce, double tolerance, const std::string& idString, FILE* log) {
void compareWithExpectedForceAndEnergy( Context& context, AmoebaBondForce& AmoebaBondForce, double tolerance, const std::string& idString, FILE* log) {
std::vector<Vec3> expectedForces;
double expectedEnergy;
computeAmoebaHarmonicBondForces( context, amoebaHarmonicBondForce, expectedForces, &expectedEnergy, NULL );
computeAmoebaBondForces( context, AmoebaBondForce, 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, "computeAmoebaHarmonicBondForces: 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);
AmoebaHarmonicBondForce* amoebaHarmonicBondForce = new AmoebaHarmonicBondForce();
AmoebaBondForce* amoebaBondForce = new AmoebaBondForce();
double bondLength = 1.5;
double quadraticK = 1.0;
double cubicK = 2.0;
double quarticicK = 3.0;
amoebaHarmonicBondForce->setAmoebaGlobalHarmonicBondCubic( cubicK );
amoebaHarmonicBondForce->setAmoebaGlobalHarmonicBondQuartic( quarticicK );
amoebaHarmonicBondForce->addBond(0, 1, bondLength, quadraticK);
amoebaBondForce->setAmoebaGlobalBondCubic( cubicK );
amoebaBondForce->setAmoebaGlobalBondQuartic( quarticicK );
amoebaBondForce->addBond(0, 1, bondLength, quadraticK);
system.addForce(amoebaHarmonicBondForce);
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, *amoebaHarmonicBondForce, 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);
AmoebaHarmonicBondForce* amoebaHarmonicBondForce = new AmoebaHarmonicBondForce();
AmoebaBondForce* amoebaBondForce = new AmoebaBondForce();
double bondLength = 1.5;
double quadraticK = 1.0;
double cubicK = 2.0;
double quarticicK = 3.0;
amoebaHarmonicBondForce->setAmoebaGlobalHarmonicBondCubic( cubicK );
amoebaHarmonicBondForce->setAmoebaGlobalHarmonicBondQuartic( quarticicK );
amoebaHarmonicBondForce->addBond(0, 1, bondLength, quadraticK);
amoebaHarmonicBondForce->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(amoebaHarmonicBondForce);
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, *amoebaHarmonicBondForce, TOL, "testTwoBond", log );
compareWithExpectedForceAndEnergy( context, *amoebaBondForce, TOL, "testTwoBond", log );
}
int main( int numberOfArguments, char* argv[] ) {
try {
std::cout << "TestReferenceAmoebaHarmonicBondForce running test..." << std::endl;
std::cout << "TestReferenceAmoebaBondForce running test..." << std::endl;
Platform::loadPluginsFromDirectory( Platform::getDefaultPluginsDirectory() );
FILE* log = NULL;
//FILE* log = stderr;
......
......@@ -30,7 +30,7 @@
* -------------------------------------------------------------------------- */
/**
* This tests the Reference implementation of ReferenceAmoebaHarmonicInPlaneAngleForce.
* 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 computeAmoebaHarmonicInPlaneAngleForce(int bondIndex, std::vector<Vec3>& positions, AmoebaHarmonicInPlaneAngleForce& amoebaHarmonicInPlaneAngleForce,
static void computeAmoebaInPlaneAngleForce(int bondIndex, std::vector<Vec3>& positions, AmoebaInPlaneAngleForce& AmoebaInPlaneAngleForce,
std::vector<Vec3>& forces, double* energy, FILE* log ) {
int particle1, particle2, particle3, particle4;
double idealInPlaneAngle;
double quadraticK;
amoebaHarmonicInPlaneAngleForce.getAngleParameters(bondIndex, particle1, particle2, particle3, particle4, idealInPlaneAngle, quadraticK );
AmoebaInPlaneAngleForce.getAngleParameters(bondIndex, particle1, particle2, particle3, particle4, idealInPlaneAngle, quadraticK );
double cubicK = amoebaHarmonicInPlaneAngleForce.getAmoebaGlobalHarmonicInPlaneAngleCubic();
double quarticK = amoebaHarmonicInPlaneAngleForce.getAmoebaGlobalHarmonicInPlaneAngleQuartic();
double penticK = amoebaHarmonicInPlaneAngleForce.getAmoebaGlobalHarmonicInPlaneAnglePentic();
double sexticK = amoebaHarmonicInPlaneAngleForce.getAmoebaGlobalHarmonicInPlaneAngleSextic();
double cubicK = AmoebaInPlaneAngleForce.getAmoebaGlobalInPlaneAngleCubic();
double quarticK = AmoebaInPlaneAngleForce.getAmoebaGlobalInPlaneAngleQuartic();
double penticK = AmoebaInPlaneAngleForce.getAmoebaGlobalInPlaneAnglePentic();
double sexticK = AmoebaInPlaneAngleForce.getAmoebaGlobalInPlaneAngleSextic();
#ifdef AMOEBA_DEBUG
if( log ){
(void) fprintf( log, "computeAmoebaHarmonicInPlaneAngleForce: 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, "computeAmoebaHarmonicInPlaneAngleForce: 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 computeAmoebaHarmonicInPlaneAngleForces( Context& context, AmoebaHarmonicInPlaneAngleForce& amoebaHarmonicInPlaneAngleForce,
static void computeAmoebaInPlaneAngleForces( Context& context, AmoebaInPlaneAngleForce& AmoebaInPlaneAngleForce,
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 < amoebaHarmonicInPlaneAngleForce.getNumAngles(); ii++ ){
computeAmoebaHarmonicInPlaneAngleForce(ii, positions, amoebaHarmonicInPlaneAngleForce, expectedForces, expectedEnergy, log );
for( int ii = 0; ii < AmoebaInPlaneAngleForce.getNumAngles(); ii++ ){
computeAmoebaInPlaneAngleForce(ii, positions, AmoebaInPlaneAngleForce, expectedForces, expectedEnergy, log );
}
#ifdef AMOEBA_DEBUG
if( log ){
(void) fprintf( log, "computeAmoebaHarmonicInPlaneAngleForces: 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, AmoebaHarmonicInPlaneAngleForce& amoebaHarmonicInPlaneAngleForce,
void compareWithExpectedForceAndEnergy( Context& context, AmoebaInPlaneAngleForce& AmoebaInPlaneAngleForce,
double tolerance, const std::string& idString, FILE* log) {
std::vector<Vec3> expectedForces;
double expectedEnergy;
computeAmoebaHarmonicInPlaneAngleForces( context, amoebaHarmonicInPlaneAngleForce, expectedForces, &expectedEnergy, log );
computeAmoebaInPlaneAngleForces( context, AmoebaInPlaneAngleForce, 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, "computeAmoebaHarmonicInPlaneAngleForces: 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);
AmoebaHarmonicInPlaneAngleForce* amoebaHarmonicInPlaneAngleForce = new AmoebaHarmonicInPlaneAngleForce();
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;
amoebaHarmonicInPlaneAngleForce->addAngle(0, 1, 2, 3, angle, quadraticK);
amoebaInPlaneAngleForce->addAngle(0, 1, 2, 3, angle, quadraticK);
amoebaHarmonicInPlaneAngleForce->setAmoebaGlobalHarmonicInPlaneAngleCubic(cubicK);
amoebaHarmonicInPlaneAngleForce->setAmoebaGlobalHarmonicInPlaneAngleQuartic(quarticK);
amoebaHarmonicInPlaneAngleForce->setAmoebaGlobalHarmonicInPlaneAnglePentic(penticK);
amoebaHarmonicInPlaneAngleForce->setAmoebaGlobalHarmonicInPlaneAngleSextic(sexticK);
amoebaInPlaneAngleForce->setAmoebaGlobalInPlaneAngleCubic(cubicK);
amoebaInPlaneAngleForce->setAmoebaGlobalInPlaneAngleQuartic(quarticK);
amoebaInPlaneAngleForce->setAmoebaGlobalInPlaneAnglePentic(penticK);
amoebaInPlaneAngleForce->setAmoebaGlobalInPlaneAngleSextic(sexticK);
system.addForce(amoebaHarmonicInPlaneAngleForce);
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, *amoebaHarmonicInPlaneAngleForce, TOL, "testOneInPlaneAngle", log );
compareWithExpectedForceAndEnergy( context, *amoebaInPlaneAngleForce, TOL, "testOneInPlaneAngle", log );
}
int main( int numberOfArguments, char* argv[] ) {
try {
std::cout << "TestReferenceAmoebaHarmonicInPlaneAngleForce running test..." << std::endl;
std::cout << "TestReferenceAmoebaInPlaneAngleForce running test..." << std::endl;
Platform::loadPluginsFromDirectory( Platform::getDefaultPluginsDirectory() );
FILE* log = NULL;
//FILE* log = stderr;
//FILE* log = fopen( "AmoebaHarmonicInPlaneAngleForce.log", "w" );;
//FILE* log = fopen( "AmoebaInPlaneAngleForce.log", "w" );;
testOneAngle( NULL );
#ifdef AMOEBA_DEBUG
......
#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 AmoebaHarmonicAngleForce objects.
* This is a proxy for serializing AmoebaAngleForce objects.
*/
class OPENMM_EXPORT AmoebaHarmonicAngleForceProxy : public SerializationProxy {
class OPENMM_EXPORT AmoebaAngleForceProxy : public SerializationProxy {
public:
AmoebaHarmonicAngleForceProxy();
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_*/
#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 AmoebaHarmonicInPlaneAngleForce objects.
* This is a proxy for serializing AmoebaBondForce objects.
*/
class OPENMM_EXPORT AmoebaHarmonicInPlaneAngleForceProxy : public SerializationProxy {
class OPENMM_EXPORT AmoebaBondForceProxy : public SerializationProxy {
public:
AmoebaHarmonicInPlaneAngleForceProxy();
AmoebaBondForceProxy();
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_*/
#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 AmoebaHarmonicBondForce objects.
* This is a proxy for serializing AmoebaInPlaneAngleForce objects.
*/
class OPENMM_EXPORT AmoebaHarmonicBondForceProxy : public SerializationProxy {
class OPENMM_EXPORT AmoebaInPlaneAngleForceProxy : public SerializationProxy {
public:
AmoebaHarmonicBondForceProxy();
AmoebaInPlaneAngleForceProxy();
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_*/
......@@ -29,27 +29,27 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/serialization/AmoebaHarmonicAngleForceProxy.h"
#include "openmm/serialization/AmoebaAngleForceProxy.h"
#include "openmm/serialization/SerializationNode.h"
#include "openmm/Force.h"
#include "openmm/AmoebaHarmonicAngleForce.h"
#include "openmm/AmoebaAngleForce.h"
#include <sstream>
using namespace OpenMM;
using namespace std;
AmoebaHarmonicAngleForceProxy::AmoebaHarmonicAngleForceProxy() : SerializationProxy("AmoebaHarmonicAngleForce") {
AmoebaAngleForceProxy::AmoebaAngleForceProxy() : SerializationProxy("AmoebaAngleForce") {
}
void AmoebaHarmonicAngleForceProxy::serialize(const void* object, SerializationNode& node) const {
void AmoebaAngleForceProxy::serialize(const void* object, SerializationNode& node) const {
node.setIntProperty("version", 1);
const AmoebaHarmonicAngleForce& force = *reinterpret_cast<const AmoebaHarmonicAngleForce*>(object);
const AmoebaAngleForce& force = *reinterpret_cast<const AmoebaAngleForce*>(object);
node.setDoubleProperty("HarmonicAngleCubic", force.getAmoebaGlobalHarmonicAngleCubic());
node.setDoubleProperty("HarmonicAngleQuartic", force.getAmoebaGlobalHarmonicAngleQuartic());
node.setDoubleProperty("HarmonicAnglePentic", force.getAmoebaGlobalHarmonicAnglePentic());
node.setDoubleProperty("HarmonicAngleSextic", force.getAmoebaGlobalHarmonicAngleSextic());
node.setDoubleProperty("cubic", force.getAmoebaGlobalAngleCubic());
node.setDoubleProperty("quartic", force.getAmoebaGlobalAngleQuartic());
node.setDoubleProperty("pentic", force.getAmoebaGlobalAnglePentic());
node.setDoubleProperty("sextic", 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* AmoebaHarmonicAngleForceProxy::deserialize(const SerializationNode& node) const {
void* AmoebaAngleForceProxy::deserialize(const SerializationNode& node) const {
if (node.getIntProperty("version") != 1)
throw OpenMMException("Unsupported version number");
AmoebaHarmonicAngleForce* force = new AmoebaHarmonicAngleForce();
AmoebaAngleForce* force = new AmoebaAngleForce();
try {
force->setAmoebaGlobalHarmonicAngleCubic(node.getDoubleProperty( "HarmonicAngleCubic"));
force->setAmoebaGlobalHarmonicAngleQuartic(node.getDoubleProperty("HarmonicAngleQuartic"));
force->setAmoebaGlobalHarmonicAnglePentic(node.getDoubleProperty( "HarmonicAnglePentic"));
force->setAmoebaGlobalHarmonicAngleSextic(node.getDoubleProperty( "HarmonicAngleSextic"));
force->setAmoebaGlobalAngleCubic(node.getDoubleProperty( "cubic"));
force->setAmoebaGlobalAngleQuartic(node.getDoubleProperty("quartic"));
force->setAmoebaGlobalAnglePentic(node.getDoubleProperty( "pentic"));
force->setAmoebaGlobalAngleSextic(node.getDoubleProperty( "sextic"));
const SerializationNode& bonds = node.getChildNode("Angles");
for ( unsigned int ii = 0; ii < bonds.getChildren().size(); ii++) {
......
......@@ -29,24 +29,24 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/serialization/AmoebaHarmonicBondForceProxy.h"
#include "openmm/serialization/AmoebaBondForceProxy.h"
#include "openmm/serialization/SerializationNode.h"
#include "openmm/Force.h"
#include "openmm/AmoebaHarmonicBondForce.h"
#include "openmm/AmoebaBondForce.h"
#include <sstream>
using namespace OpenMM;
using namespace std;
AmoebaHarmonicBondForceProxy::AmoebaHarmonicBondForceProxy() : SerializationProxy("AmoebaHarmonicBondForce") {
AmoebaBondForceProxy::AmoebaBondForceProxy() : SerializationProxy("AmoebaBondForce") {
}
void AmoebaHarmonicBondForceProxy::serialize(const void* object, SerializationNode& node) const {
void AmoebaBondForceProxy::serialize(const void* object, SerializationNode& node) const {
node.setIntProperty("version", 1);
const AmoebaHarmonicBondForce& force = *reinterpret_cast<const AmoebaHarmonicBondForce*>(object);
const AmoebaBondForce& force = *reinterpret_cast<const AmoebaBondForce*>(object);
node.setDoubleProperty("HarmonicBondCubic", force.getAmoebaGlobalHarmonicBondCubic());
node.setDoubleProperty("HarmonicBondQuartic", force.getAmoebaGlobalHarmonicBondQuartic());
node.setDoubleProperty("cubic", force.getAmoebaGlobalBondCubic());
node.setDoubleProperty("quartic", 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* AmoebaHarmonicBondForceProxy::deserialize(const SerializationNode& node) const {
void* AmoebaBondForceProxy::deserialize(const SerializationNode& node) const {
if (node.getIntProperty("version") != 1)
throw OpenMMException("Unsupported version number");
AmoebaHarmonicBondForce* force = new AmoebaHarmonicBondForce();
AmoebaBondForce* force = new AmoebaBondForce();
try {
force->setAmoebaGlobalHarmonicBondCubic(node.getDoubleProperty("HarmonicBondCubic"));
force->setAmoebaGlobalHarmonicBondQuartic(node.getDoubleProperty("HarmonicBondQuartic"));
force->setAmoebaGlobalBondCubic(node.getDoubleProperty("condCubic"));
force->setAmoebaGlobalBondQuartic(node.getDoubleProperty("quartic"));
const SerializationNode& bonds = node.getChildNode("Bonds");
for ( unsigned int ii = 0; ii < (int) bonds.getChildren().size(); ii++) {
const SerializationNode& bond = bonds.getChildren()[ii];
......
......@@ -29,27 +29,27 @@
* USE OR OTHER DEALINGS IN THE SOFTWARE. *
* -------------------------------------------------------------------------- */
#include "openmm/serialization/AmoebaHarmonicInPlaneAngleForceProxy.h"
#include "openmm/serialization/AmoebaInPlaneAngleForceProxy.h"
#include "openmm/serialization/SerializationNode.h"
#include "openmm/Force.h"
#include "openmm/AmoebaHarmonicInPlaneAngleForce.h"
#include "openmm/AmoebaInPlaneAngleForce.h"
#include <sstream>
using namespace OpenMM;
using namespace std;
AmoebaHarmonicInPlaneAngleForceProxy::AmoebaHarmonicInPlaneAngleForceProxy() : SerializationProxy("AmoebaHarmonicInPlaneAngleForce") {
AmoebaInPlaneAngleForceProxy::AmoebaInPlaneAngleForceProxy() : SerializationProxy("AmoebaInPlaneAngleForce") {
}
void AmoebaHarmonicInPlaneAngleForceProxy::serialize(const void* object, SerializationNode& node) const {
void AmoebaInPlaneAngleForceProxy::serialize(const void* object, SerializationNode& node) const {
node.setIntProperty("version", 1);
const AmoebaHarmonicInPlaneAngleForce& force = *reinterpret_cast<const AmoebaHarmonicInPlaneAngleForce*>(object);
const AmoebaInPlaneAngleForce& force = *reinterpret_cast<const AmoebaInPlaneAngleForce*>(object);
node.setDoubleProperty("HarmonicInPlaneAngleCubic", force.getAmoebaGlobalHarmonicInPlaneAngleCubic());
node.setDoubleProperty("HarmonicInPlaneAngleQuartic", force.getAmoebaGlobalHarmonicInPlaneAngleQuartic());
node.setDoubleProperty("HarmonicInPlaneAnglePentic", force.getAmoebaGlobalHarmonicInPlaneAnglePentic());
node.setDoubleProperty("HarmonicInPlaneAngleSextic", force.getAmoebaGlobalHarmonicInPlaneAngleSextic());
node.setDoubleProperty("cubic", force.getAmoebaGlobalInPlaneAngleCubic());
node.setDoubleProperty("quartic", force.getAmoebaGlobalInPlaneAngleQuartic());
node.setDoubleProperty("pentic", force.getAmoebaGlobalInPlaneAnglePentic());
node.setDoubleProperty("sextic", 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* AmoebaHarmonicInPlaneAngleForceProxy::deserialize(const SerializationNode& node) const {
void* AmoebaInPlaneAngleForceProxy::deserialize(const SerializationNode& node) const {
if (node.getIntProperty("version") != 1)
throw OpenMMException("Unsupported version number");
AmoebaHarmonicInPlaneAngleForce* force = new AmoebaHarmonicInPlaneAngleForce();
AmoebaInPlaneAngleForce* force = new AmoebaInPlaneAngleForce();
try {
force->setAmoebaGlobalHarmonicInPlaneAngleCubic( node.getDoubleProperty("HarmonicInPlaneAngleCubic"));
force->setAmoebaGlobalHarmonicInPlaneAngleQuartic(node.getDoubleProperty("HarmonicInPlaneAngleQuartic"));
force->setAmoebaGlobalHarmonicInPlaneAnglePentic( node.getDoubleProperty("HarmonicInPlaneAnglePentic"));
force->setAmoebaGlobalHarmonicInPlaneAngleSextic( node.getDoubleProperty("HarmonicInPlaneAngleSextic"));
force->setAmoebaGlobalInPlaneAngleCubic( node.getDoubleProperty("cubic"));
force->setAmoebaGlobalInPlaneAngleQuartic(node.getDoubleProperty("quartic"));
force->setAmoebaGlobalInPlaneAnglePentic( node.getDoubleProperty("pentic"));
force->setAmoebaGlobalInPlaneAngleSextic( node.getDoubleProperty("sextic"));
const SerializationNode& bonds = node.getChildNode("InPlaneAngles");
for (unsigned int ii = 0; ii < bonds.getChildren().size(); ii++) {
......
......@@ -41,9 +41,9 @@
#include "openmm/OpenMMException.h"
#include "openmm/AmoebaGeneralizedKirkwoodForce.h"
#include "openmm/AmoebaHarmonicBondForce.h"
#include "openmm/AmoebaHarmonicAngleForce.h"
#include "openmm/AmoebaHarmonicInPlaneAngleForce.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/AmoebaHarmonicBondForceProxy.h"
#include "openmm/serialization/AmoebaHarmonicAngleForceProxy.h"
#include "openmm/serialization/AmoebaHarmonicInPlaneAngleForceProxy.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(AmoebaHarmonicBondForce), new AmoebaHarmonicBondForceProxy());
SerializationProxy::registerProxy(typeid(AmoebaHarmonicAngleForce), new AmoebaHarmonicAngleForceProxy());
SerializationProxy::registerProxy(typeid(AmoebaHarmonicInPlaneAngleForce), new AmoebaHarmonicInPlaneAngleForceProxy());
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());
......
......@@ -30,7 +30,7 @@
* -------------------------------------------------------------------------- */
#include "openmm/internal/AssertionUtilities.h"
#include "openmm/AmoebaHarmonicAngleForce.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.
AmoebaHarmonicAngleForce force1;
force1.setAmoebaGlobalHarmonicAngleCubic( 12.3 );
force1.setAmoebaGlobalHarmonicAngleQuartic( 98.7 );
force1.setAmoebaGlobalHarmonicAnglePentic( 91.7 );
force1.setAmoebaGlobalHarmonicAngleSextic( 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<AmoebaHarmonicAngleForce>(&force1, "Force", buffer);
AmoebaHarmonicAngleForce* copy = XmlSerializer::deserialize<AmoebaHarmonicAngleForce>(buffer);
XmlSerializer::serialize<AmoebaAngleForce>(&force1, "Force", buffer);
AmoebaAngleForce* copy = XmlSerializer::deserialize<AmoebaAngleForce>(buffer);
// Compare the two forces to see if they are identical.
AmoebaHarmonicAngleForce& force2 = *copy;
ASSERT_EQUAL(force1.getAmoebaGlobalHarmonicAngleCubic(), force2.getAmoebaGlobalHarmonicAngleCubic());
ASSERT_EQUAL(force1.getAmoebaGlobalHarmonicAngleQuartic(), force2.getAmoebaGlobalHarmonicAngleQuartic());
ASSERT_EQUAL(force1.getAmoebaGlobalHarmonicAnglePentic(), force2.getAmoebaGlobalHarmonicAnglePentic());
ASSERT_EQUAL(force1.getAmoebaGlobalHarmonicAngleSextic(), force2.getAmoebaGlobalHarmonicAngleSextic());
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;
......
......@@ -30,7 +30,7 @@
* -------------------------------------------------------------------------- */
#include "openmm/internal/AssertionUtilities.h"
#include "openmm/AmoebaHarmonicBondForce.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.
AmoebaHarmonicBondForce force1;
force1.setAmoebaGlobalHarmonicBondCubic( 12.3 );
force1.setAmoebaGlobalHarmonicBondQuartic( 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<AmoebaHarmonicBondForce>(&force1, "Force", buffer);
AmoebaHarmonicBondForce* copy = XmlSerializer::deserialize<AmoebaHarmonicBondForce>(buffer);
XmlSerializer::serialize<AmoebaBondForce>(&force1, "Force", buffer);
AmoebaBondForce* copy = XmlSerializer::deserialize<AmoebaBondForce>(buffer);
// Compare the two forces to see if they are identical.
AmoebaHarmonicBondForce& force2 = *copy;
ASSERT_EQUAL(force1.getAmoebaGlobalHarmonicBondCubic(), force2.getAmoebaGlobalHarmonicBondCubic());
ASSERT_EQUAL(force1.getAmoebaGlobalHarmonicBondQuartic(), force2.getAmoebaGlobalHarmonicBondQuartic());
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;
......
......@@ -30,7 +30,7 @@
* -------------------------------------------------------------------------- */
#include "openmm/internal/AssertionUtilities.h"
#include "openmm/AmoebaHarmonicInPlaneAngleForce.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.
AmoebaHarmonicInPlaneAngleForce force1;
AmoebaInPlaneAngleForce force1;
force1.setAmoebaGlobalHarmonicInPlaneAngleCubic( 12.3 );
force1.setAmoebaGlobalHarmonicInPlaneAngleQuartic( 98.7 );
force1.setAmoebaGlobalHarmonicInPlaneAnglePentic( 91.7 );
force1.setAmoebaGlobalHarmonicInPlaneAngleSextic( 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<AmoebaHarmonicInPlaneAngleForce>(&force1, "Force", buffer);
AmoebaHarmonicInPlaneAngleForce* copy = XmlSerializer::deserialize<AmoebaHarmonicInPlaneAngleForce>(buffer);
XmlSerializer::serialize<AmoebaInPlaneAngleForce>(&force1, "Force", buffer);
AmoebaInPlaneAngleForce* copy = XmlSerializer::deserialize<AmoebaInPlaneAngleForce>(buffer);
// Compare the two forces to see if they are identical.
AmoebaHarmonicInPlaneAngleForce& force2 = *copy;
AmoebaInPlaneAngleForce& force2 = *copy;
ASSERT_EQUAL(force1.getAmoebaGlobalHarmonicInPlaneAngleCubic(), force2.getAmoebaGlobalHarmonicInPlaneAngleCubic());
ASSERT_EQUAL(force1.getAmoebaGlobalHarmonicInPlaneAngleQuartic(), force2.getAmoebaGlobalHarmonicInPlaneAngleQuartic());
ASSERT_EQUAL(force1.getAmoebaGlobalHarmonicInPlaneAnglePentic(), force2.getAmoebaGlobalHarmonicInPlaneAnglePentic());
ASSERT_EQUAL(force1.getAmoebaGlobalHarmonicInPlaneAngleSextic(), force2.getAmoebaGlobalHarmonicInPlaneAngleSextic());
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++) {
......
......@@ -3543,7 +3543,7 @@
<Atom name="LI" type="382"/>
</Residue>
</Residues>
<AmoebaHarmonicBondForce 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"/>
</AmoebaHarmonicBondForce>
<AmoebaHarmonicAngleForce 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" />
</AmoebaHarmonicAngleForce>
</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"/>
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment