Commit 1f15a914 authored by Jason Swails's avatar Jason Swails
Browse files

More

} else { -->
}
else {

However, these were not my additions originally, but rather part of the Amoeba
test cases that have been around for awhile. I figured while I was at it, I
might as well update these styles as well.
parent b8f6d269
......@@ -82,9 +82,11 @@ static void getPrefactorsGivenAngleCosine( double cosine, double idealAngle, dou
double angle;
if( cosine >= 1.0 ){
angle = 0.0f;
} else if( cosine <= -1.0 ){
}
else if( cosine <= -1.0 ){
angle = RADIAN*PI_M;
} else {
}
else {
angle = RADIAN*acos(cosine);
}
#ifdef AMOEBA_DEBUG
......
......@@ -8488,7 +8488,8 @@ int main( int numberOfArguments, char* argv[] ) {
testGeneralizedKirkwoodVillinDirectPolarization( log );
testGeneralizedKirkwoodVillinMutualPolarization( log );
 
} catch(const std::exception& e) {
}
catch(const std::exception& e) {
std::cout << "exception: " << e.what() << std::endl;
std::cout << "FAIL - ERROR. Test failed." << std::endl;
return 1;
......
......@@ -84,9 +84,11 @@ static void getPrefactorsGivenInPlaneAngleCosine( double cosine, double idealInP
double angle;
if( cosine >= 1.0 ){
angle = 0.0f;
} else if( cosine <= -1.0 ){
}
else if( cosine <= -1.0 ){
angle = RADIAN*PI_M;
} else {
}
else {
angle = RADIAN*acos(cosine);
}
#ifdef AMOEBA_DEBUG
......@@ -245,7 +247,8 @@ static void computeAmoebaInPlaneAngleForce(int bondIndex, std::vector<Vec3>& po
forceTerm[dD][ii] = -( forceTerm[dA][ii] + forceTerm[dB][ii] + forceTerm[dC][ii] );
}
} else {
}
else {
for( int ii = 0; ii < 3; ii++ ){
forceTerm[dA][ii] += delta*deltaR[CDxdB][ii];
......
......@@ -841,7 +841,8 @@ static void testQuadrupoleValidation( FILE* log ){
std::stringstream buffer;
buffer << "Exception not thrown for quadrupole tensor w/ nonzero trace.";
throw OpenMMException(buffer.str());
} catch(const std::exception& e) {
}
catch(const std::exception& e) {
}
oxygenMolecularQuadrupole[4] -= 0.1;
......@@ -857,7 +858,8 @@ static void testQuadrupoleValidation( FILE* log ){
std::stringstream buffer;
buffer << "Exception not thrown for quadrupole tensor w/ nonzero trace.";
throw OpenMMException(buffer.str());
} catch(const std::exception& e) {
}
catch(const std::exception& e) {
}
oxygenMolecularQuadrupole[1] -= 0.1;
......@@ -871,7 +873,8 @@ static void testQuadrupoleValidation( FILE* log ){
std::stringstream buffer;
buffer << "Exception not thrown for quadrupole tensor w/ nonzero trace.";
throw OpenMMException(buffer.str());
} catch(const std::exception& e) {
}
catch(const std::exception& e) {
}
oxygenMolecularQuadrupole[2] -= 0.1;
......@@ -885,7 +888,8 @@ static void testQuadrupoleValidation( FILE* log ){
std::stringstream buffer;
buffer << "Exception not thrown for quadrupole tensor w/ nonzero trace.";
throw OpenMMException(buffer.str());
} catch(const std::exception& e) {
}
catch(const std::exception& e) {
}
oxygenMolecularQuadrupole[5] -= 0.1;
......@@ -1923,9 +1927,11 @@ static void setupAndGetForcesEnergyMultipoleLargeWater( AmoebaMultipoleForce::No
if( testName == "testSystemMultipoleMoments" ){
amoebaMultipoleForce->getSystemMultipoleMoments( context, outputMultipoleMoments );
} else if( testName == "testMultipoleGridPotential" ){
}
else if( testName == "testMultipoleGridPotential" ){
amoebaMultipoleForce->getElectrostaticPotential( inputGrid, context, outputGridPotential );
} else {
}
else {
State state = context.getState(State::Forces | State::Energy);
forces = state.getForces();
......@@ -2690,7 +2696,8 @@ static void testSystemMultipoleMoments( FILE* log ) {
double difference;
if( fabs( tinkerMoments[ii] ) > 0.0 ){
difference = fabs( outputMultipoleMoments[ii] - tinkerMoments[ii] )/fabs( tinkerMoments[ii] );
} else {
}
else {
difference = fabs( outputMultipoleMoments[ii] - tinkerMoments[ii] );
}
if( log ){
......@@ -2854,7 +2861,8 @@ int main( int numberOfArguments, char* argv[] ) {
testPMEMutualPolarizationLargeWater( log );
} catch(const std::exception& e) {
}
catch(const std::exception& e) {
std::cout << "exception: " << e.what() << std::endl;
std::cout << "FAIL - ERROR. Test failed." << std::endl;
return 1;
......
......@@ -134,9 +134,11 @@ static void computeAmoebaOutOfPlaneBendForce(int bondIndex, std::vector<Vec3>&
double angle;
if( cosine >= 1.0 ){
angle = 0.0;
} else if( cosine <= -1.0 ){
}
else if( cosine <= -1.0 ){
angle = PI_M;
} else {
}
else {
angle = RADIAN*acos(cosine);
}
#ifdef AMOEBA_DEBUG
......@@ -405,37 +407,43 @@ void testOneOutOfPlaneBend2( FILE* log, int setId ) {
particleIndices.push_back( 443 );
particleIndices.push_back( 444 );
kOutOfPlaneBend = 0.328682196E-01;
} else if( setId == 2 ){
}
else if( setId == 2 ){
particleIndices.push_back( 441 );
particleIndices.push_back( 442 );
particleIndices.push_back( 444 );
particleIndices.push_back( 443 );
kOutOfPlaneBend = 0.164493407E-01;
} else if( setId == 3 ){
}
else if( setId == 3 ){
particleIndices.push_back( 443 );
particleIndices.push_back( 442 );
particleIndices.push_back( 444 );
particleIndices.push_back( 441 );
kOutOfPlaneBend = 0.636650407E-02;
} else if( setId == 4 ){
}
else if( setId == 4 ){
particleIndices.push_back( 442 );
particleIndices.push_back( 444 );
particleIndices.push_back( 447 );
particleIndices.push_back( 448 );
kOutOfPlaneBend = 0.392956472E-02;
} else if( setId == 5 ){
}
else if( setId == 5 ){
particleIndices.push_back( 442 );
particleIndices.push_back( 444 );
particleIndices.push_back( 448 );
particleIndices.push_back( 447 );
kOutOfPlaneBend = 0.392956472E-02;
} else if( setId == 6 ){
}
else if( setId == 6 ){
particleIndices.push_back( 447 );
particleIndices.push_back( 444 );
particleIndices.push_back( 448 );
particleIndices.push_back( 442 );
kOutOfPlaneBend = 0.214755281E-01;
} else {
}
else {
#ifdef AMOEBA_DEBUG
if( log ){
(void) fprintf( log, "Set id %d not recognized.\n", setId );
......
......@@ -129,9 +129,11 @@ static void computeAmoebaStretchBendForce(int bondIndex, std::vector<Vec3>& pos
double angle;
if( cosine >= 1.0 ){
angle = 0.0;
} else if( cosine <= -1.0 ){
}
else if( cosine <= -1.0 ){
angle = PI_M;
} else {
}
else {
angle = RADIAN*acos(cosine);
}
......
......@@ -2620,7 +2620,8 @@ void testTorsionTorsion(int systemId, bool includeDerivs) {
expectedEnergy = -2.699654759E+00;
} else if( systemId == 1 ){
}
else if( systemId == 1 ){
// villin: 158 176 177 178 183 -1 0
chiralCheckAtomIndex = -1;
......@@ -2676,7 +2677,8 @@ int main( int numberOfArguments, char* argv[] ) {
registerAmoebaReferenceKernelFactories();
testTorsionTorsion(1, true);
testTorsionTorsion(1, false);
} catch(const std::exception& e) {
}
catch(const std::exception& e) {
std::cout << "exception: " << e.what() << std::endl;
std::cout << "FAIL - ERROR. Test failed." << std::endl;
return 1;
......
......@@ -75,7 +75,8 @@ void testVdw( FILE* log ) {
sigma = 1.70250E+00;
epsilon = 1.10000E-01;
reduction = 0.0;
} else {
}
else {
mass = 1.0;
indexIV = ii < 3 ? 0 : 3;
sigma = 1.32750E+00;
......@@ -89,7 +90,8 @@ void testVdw( FILE* log ) {
exclusions.push_back ( 0 );
exclusions.push_back ( 1 );
exclusions.push_back ( 2 );
} else {
}
else {
exclusions.push_back ( 3 );
exclusions.push_back ( 4 );
exclusions.push_back ( 5 );
......@@ -223,7 +225,8 @@ void setupAndGetForcesEnergyVdwAmmonia( const std::string& sigmaCombiningRule, c
system.setDefaultPeriodicBoxVectors( a, b, c );
amoebaVdwForce->setNonbondedMethod(AmoebaVdwForce::CutoffPeriodic);
amoebaVdwForce->setUseDispersionCorrection( 1 );
} else {
}
else {
amoebaVdwForce->setNonbondedMethod(AmoebaVdwForce::NoCutoff);
amoebaVdwForce->setUseDispersionCorrection( 0 );
}
......@@ -330,7 +333,8 @@ void setupAndGetForcesEnergyVdwAmmonia( const std::string& sigmaCombiningRule, c
if( boxDimension > 0.0 ){
ASSERT(amoebaVdwForce->usesPeriodicBoundaryConditions());
} else {
}
else {
ASSERT(!amoebaVdwForce->usesPeriodicBoundaryConditions());
}
......@@ -573,7 +577,8 @@ void setupAndGetForcesEnergyVdwWater( const std::string& sigmaCombiningRule, con
system.setDefaultPeriodicBoxVectors( a, b, c );
amoebaVdwForce->setNonbondedMethod(AmoebaVdwForce::CutoffPeriodic);
amoebaVdwForce->setUseDispersionCorrection( includeVdwDispersionCorrection );
} else {
}
else {
amoebaVdwForce->setNonbondedMethod(AmoebaVdwForce::NoCutoff);
amoebaVdwForce->setUseDispersionCorrection( 0 );
}
......@@ -1281,7 +1286,8 @@ void testVdwWater( int includeVdwDispersionCorrection, FILE* log ) {
std::string testName;
if( includeVdwDispersionCorrection ){
testName = "testVdwWaterWithDispersionCorrection";
} else {
}
else {
testName = "testVdwWater";
}
......@@ -1299,7 +1305,8 @@ void testVdwWater( int includeVdwDispersionCorrection, FILE* log ) {
double expectedEnergy;
if( includeVdwDispersionCorrection ){
expectedEnergy = 4.0108819792e+03;
} else {
}
else {
expectedEnergy = 4.0349101e+03;
}
......@@ -2036,7 +2043,8 @@ int main( int numberOfArguments, char* argv[] ) {
includeVdwDispersionCorrection = 1;
testVdwWater( includeVdwDispersionCorrection, log );
} catch(const std::exception& e) {
}
catch(const std::exception& e) {
std::cout << "exception: " << e.what() << std::endl;
std::cout << "FAIL - ERROR. Test failed." << std::endl;
return 1;
......
......@@ -185,7 +185,8 @@ int main( int numberOfArguments, char* argv[] ) {
testWcaDispersionAmmonia( log );
} catch(const std::exception& e) {
}
catch(const std::exception& e) {
std::cout << "exception: " << e.what() << std::endl;
std::cout << "FAIL - ERROR. Test failed." << std::endl;
return 1;
......
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