Commit 31786496 authored by Chengwen Liu's avatar Chengwen Liu
Browse files

bug fix TestVdw

parent 5dd5e142
...@@ -403,13 +403,6 @@ void testVdwAmmoniaCubicMeanWH() { ...@@ -403,13 +403,6 @@ void testVdwAmmoniaCubicMeanWH() {
std::string testName = "testVdwAmmoniaCubicMeanWH"; std::string testName = "testVdwAmmoniaCubicMeanWH";
// test alchemical VDW
void testVdwAlchemical(int power, double alpha, double lambda, AmoebaVdwForce::AlchemicalMethod method) {
std::string testName = "testVdwAlchemical";
int numberOfParticles = 8; int numberOfParticles = 8;
double boxDimension = -1.0; double boxDimension = -1.0;
double cutoff = 9000000.0; double cutoff = 9000000.0;
...@@ -431,6 +424,17 @@ void testVdwAlchemical(int power, double alpha, double lambda, AmoebaVdwForce::A ...@@ -431,6 +424,17 @@ void testVdwAlchemical(int power, double alpha, double lambda, AmoebaVdwForce::A
expectedForces[6] = Vec3(-1.8544507e+02, 8.4027272e-03, 6.0950274e+00); expectedForces[6] = Vec3(-1.8544507e+02, 8.4027272e-03, 6.0950274e+00);
expectedForces[7] = Vec3( 1.4159723e+00, 2.7168386e-01, -1.5376786e-01); expectedForces[7] = Vec3( 1.4159723e+00, 2.7168386e-01, -1.5376786e-01);
double tolerance = 1.0e-04;
compareForcesEnergy(testName, expectedEnergy, energy, expectedForces, forces, tolerance);
}
// test alchemical VDW
void testVdwAlchemical(int power, double alpha, double lambda, AmoebaVdwForce::AlchemicalMethod method) {
std::string testName = "testVdwAlchemical";
setupAndGetForcesEnergyVdwAmmonia2("CUBIC-MEAN", "HHG", cutoff, boxDimension, forces, energy, setupAndGetForcesEnergyVdwAmmonia2("CUBIC-MEAN", "HHG", cutoff, boxDimension, forces, energy,
method, power, alpha, lambda); method, power, alpha, lambda);
std::vector<Vec3> expectedForces(numberOfParticles); std::vector<Vec3> expectedForces(numberOfParticles);
...@@ -451,7 +455,6 @@ void testVdwAlchemical(int power, double alpha, double lambda, AmoebaVdwForce::A ...@@ -451,7 +455,6 @@ void testVdwAlchemical(int power, double alpha, double lambda, AmoebaVdwForce::A
expectedForces[i] *= scale; expectedForces[i] *= scale;
} }
double tolerance = 1.0e-04; double tolerance = 1.0e-04;
compareForcesEnergy(testName, expectedEnergy, energy, expectedForces, forces, tolerance); compareForcesEnergy(testName, expectedEnergy, energy, expectedForces, forces, tolerance);
} }
......
...@@ -466,6 +466,9 @@ void testVdwAlchemical(int power, double alpha, double lambda, AmoebaVdwForce::A ...@@ -466,6 +466,9 @@ void testVdwAlchemical(int power, double alpha, double lambda, AmoebaVdwForce::A
for (int i=0; i<8; i++) { for (int i=0; i<8; i++) {
expectedForces[i] *= scale; expectedForces[i] *= scale;
} }
double tolerance = 1.0e-04;
compareForcesEnergy(testName, expectedEnergy, energy, expectedForces, forces, tolerance);
} }
// test VDW w/ sigmaRule=Arithmetic and epsilonRule=Arithmetic // test VDW w/ sigmaRule=Arithmetic and epsilonRule=Arithmetic
......
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