"vscode:/vscode.git/clone" did not exist on "a3476d238925107e4cfa082881e0e9beb8c963f9"
Commit c44c956d authored by peastman's avatar peastman
Browse files

Deleted lots of debugging code

parent 41cd79a5
...@@ -157,7 +157,7 @@ public: ...@@ -157,7 +157,7 @@ public:
* *
* @return number of bonds * @return number of bonds
*/ */
int getNumBonds( void ) const; int getNumBonds() const;
/** /**
* Get the dielectric constant for the solvent. * Get the dielectric constant for the solvent.
...@@ -208,7 +208,7 @@ public: ...@@ -208,7 +208,7 @@ public:
/** /**
* Get Born radius scaling method * Get Born radius scaling method
*/ */
BornRadiusScalingMethod getBornRadiusScalingMethod( void ) const; BornRadiusScalingMethod getBornRadiusScalingMethod() const;
/** /**
* Set Born radius scaling method * Set Born radius scaling method
*/ */
...@@ -216,7 +216,7 @@ public: ...@@ -216,7 +216,7 @@ public:
/** /**
* Get the lower limit factor used in the quintic spline scaling method (typically 0.5-0.8) * Get the lower limit factor used in the quintic spline scaling method (typically 0.5-0.8)
*/ */
double getQuinticLowerLimitFactor( void ) const; double getQuinticLowerLimitFactor() const;
/** /**
* Set the lower limit factor used in the quintic spline scaling method (typically 0.5-0.8) * Set the lower limit factor used in the quintic spline scaling method (typically 0.5-0.8)
*/ */
...@@ -224,7 +224,7 @@ public: ...@@ -224,7 +224,7 @@ public:
/** /**
* Get the upper limit used in the quintic spline scaling method, measured in nm (~5.0) * Get the upper limit used in the quintic spline scaling method, measured in nm (~5.0)
*/ */
double getQuinticUpperBornRadiusLimit( void ) const; double getQuinticUpperBornRadiusLimit() const;
/** /**
* Set the upper limit used in the quintic spline scaling method, measured in nm (~5.0) * Set the upper limit used in the quintic spline scaling method, measured in nm (~5.0)
*/ */
......
...@@ -77,7 +77,7 @@ void GBVIForce::setCutoffDistance(double distance) { ...@@ -77,7 +77,7 @@ void GBVIForce::setCutoffDistance(double distance) {
cutoffDistance = distance; cutoffDistance = distance;
} }
GBVIForce::BornRadiusScalingMethod GBVIForce::getBornRadiusScalingMethod( void ) const { GBVIForce::BornRadiusScalingMethod GBVIForce::getBornRadiusScalingMethod() const {
return scalingMethod; return scalingMethod;
} }
...@@ -85,7 +85,7 @@ void GBVIForce::setBornRadiusScalingMethod(BornRadiusScalingMethod method) { ...@@ -85,7 +85,7 @@ void GBVIForce::setBornRadiusScalingMethod(BornRadiusScalingMethod method) {
scalingMethod = method; scalingMethod = method;
} }
double GBVIForce::getQuinticLowerLimitFactor( void ) const { double GBVIForce::getQuinticLowerLimitFactor() const {
return quinticLowerLimitFactor; return quinticLowerLimitFactor;
} }
...@@ -93,7 +93,7 @@ void GBVIForce::setQuinticLowerLimitFactor(double inputQuinticLowerLimitFactor ) ...@@ -93,7 +93,7 @@ void GBVIForce::setQuinticLowerLimitFactor(double inputQuinticLowerLimitFactor )
quinticLowerLimitFactor = inputQuinticLowerLimitFactor; quinticLowerLimitFactor = inputQuinticLowerLimitFactor;
} }
double GBVIForce::getQuinticUpperBornRadiusLimit( void ) const { double GBVIForce::getQuinticUpperBornRadiusLimit() const {
return quinticUpperBornRadiusLimit; return quinticUpperBornRadiusLimit;
} }
...@@ -113,7 +113,7 @@ void GBVIForce::setBondParameters( int index, int particle1, int particle2, doub ...@@ -113,7 +113,7 @@ void GBVIForce::setBondParameters( int index, int particle1, int particle2, doub
bonds[index].bondLength = bondLength; bonds[index].bondLength = bondLength;
} }
int GBVIForce::getNumBonds( void ) const { int GBVIForce::getNumBonds() const {
return (int) bonds.size(); return (int) bonds.size();
} }
......
...@@ -145,8 +145,6 @@ int GBVIForceImpl::getBondsFromForces(ContextImpl& context) { ...@@ -145,8 +145,6 @@ int GBVIForceImpl::getBondsFromForces(ContextImpl& context) {
} }
*/ */
#define GBVIDebug 0
void GBVIForceImpl::findScaledRadii( int numberOfParticles, const std::vector<std::vector<int> >& bondIndices, void GBVIForceImpl::findScaledRadii( int numberOfParticles, const std::vector<std::vector<int> >& bondIndices,
const std::vector<double> & bondLengths, std::vector<double> & scaledRadii) const { const std::vector<double> & bondLengths, std::vector<double> & scaledRadii) const {
...@@ -219,26 +217,6 @@ void GBVIForceImpl::findScaledRadii( int numberOfParticles, const std::vector<st ...@@ -219,26 +217,6 @@ void GBVIForceImpl::findScaledRadii( int numberOfParticles, const std::vector<st
if( errors ){ if( errors ){
throw OpenMMException("GBVIForceImpl::findScaledRadii errors -- aborting"); throw OpenMMException("GBVIForceImpl::findScaledRadii errors -- aborting");
} }
#if GBVIDebug
(void) fprintf( stderr, " R q gamma scaled radii no. bnds\n" );
double totalQ = 0.0;
for( int i = 0; i < (int) scaledRadii.size(); i++ ){
double charge;
double gamma;
double radiusI;
owner.getParticleParameters(i, charge, radiusI, gamma);
totalQ += charge;
(void) fprintf( stderr, "%4d %14.5e %14.5e %14.5e %14.5e %d\n", i, radiusI, charge, gamma, scaledRadii[i], (int) bonded12[i].size() );
}
(void) fprintf( stderr, "Total charge=%e\n", totalQ );
(void) fflush( stderr );
#endif
#undef GBVIDebug
} }
double GBVIForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy, int groups) { double GBVIForceImpl::calcForcesAndEnergy(ContextImpl& context, bool includeForces, bool includeEnergy, int groups) {
......
...@@ -77,7 +77,7 @@ public: ...@@ -77,7 +77,7 @@ public:
* *
* @return global cubicK term * @return global cubicK term
*/ */
double getAmoebaGlobalAngleCubic( void ) const; double getAmoebaGlobalAngleCubic() const;
/** /**
* Set the global quartic term * Set the global quartic term
...@@ -91,7 +91,7 @@ public: ...@@ -91,7 +91,7 @@ public:
* *
* @return global quartic term * @return global quartic term
*/ */
double getAmoebaGlobalAngleQuartic( void ) const; double getAmoebaGlobalAngleQuartic() const;
/** /**
* Set the global pentic term * Set the global pentic term
...@@ -105,7 +105,7 @@ public: ...@@ -105,7 +105,7 @@ public:
* *
* @return global penticK term * @return global penticK term
*/ */
double getAmoebaGlobalAnglePentic( void ) const; double getAmoebaGlobalAnglePentic() const;
/** /**
* Set the global sextic term * Set the global sextic term
...@@ -119,7 +119,7 @@ public: ...@@ -119,7 +119,7 @@ public:
* *
* @return global sextic term * @return global sextic term
*/ */
double getAmoebaGlobalAngleSextic( void ) const; double getAmoebaGlobalAngleSextic() const;
/** /**
* Add an angle term to the force field. * Add an angle term to the force field.
......
...@@ -78,7 +78,7 @@ public: ...@@ -78,7 +78,7 @@ public:
* *
* @return global cubicK term * @return global cubicK term
*/ */
double getAmoebaGlobalBondCubic( void ) const; double getAmoebaGlobalBondCubic() const;
/** /**
* Set the global quartic term * Set the global quartic term
...@@ -92,7 +92,7 @@ public: ...@@ -92,7 +92,7 @@ public:
* *
* @return global quartic term * @return global quartic term
*/ */
double getAmoebaGlobalBondQuartic( void ) const; double getAmoebaGlobalBondQuartic() const;
/** /**
* Add a bond term to the force field. * Add a bond term to the force field.
......
...@@ -127,7 +127,7 @@ public: ...@@ -127,7 +127,7 @@ public:
/** /**
* Get the flag signaling whether the cavity term should be included * Get the flag signaling whether the cavity term should be included
*/ */
int getIncludeCavityTerm( ) const; int getIncludeCavityTerm() const;
/** /**
* Set the flag signaling whether the cavity term should be included * Set the flag signaling whether the cavity term should be included
......
...@@ -77,7 +77,7 @@ public: ...@@ -77,7 +77,7 @@ public:
* *
* @return global cubicK term * @return global cubicK term
*/ */
double getAmoebaGlobalInPlaneAngleCubic( void ) const; double getAmoebaGlobalInPlaneAngleCubic() const;
/** /**
* Set the global quartic term * Set the global quartic term
...@@ -91,7 +91,7 @@ public: ...@@ -91,7 +91,7 @@ public:
* *
* @return global quartic term * @return global quartic term
*/ */
double getAmoebaGlobalInPlaneAngleQuartic( void ) const; double getAmoebaGlobalInPlaneAngleQuartic() const;
/** /**
* Set the global pentic term * Set the global pentic term
...@@ -105,7 +105,7 @@ public: ...@@ -105,7 +105,7 @@ public:
* *
* @return global penticK term * @return global penticK term
*/ */
double getAmoebaGlobalInPlaneAnglePentic( void ) const; double getAmoebaGlobalInPlaneAnglePentic() const;
/** /**
* Set the global sextic term * Set the global sextic term
...@@ -119,7 +119,7 @@ public: ...@@ -119,7 +119,7 @@ public:
* *
* @return global sextic term * @return global sextic term
*/ */
double getAmoebaGlobalInPlaneAngleSextic( void ) const; double getAmoebaGlobalInPlaneAngleSextic() const;
/** /**
* Add an angle term to the force field. * Add an angle term to the force field.
......
...@@ -97,7 +97,7 @@ private: ...@@ -97,7 +97,7 @@ private:
static int CovalentDegrees[AmoebaMultipoleForce::CovalentEnd]; static int CovalentDegrees[AmoebaMultipoleForce::CovalentEnd];
static bool initializedCovalentDegrees; static bool initializedCovalentDegrees;
static const int* getCovalentDegrees( void ); static const int* getCovalentDegrees();
}; };
} // namespace OpenMM } // namespace OpenMM
......
...@@ -63,7 +63,7 @@ void AmoebaAngleForce::setAngleParameters(int index, int particle1, int particle ...@@ -63,7 +63,7 @@ void AmoebaAngleForce::setAngleParameters(int index, int particle1, int particle
angles[index].quadraticK = quadraticK; angles[index].quadraticK = quadraticK;
} }
double AmoebaAngleForce::getAmoebaGlobalAngleCubic( void ) const { double AmoebaAngleForce::getAmoebaGlobalAngleCubic() const {
return _globalCubicK; return _globalCubicK;
} }
...@@ -71,7 +71,7 @@ void AmoebaAngleForce::setAmoebaGlobalAngleCubic(double cubicK ) { ...@@ -71,7 +71,7 @@ void AmoebaAngleForce::setAmoebaGlobalAngleCubic(double cubicK ) {
_globalCubicK = cubicK; _globalCubicK = cubicK;
} }
double AmoebaAngleForce::getAmoebaGlobalAngleQuartic( void ) const { double AmoebaAngleForce::getAmoebaGlobalAngleQuartic() const {
return _globalQuarticK; return _globalQuarticK;
} }
...@@ -79,7 +79,7 @@ void AmoebaAngleForce::setAmoebaGlobalAngleQuartic(double quarticK ) { ...@@ -79,7 +79,7 @@ void AmoebaAngleForce::setAmoebaGlobalAngleQuartic(double quarticK ) {
_globalQuarticK = quarticK; _globalQuarticK = quarticK;
} }
double AmoebaAngleForce::getAmoebaGlobalAnglePentic( void ) const { double AmoebaAngleForce::getAmoebaGlobalAnglePentic() const {
return _globalPenticK; return _globalPenticK;
} }
...@@ -87,7 +87,7 @@ void AmoebaAngleForce::setAmoebaGlobalAnglePentic(double penticK ) { ...@@ -87,7 +87,7 @@ void AmoebaAngleForce::setAmoebaGlobalAnglePentic(double penticK ) {
_globalPenticK = penticK; _globalPenticK = penticK;
} }
double AmoebaAngleForce::getAmoebaGlobalAngleSextic( void ) const { double AmoebaAngleForce::getAmoebaGlobalAngleSextic() const {
return _globalSexticK; return _globalSexticK;
} }
......
...@@ -67,11 +67,11 @@ void AmoebaBondForce::setAmoebaGlobalBondQuartic(double quarticK ) { ...@@ -67,11 +67,11 @@ void AmoebaBondForce::setAmoebaGlobalBondQuartic(double quarticK ) {
_globalQuarticK = quarticK; _globalQuarticK = quarticK;
} }
double AmoebaBondForce::getAmoebaGlobalBondCubic( void ) const { double AmoebaBondForce::getAmoebaGlobalBondCubic() const {
return _globalCubicK; return _globalCubicK;
} }
double AmoebaBondForce::getAmoebaGlobalBondQuartic( void ) const { double AmoebaBondForce::getAmoebaGlobalBondQuartic() const {
return _globalQuarticK; return _globalQuarticK;
} }
......
...@@ -73,11 +73,11 @@ void AmoebaInPlaneAngleForce::setAmoebaGlobalInPlaneAngleQuartic(double quarticK ...@@ -73,11 +73,11 @@ void AmoebaInPlaneAngleForce::setAmoebaGlobalInPlaneAngleQuartic(double quarticK
_globalQuarticK = quarticK; _globalQuarticK = quarticK;
} }
double AmoebaInPlaneAngleForce::getAmoebaGlobalInPlaneAngleCubic( void ) const { double AmoebaInPlaneAngleForce::getAmoebaGlobalInPlaneAngleCubic() const {
return _globalCubicK; return _globalCubicK;
} }
double AmoebaInPlaneAngleForce::getAmoebaGlobalInPlaneAngleQuartic( void ) const { double AmoebaInPlaneAngleForce::getAmoebaGlobalInPlaneAngleQuartic() const {
return _globalQuarticK; return _globalQuarticK;
} }
...@@ -89,11 +89,11 @@ void AmoebaInPlaneAngleForce::setAmoebaGlobalInPlaneAngleSextic(double quarticK ...@@ -89,11 +89,11 @@ void AmoebaInPlaneAngleForce::setAmoebaGlobalInPlaneAngleSextic(double quarticK
_globalSexticK = quarticK; _globalSexticK = quarticK;
} }
double AmoebaInPlaneAngleForce::getAmoebaGlobalInPlaneAnglePentic( void ) const { double AmoebaInPlaneAngleForce::getAmoebaGlobalInPlaneAnglePentic() const {
return _globalPenticK; return _globalPenticK;
} }
double AmoebaInPlaneAngleForce::getAmoebaGlobalInPlaneAngleSextic( void ) const { double AmoebaInPlaneAngleForce::getAmoebaGlobalInPlaneAngleSextic() const {
return _globalSexticK; return _globalSexticK;
} }
......
...@@ -45,7 +45,7 @@ AmoebaMultipoleForce::AmoebaMultipoleForce() : nonbondedMethod(NoCutoff), polari ...@@ -45,7 +45,7 @@ AmoebaMultipoleForce::AmoebaMultipoleForce() : nonbondedMethod(NoCutoff), polari
pmeGridDimension[0] = pmeGridDimension[1] = pmeGridDimension[2]; pmeGridDimension[0] = pmeGridDimension[1] = pmeGridDimension[2];
} }
AmoebaMultipoleForce::NonbondedMethod AmoebaMultipoleForce::getNonbondedMethod( void ) const { AmoebaMultipoleForce::NonbondedMethod AmoebaMultipoleForce::getNonbondedMethod() const {
return nonbondedMethod; return nonbondedMethod;
} }
...@@ -53,7 +53,7 @@ void AmoebaMultipoleForce::setNonbondedMethod( AmoebaMultipoleForce::NonbondedMe ...@@ -53,7 +53,7 @@ void AmoebaMultipoleForce::setNonbondedMethod( AmoebaMultipoleForce::NonbondedMe
nonbondedMethod = method; nonbondedMethod = method;
} }
AmoebaMultipoleForce::PolarizationType AmoebaMultipoleForce::getPolarizationType( void ) const { AmoebaMultipoleForce::PolarizationType AmoebaMultipoleForce::getPolarizationType() const {
return polarizationType; return polarizationType;
} }
...@@ -77,7 +77,7 @@ void AmoebaMultipoleForce::setAEwald(double inputAewald ) { ...@@ -77,7 +77,7 @@ void AmoebaMultipoleForce::setAEwald(double inputAewald ) {
aewald = inputAewald; aewald = inputAewald;
} }
int AmoebaMultipoleForce::getPmeBSplineOrder( void ) const { int AmoebaMultipoleForce::getPmeBSplineOrder() const {
return pmeBSplineOrder; return pmeBSplineOrder;
} }
...@@ -103,7 +103,7 @@ void AmoebaMultipoleForce::setPmeGridDimensions( const std::vector<int>& gridDim ...@@ -103,7 +103,7 @@ void AmoebaMultipoleForce::setPmeGridDimensions( const std::vector<int>& gridDim
return; return;
} }
int AmoebaMultipoleForce::getMutualInducedMaxIterations( void ) const { int AmoebaMultipoleForce::getMutualInducedMaxIterations() const {
return mutualInducedMaxIterations; return mutualInducedMaxIterations;
} }
...@@ -111,7 +111,7 @@ void AmoebaMultipoleForce::setMutualInducedMaxIterations( int inputMutualInduced ...@@ -111,7 +111,7 @@ void AmoebaMultipoleForce::setMutualInducedMaxIterations( int inputMutualInduced
mutualInducedMaxIterations = inputMutualInducedMaxIterations; mutualInducedMaxIterations = inputMutualInducedMaxIterations;
} }
double AmoebaMultipoleForce::getMutualInducedTargetEpsilon( void ) const { double AmoebaMultipoleForce::getMutualInducedTargetEpsilon() const {
return mutualInducedTargetEpsilon; return mutualInducedTargetEpsilon;
} }
......
...@@ -138,7 +138,7 @@ std::vector<std::string> AmoebaMultipoleForceImpl::getKernelNames() { ...@@ -138,7 +138,7 @@ std::vector<std::string> AmoebaMultipoleForceImpl::getKernelNames() {
return names; return names;
} }
const int* AmoebaMultipoleForceImpl::getCovalentDegrees( void ) { const int* AmoebaMultipoleForceImpl::getCovalentDegrees() {
if( !initializedCovalentDegrees ){ if( !initializedCovalentDegrees ){
initializedCovalentDegrees = true; initializedCovalentDegrees = true;
CovalentDegrees[AmoebaMultipoleForce::Covalent12] = 1; CovalentDegrees[AmoebaMultipoleForce::Covalent12] = 1;
......
...@@ -44,7 +44,7 @@ AmoebaOutOfPlaneBendForce::AmoebaOutOfPlaneBendForce() { ...@@ -44,7 +44,7 @@ AmoebaOutOfPlaneBendForce::AmoebaOutOfPlaneBendForce() {
} }
double AmoebaOutOfPlaneBendForce::getAmoebaGlobalOutOfPlaneBendCubic( void ) const { double AmoebaOutOfPlaneBendForce::getAmoebaGlobalOutOfPlaneBendCubic() const {
return _globalCubicK; return _globalCubicK;
} }
...@@ -52,7 +52,7 @@ void AmoebaOutOfPlaneBendForce::setAmoebaGlobalOutOfPlaneBendCubic(double cubicK ...@@ -52,7 +52,7 @@ void AmoebaOutOfPlaneBendForce::setAmoebaGlobalOutOfPlaneBendCubic(double cubicK
_globalCubicK = cubicK; _globalCubicK = cubicK;
} }
double AmoebaOutOfPlaneBendForce::getAmoebaGlobalOutOfPlaneBendQuartic( void ) const { double AmoebaOutOfPlaneBendForce::getAmoebaGlobalOutOfPlaneBendQuartic() const {
return _globalQuarticK; return _globalQuarticK;
} }
...@@ -60,7 +60,7 @@ void AmoebaOutOfPlaneBendForce::setAmoebaGlobalOutOfPlaneBendQuartic(double quar ...@@ -60,7 +60,7 @@ void AmoebaOutOfPlaneBendForce::setAmoebaGlobalOutOfPlaneBendQuartic(double quar
_globalQuarticK = quarticK; _globalQuarticK = quarticK;
} }
double AmoebaOutOfPlaneBendForce::getAmoebaGlobalOutOfPlaneBendPentic( void ) const { double AmoebaOutOfPlaneBendForce::getAmoebaGlobalOutOfPlaneBendPentic() const {
return _globalPenticK; return _globalPenticK;
} }
...@@ -68,7 +68,7 @@ void AmoebaOutOfPlaneBendForce::setAmoebaGlobalOutOfPlaneBendPentic(double penti ...@@ -68,7 +68,7 @@ void AmoebaOutOfPlaneBendForce::setAmoebaGlobalOutOfPlaneBendPentic(double penti
_globalPenticK = penticK; _globalPenticK = penticK;
} }
double AmoebaOutOfPlaneBendForce::getAmoebaGlobalOutOfPlaneBendSextic( void ) const { double AmoebaOutOfPlaneBendForce::getAmoebaGlobalOutOfPlaneBendSextic() const {
return _globalSexticK; return _globalSexticK;
} }
......
...@@ -66,7 +66,7 @@ void AmoebaVdwForce::setSigmaCombiningRule( const std::string& inputSigmaCombini ...@@ -66,7 +66,7 @@ void AmoebaVdwForce::setSigmaCombiningRule( const std::string& inputSigmaCombini
sigmaCombiningRule = inputSigmaCombiningRule; sigmaCombiningRule = inputSigmaCombiningRule;
} }
const std::string& AmoebaVdwForce::getSigmaCombiningRule( void ) const { const std::string& AmoebaVdwForce::getSigmaCombiningRule() const {
return sigmaCombiningRule; return sigmaCombiningRule;
} }
...@@ -74,7 +74,7 @@ void AmoebaVdwForce::setEpsilonCombiningRule( const std::string& inputEpsilonCom ...@@ -74,7 +74,7 @@ void AmoebaVdwForce::setEpsilonCombiningRule( const std::string& inputEpsilonCom
epsilonCombiningRule = inputEpsilonCombiningRule; epsilonCombiningRule = inputEpsilonCombiningRule;
} }
const std::string& AmoebaVdwForce::getEpsilonCombiningRule( void ) const { const std::string& AmoebaVdwForce::getEpsilonCombiningRule() const {
return epsilonCombiningRule; return epsilonCombiningRule;
} }
......
...@@ -63,35 +63,35 @@ void AmoebaWcaDispersionForce::setParticleParameters(int particleIndex, double r ...@@ -63,35 +63,35 @@ void AmoebaWcaDispersionForce::setParticleParameters(int particleIndex, double r
parameters[particleIndex].epsilon = epsilon; parameters[particleIndex].epsilon = epsilon;
} }
double AmoebaWcaDispersionForce::getEpso( void ) const { double AmoebaWcaDispersionForce::getEpso() const {
return epso; return epso;
} }
double AmoebaWcaDispersionForce::getEpsh( void ) const { double AmoebaWcaDispersionForce::getEpsh() const {
return epsh; return epsh;
} }
double AmoebaWcaDispersionForce::getRmino( void ) const { double AmoebaWcaDispersionForce::getRmino() const {
return rmino; return rmino;
} }
double AmoebaWcaDispersionForce::getRminh( void ) const { double AmoebaWcaDispersionForce::getRminh() const {
return rminh; return rminh;
} }
double AmoebaWcaDispersionForce::getAwater( void ) const { double AmoebaWcaDispersionForce::getAwater() const {
return awater; return awater;
} }
double AmoebaWcaDispersionForce::getShctd( void ) const { double AmoebaWcaDispersionForce::getShctd() const {
return shctd; return shctd;
} }
double AmoebaWcaDispersionForce::getDispoff( void ) const { double AmoebaWcaDispersionForce::getDispoff() const {
return dispoff; return dispoff;
} }
double AmoebaWcaDispersionForce::getSlevy( void ) const { double AmoebaWcaDispersionForce::getSlevy() const {
return slevy; return slevy;
} }
......
...@@ -33,8 +33,6 @@ ...@@ -33,8 +33,6 @@
using std::vector; using std::vector;
using namespace OpenMM; using namespace OpenMM;
#undef AMOEBA_DEBUG
AmoebaReferenceMultipoleForce::AmoebaReferenceMultipoleForce() : AmoebaReferenceMultipoleForce::AmoebaReferenceMultipoleForce() :
_nonbondedMethod(NoCutoff), _nonbondedMethod(NoCutoff),
_numParticles(0), _numParticles(0),
...@@ -233,33 +231,6 @@ void AmoebaReferenceMultipoleForce::setupScaleMaps(const vector< vector< vector< ...@@ -233,33 +231,6 @@ void AmoebaReferenceMultipoleForce::setupScaleMaps(const vector< vector< vector<
} }
} }
} }
//showScaleMapForParticle(2, stderr);
//showScaleMapForParticle(10, stderr);
return;
}
void AmoebaReferenceMultipoleForce::showScaleMapForParticle(unsigned int particleI, FILE* log) const
{
#ifdef AMOEBA_DEBUG
(void) fprintf(log, "Scale map particle %5u maxIndex=%u\n", particleI, _maxScaleIndex[particleI]);
std::string scaleNames[LAST_SCALE_TYPE_INDEX] = { "D", "P", "M" };
for (unsigned int ii = 0; ii < _scaleMaps[particleI].size(); ii++) {
MapIntRealOpenMM scaleMap = _scaleMaps[particleI][ii];
(void) fprintf(log, " %s scale ", scaleNames[ii].c_str());
for (MapIntRealOpenMMCI jj = scaleMap.begin(); jj != scaleMap.end(); jj++) {
//if (jj->first > particleI && jj->second < 1.0)
if (jj->second < 1.0)
(void) fprintf(log, "%4d=%5.2f ", jj->first, jj->second);
}
(void) fprintf(log, "\n");
}
(void) fprintf(log, "\n");
(void) fflush(log);
#endif
} }
RealOpenMM AmoebaReferenceMultipoleForce::getMultipoleScaleFactor(unsigned int particleI, unsigned int particleJ, ScaleType scaleType) const RealOpenMM AmoebaReferenceMultipoleForce::getMultipoleScaleFactor(unsigned int particleI, unsigned int particleJ, ScaleType scaleType) const
......
...@@ -712,15 +712,6 @@ protected: ...@@ -712,15 +712,6 @@ protected:
*/ */
void setupScaleMaps(const std::vector< std::vector< std::vector<int> > >& multipoleAtomCovalentInfo); void setupScaleMaps(const std::vector< std::vector< std::vector<int> > >& multipoleAtomCovalentInfo);
/**
* Show scaling factor map
*
* @param particleI index of particle whose scale map is to be shown
* @param log output destination
*
*/
void showScaleMapForParticle(unsigned int particleI, FILE* log) const;
/** /**
* Get multipole scale factor for particleI & particleJ * Get multipole scale factor for particleI & particleJ
* *
......
...@@ -77,7 +77,7 @@ static void crossProductVector3(double* vectorX, double* vectorY, double* vector ...@@ -77,7 +77,7 @@ static void crossProductVector3(double* vectorX, double* vectorY, double* vector
static void getPrefactorsGivenAngleCosine(double cosine, double idealAngle, double quadraticK, double cubicK, static void getPrefactorsGivenAngleCosine(double cosine, double idealAngle, double quadraticK, double cubicK,
double quarticK, double penticK, double sexticK, double quarticK, double penticK, double sexticK,
double* dEdR, double* energyTerm, FILE* log) { double* dEdR, double* energyTerm) {
double angle; double angle;
if (cosine >= 1.0) { if (cosine >= 1.0) {
...@@ -89,12 +89,6 @@ static void getPrefactorsGivenAngleCosine(double cosine, double idealAngle, doub ...@@ -89,12 +89,6 @@ static void getPrefactorsGivenAngleCosine(double cosine, double idealAngle, doub
else { else {
angle = RADIAN*acos(cosine); angle = RADIAN*acos(cosine);
} }
#ifdef AMOEBA_DEBUG
if (log) {
(void) fprintf(log, "getPrefactorsGivenAngleCosine: cosine=%10.3e angle=%10.3e ideal=%10.3e\n", cosine, angle, idealAngle);
(void) fflush(log);
}
#endif
double deltaIdeal = angle - idealAngle; double deltaIdeal = angle - idealAngle;
double deltaIdeal2 = deltaIdeal*deltaIdeal; double deltaIdeal2 = deltaIdeal*deltaIdeal;
...@@ -122,7 +116,7 @@ static void getPrefactorsGivenAngleCosine(double cosine, double idealAngle, doub ...@@ -122,7 +116,7 @@ static void getPrefactorsGivenAngleCosine(double cosine, double idealAngle, doub
} }
static void computeAmoebaAngleForce(int bondIndex, std::vector<Vec3>& positions, AmoebaAngleForce& AmoebaAngleForce, static void computeAmoebaAngleForce(int bondIndex, std::vector<Vec3>& positions, AmoebaAngleForce& AmoebaAngleForce,
std::vector<Vec3>& forces, double* energy, FILE* log) { std::vector<Vec3>& forces, double* energy) {
int particle1, particle2, particle3; int particle1, particle2, particle3;
double idealAngle; double idealAngle;
...@@ -133,13 +127,6 @@ static void computeAmoebaAngleForce(int bondIndex, std::vector<Vec3>& positions ...@@ -133,13 +127,6 @@ static void computeAmoebaAngleForce(int bondIndex, std::vector<Vec3>& positions
double quarticK = AmoebaAngleForce.getAmoebaGlobalAngleQuartic(); double quarticK = AmoebaAngleForce.getAmoebaGlobalAngleQuartic();
double penticK = AmoebaAngleForce.getAmoebaGlobalAnglePentic(); double penticK = AmoebaAngleForce.getAmoebaGlobalAnglePentic();
double sexticK = AmoebaAngleForce.getAmoebaGlobalAngleSextic(); double sexticK = AmoebaAngleForce.getAmoebaGlobalAngleSextic();
#ifdef AMOEBA_DEBUG
if (log) {
(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);
}
#endif
double deltaR[2][3]; double deltaR[2][3];
double r2_0 = 0.0; double r2_0 = 0.0;
...@@ -163,17 +150,10 @@ static void computeAmoebaAngleForce(int bondIndex, std::vector<Vec3>& positions ...@@ -163,17 +150,10 @@ static void computeAmoebaAngleForce(int bondIndex, std::vector<Vec3>& positions
double dot = deltaR[0][0]*deltaR[1][0] + deltaR[0][1]*deltaR[1][1] + deltaR[0][2]*deltaR[1][2]; double dot = deltaR[0][0]*deltaR[1][0] + deltaR[0][1]*deltaR[1][1] + deltaR[0][2]*deltaR[1][2];
double cosine = dot/sqrt(r2_0*r2_1); double cosine = dot/sqrt(r2_0*r2_1);
#ifdef AMOEBA_DEBUG
if (log) {
(void) fprintf(log, "dot=%10.3e r2_0=%10.3e r2_1=%10.3e\n", dot, r2_0, r2_1);
(void) fflush(log);
}
#endif
double dEdR; double dEdR;
double energyTerm; double energyTerm;
getPrefactorsGivenAngleCosine(cosine, idealAngle, quadraticK, cubicK, getPrefactorsGivenAngleCosine(cosine, idealAngle, quadraticK, cubicK,
quarticK, penticK, sexticK, &dEdR, &energyTerm, log); quarticK, penticK, sexticK, &dEdR, &energyTerm);
double termA = -dEdR/(r2_0*rp); double termA = -dEdR/(r2_0*rp);
double termC = dEdR/(r2_1*rp); double termC = dEdR/(r2_1*rp);
...@@ -203,7 +183,7 @@ static void computeAmoebaAngleForce(int bondIndex, std::vector<Vec3>& positions ...@@ -203,7 +183,7 @@ static void computeAmoebaAngleForce(int bondIndex, std::vector<Vec3>& positions
} }
static void computeAmoebaAngleForces(Context& context, AmoebaAngleForce& AmoebaAngleForce, static void computeAmoebaAngleForces(Context& context, AmoebaAngleForce& AmoebaAngleForce,
std::vector<Vec3>& expectedForces, double* expectedEnergy, FILE* log) { std::vector<Vec3>& expectedForces, double* expectedEnergy) {
// get positions and zero forces // get positions and zero forces
...@@ -219,50 +199,27 @@ static void computeAmoebaAngleForces(Context& context, AmoebaAngleForce& AmoebaA ...@@ -219,50 +199,27 @@ static void computeAmoebaAngleForces(Context& context, AmoebaAngleForce& AmoebaA
*expectedEnergy = 0.0; *expectedEnergy = 0.0;
for (int ii = 0; ii < AmoebaAngleForce.getNumAngles(); ii++) { for (int ii = 0; ii < AmoebaAngleForce.getNumAngles(); ii++) {
computeAmoebaAngleForce(ii, positions, AmoebaAngleForce, expectedForces, expectedEnergy, log); computeAmoebaAngleForce(ii, positions, AmoebaAngleForce, expectedForces, expectedEnergy);
} }
#ifdef AMOEBA_DEBUG
if (log) {
(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]);
}
(void) fflush(log);
}
#endif
return;
} }
void compareWithExpectedForceAndEnergy(Context& context, AmoebaAngleForce& AmoebaAngleForce, void compareWithExpectedForceAndEnergy(Context& context, AmoebaAngleForce& AmoebaAngleForce,
double tolerance, const std::string& idString, FILE* log) { double tolerance, const std::string& idString) {
std::vector<Vec3> expectedForces; std::vector<Vec3> expectedForces;
double expectedEnergy; double expectedEnergy;
computeAmoebaAngleForces(context, AmoebaAngleForce, expectedForces, &expectedEnergy, log); computeAmoebaAngleForces(context, AmoebaAngleForce, expectedForces, &expectedEnergy);
State state = context.getState(State::Forces | State::Energy); State state = context.getState(State::Forces | State::Energy);
const std::vector<Vec3> forces = state.getForces(); const std::vector<Vec3> forces = state.getForces();
#ifdef AMOEBA_DEBUG
if (log) {
(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]);
}
(void) fflush(log);
}
#endif
for (unsigned int ii = 0; ii < forces.size(); ii++) { for (unsigned int ii = 0; ii < forces.size(); ii++) {
ASSERT_EQUAL_VEC(expectedForces[ii], forces[ii], tolerance); ASSERT_EQUAL_VEC(expectedForces[ii], forces[ii], tolerance);
} }
ASSERT_EQUAL_TOL(expectedEnergy, state.getPotentialEnergy(), tolerance); ASSERT_EQUAL_TOL(expectedEnergy, state.getPotentialEnergy(), tolerance);
} }
void testOneAngle(FILE* log) { void testOneAngle() {
System system; System system;
int numberOfParticles = 3; int numberOfParticles = 3;
...@@ -299,7 +256,7 @@ void testOneAngle(FILE* log) { ...@@ -299,7 +256,7 @@ void testOneAngle(FILE* log) {
positions[2] = Vec3(0, 0, 1); positions[2] = Vec3(0, 0, 1);
context.setPositions(positions); context.setPositions(positions);
compareWithExpectedForceAndEnergy(context, *amoebaAngleForce, TOL, "testOneAngle", log); compareWithExpectedForceAndEnergy(context, *amoebaAngleForce, TOL, "testOneAngle");
// Try changing the angle parameters and make sure it's still correct. // Try changing the angle parameters and make sure it's still correct.
...@@ -307,14 +264,14 @@ void testOneAngle(FILE* log) { ...@@ -307,14 +264,14 @@ void testOneAngle(FILE* log) {
bool exceptionThrown = false; bool exceptionThrown = false;
try { try {
// This should throw an exception. // This should throw an exception.
compareWithExpectedForceAndEnergy(context, *amoebaAngleForce, TOL, "testOneAngle", log); compareWithExpectedForceAndEnergy(context, *amoebaAngleForce, TOL, "testOneAngle");
} }
catch (std::exception ex) { catch (std::exception ex) {
exceptionThrown = true; exceptionThrown = true;
} }
ASSERT(exceptionThrown); ASSERT(exceptionThrown);
amoebaAngleForce->updateParametersInContext(context); amoebaAngleForce->updateParametersInContext(context);
compareWithExpectedForceAndEnergy(context, *amoebaAngleForce, TOL, "testOneAngle", log); compareWithExpectedForceAndEnergy(context, *amoebaAngleForce, TOL, "testOneAngle");
} }
int main(int numberOfArguments, char* argv[]) { int main(int numberOfArguments, char* argv[]) {
...@@ -322,16 +279,7 @@ int main(int numberOfArguments, char* argv[]) { ...@@ -322,16 +279,7 @@ int main(int numberOfArguments, char* argv[]) {
try { try {
std::cout << "TestCudaAmoebaAngleForce running test..." << std::endl; std::cout << "TestCudaAmoebaAngleForce running test..." << std::endl;
registerAmoebaReferenceKernelFactories(); registerAmoebaReferenceKernelFactories();
//FILE* log = fopen("AmoebaAngleForce.log", "w");; testOneAngle();
FILE* log = NULL;
//FILE* log = stderr;
testOneAngle(log);
#ifdef AMOEBA_DEBUG
if (log && log != stderr)
(void) fclose(log);
#endif
} }
catch(const std::exception& e) { catch(const std::exception& e) {
std::cout << "exception: " << e.what() << std::endl; std::cout << "exception: " << e.what() << std::endl;
......
...@@ -85,7 +85,7 @@ static void computeAmoebaBondForce(int bondIndex, std::vector<Vec3>& positions, ...@@ -85,7 +85,7 @@ static void computeAmoebaBondForce(int bondIndex, std::vector<Vec3>& positions,
} }
static void computeAmoebaBondForces(Context& context, AmoebaBondForce& AmoebaBondForce, static void computeAmoebaBondForces(Context& context, AmoebaBondForce& AmoebaBondForce,
std::vector<Vec3>& expectedForces, double* expectedEnergy, FILE* log) { std::vector<Vec3>& expectedForces, double* expectedEnergy) {
// get positions and zero forces // get positions and zero forces
...@@ -103,37 +103,16 @@ static void computeAmoebaBondForces(Context& context, AmoebaBondForce& AmoebaBon ...@@ -103,37 +103,16 @@ static void computeAmoebaBondForces(Context& context, AmoebaBondForce& AmoebaBon
for (int ii = 0; ii < AmoebaBondForce.getNumBonds(); ii++) { for (int ii = 0; ii < AmoebaBondForce.getNumBonds(); ii++) {
computeAmoebaBondForce(ii, positions, AmoebaBondForce, expectedForces, expectedEnergy); computeAmoebaBondForce(ii, positions, AmoebaBondForce, expectedForces, expectedEnergy);
} }
#ifdef AMOEBA_DEBUG
if (log) {
(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]);
}
(void) fflush(log);
}
#endif
return;
} }
void compareWithExpectedForceAndEnergy(Context& context, AmoebaBondForce& AmoebaBondForce, double tolerance, const std::string& idString, FILE* log) { void compareWithExpectedForceAndEnergy(Context& context, AmoebaBondForce& AmoebaBondForce, double tolerance, const std::string& idString) {
std::vector<Vec3> expectedForces; std::vector<Vec3> expectedForces;
double expectedEnergy; double expectedEnergy;
computeAmoebaBondForces(context, AmoebaBondForce, expectedForces, &expectedEnergy, NULL); computeAmoebaBondForces(context, AmoebaBondForce, expectedForces, &expectedEnergy);
State state = context.getState(State::Forces | State::Energy); State state = context.getState(State::Forces | State::Energy);
const std::vector<Vec3> forces = state.getForces(); const std::vector<Vec3> forces = state.getForces();
#ifdef AMOEBA_DEBUG
if (log) {
(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]);
}
(void) fflush(log);
}
#endif
for (unsigned int ii = 0; ii < forces.size(); ii++) { for (unsigned int ii = 0; ii < forces.size(); ii++) {
ASSERT_EQUAL_VEC(expectedForces[ii], forces[ii], tolerance); ASSERT_EQUAL_VEC(expectedForces[ii], forces[ii], tolerance);
...@@ -141,7 +120,7 @@ void compareWithExpectedForceAndEnergy(Context& context, AmoebaBondForce& Amoeba ...@@ -141,7 +120,7 @@ void compareWithExpectedForceAndEnergy(Context& context, AmoebaBondForce& Amoeba
ASSERT_EQUAL_TOL(expectedEnergy, state.getPotentialEnergy(), tolerance); ASSERT_EQUAL_TOL(expectedEnergy, state.getPotentialEnergy(), tolerance);
} }
void testOneBond(FILE* log) { void testOneBond() {
System system; System system;
...@@ -168,10 +147,10 @@ void testOneBond(FILE* log) { ...@@ -168,10 +147,10 @@ void testOneBond(FILE* log) {
positions[1] = Vec3(0, 0, 0); positions[1] = Vec3(0, 0, 0);
context.setPositions(positions); context.setPositions(positions);
compareWithExpectedForceAndEnergy(context, *amoebaBondForce, TOL, "testOneBond", log); compareWithExpectedForceAndEnergy(context, *amoebaBondForce, TOL, "testOneBond");
} }
void testTwoBond(FILE* log) { void testTwoBond() {
System system; System system;
...@@ -203,7 +182,7 @@ void testTwoBond(FILE* log) { ...@@ -203,7 +182,7 @@ void testTwoBond(FILE* log) {
positions[2] = Vec3(1, 0, 1); positions[2] = Vec3(1, 0, 1);
context.setPositions(positions); context.setPositions(positions);
compareWithExpectedForceAndEnergy(context, *amoebaBondForce, TOL, "testTwoBond", log); compareWithExpectedForceAndEnergy(context, *amoebaBondForce, TOL, "testTwoBond");
// Try changing the bond parameters and make sure it's still correct. // Try changing the bond parameters and make sure it's still correct.
...@@ -212,14 +191,14 @@ void testTwoBond(FILE* log) { ...@@ -212,14 +191,14 @@ void testTwoBond(FILE* log) {
bool exceptionThrown = false; bool exceptionThrown = false;
try { try {
// This should throw an exception. // This should throw an exception.
compareWithExpectedForceAndEnergy(context, *amoebaBondForce, TOL, "testTwoBond", log); compareWithExpectedForceAndEnergy(context, *amoebaBondForce, TOL, "testTwoBond");
} }
catch (std::exception ex) { catch (std::exception ex) {
exceptionThrown = true; exceptionThrown = true;
} }
ASSERT(exceptionThrown); ASSERT(exceptionThrown);
amoebaBondForce->updateParametersInContext(context); amoebaBondForce->updateParametersInContext(context);
compareWithExpectedForceAndEnergy(context, *amoebaBondForce, TOL, "testTwoBond", log); compareWithExpectedForceAndEnergy(context, *amoebaBondForce, TOL, "testTwoBond");
} }
int main(int numberOfArguments, char* argv[]) { int main(int numberOfArguments, char* argv[]) {
...@@ -227,16 +206,8 @@ int main(int numberOfArguments, char* argv[]) { ...@@ -227,16 +206,8 @@ int main(int numberOfArguments, char* argv[]) {
try { try {
std::cout << "TestReferenceAmoebaBondForce running test..." << std::endl; std::cout << "TestReferenceAmoebaBondForce running test..." << std::endl;
registerAmoebaReferenceKernelFactories(); registerAmoebaReferenceKernelFactories();
FILE* log = NULL; //testOneBond();
//FILE* log = stderr; testTwoBond();
//testOneBond(log);
testTwoBond(log);
#ifdef AMOEBA_DEBUG
if (log && log != stderr)
(void) fclose(log);
#endif
} }
catch(const std::exception& e) { catch(const std::exception& e) {
std::cout << "exception: " << e.what() << std::endl; std::cout << "exception: " << e.what() << std::endl;
......
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