Skip to content

Commit

Permalink
Revert "+1 unittest"
Browse files Browse the repository at this point in the history
This reverts commit cd73129.
  • Loading branch information
etiennepalos committed Nov 14, 2023
1 parent cd73129 commit d7390aa
Showing 1 changed file with 0 additions and 88 deletions.
88 changes: 0 additions & 88 deletions src/unittests/unittest-energy2b.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,94 +96,6 @@ TEST_CASE("energy2b::get_2b_energy") {
}
}

SECTION("h2o-scan-h2o-scan") {
std::vector<double> xyz1 = {1.7474594210e+00, -1.4737233740e+00, -1.3296783390e+00, 2.2444822770e+00,
-1.7974450600e+00, -2.0835207810e+00, 1.0684055850e+00, -2.1338516330e+00,
-1.1304174950e+00, 1.7474594210e+00, -1.4737233740e+00, -1.3296783390e+00,
2.2444822770e+00, -1.7974450600e+00, -2.0835207810e+00, 1.0684055850e+00,
-2.1338516330e+00, -1.1304174950e+00};
std::vector<double> xyz2 = {7.4372664830e-01, 1.3745066180e+00, 8.2228117080e-01, 1.5966080550e+00,
9.4041883440e-01, 1.0251293750e+00, 8.4611620640e-01, 2.3077049320e+00,
1.0097486520e+00, 2.8905925930e+00, -1.7061104380e-01, 9.3095149180e-01,
2.7240924310e+00, -7.8786885510e-01, 2.0726128570e-01, 3.3243787470e+00,
-6.6848224410e-01, 1.6262376630e+00};
size_t nm = 2;
std::string mon1 = "h2o-scan";
std::string mon2 = "h2o-scan";

std::vector<double> grad1(xyz1.size(), 0.0);
std::vector<double> grad2(xyz2.size(), 0.0);
std::vector<double> virial(9, 0.0);

double expected_energy =2.214011876375 ;

std::vector<double> grad1_expected = {1.2640982749e-02 , -2.3077669434e-01 , 1.2376840384e-01 , -4.6067230665e-03 , 1.0009902713e-01 , -1.5382189451e-01 , 3.5854365610e-02 , 8.6544360024e-02 , -1.2745133179e-02 , 5.7362011396e+00 , 5.5668286710e+00 , 1.0122647808e+01 , 1.4730292480e-01 , -4.3422821376e-01 , -4.3543606078e-01 , -5.0482108050e-01 , -7.5943951187e-01 , -1.5713079965e-01};
std::vector<double> grad2_expected = {-8.4894551514e-02 , -2.1578871343e-02 , 1.0463983695e-01 , -7.8064383809e-02 , 5.9171204223e-02 , 5.2959672617e-02 , 1.1907031003e-01 , 6.5409743070e-03 , -1.1480088572e-01 ,-1.9534300165e+00 , 7.1934002511e-01 , -2.4483276281e+00 , -2.9923025520e+00 , -3.7438665298e+00 , -5.9462787088e+00 , -4.3295041543e-01 , -1.3486344407e+00 , -1.1354746105e+00};
std::vector<double> virial_expected = {5.4590987096, 4.6630700145, 10.5837127000, 4.6630700145, 2.0578605350, 7.8883842352, 10.5837127000, 7.8883842352, 17.5385211282};

SECTION("No gradients") {
double e = e2b::get_2b_energy(mon1, mon2, nm, xyz1, xyz2);
double e2 = e2b::get_2b_energy(mon2, mon1, nm, xyz2, xyz1);
REQUIRE(e == Approx(expected_energy).margin(TOL));
REQUIRE(e2 == Approx(expected_energy).margin(TOL));
}

SECTION("With gradients") {
double e = e2b::get_2b_energy(mon1, mon2, nm, xyz1, xyz2, grad1, grad2, &virial);
REQUIRE(e == Approx(expected_energy).margin(TOL));
REQUIRE(VectorsAreEqual(grad1, grad1_expected, TOL));
REQUIRE(VectorsAreEqual(grad2, grad2_expected, TOL));
REQUIRE(VectorsAreEqual(virial, virial_expected, TOL));
}
}
/*
SECTION("h2o-dcscan-h2o-dcscan") {
std::vector<double> xyz1 = {1.7474594210e+00, -1.4737233740e+00, -1.3296783390e+00, 2.2444822770e+00,
-1.7974450600e+00, -2.0835207810e+00, 1.0684055850e+00, -2.1338516330e+00,
-1.1304174950e+00, 1.7474594210e+00, -1.4737233740e+00, -1.3296783390e+00,
2.2444822770e+00, -1.7974450600e+00, -2.0835207810e+00, 1.0684055850e+00,
-2.1338516330e+00, -1.1304174950e+00};
std::vector<double> xyz2 = {7.4372664830e-01, 1.3745066180e+00, 8.2228117080e-01, 1.5966080550e+00,
9.4041883440e-01, 1.0251293750e+00, 8.4611620640e-01, 2.3077049320e+00,
1.0097486520e+00, 2.8905925930e+00, -1.7061104380e-01, 9.3095149180e-01,
2.7240924310e+00, -7.8786885510e-01, 2.0726128570e-01, 3.3243787470e+00,
-6.6848224410e-01, 1.6262376630e+00};
size_t nm = 2;
std::string mon1 = "h2o-dcscan";
std::string mon2 = "h2o-dcscan";
std::vector<double> grad1(xyz1.size(), 0.0);
std::vector<double> grad2(xyz2.size(), 0.0);
std::vector<double> virial(9, 0.0);
double expected_energy = ;
std::vector<double> grad1_expected = {
};
std::vector<double> grad2_expected = {
};
std::vector<double> virial_expected = {
};
SECTION("No gradients") {
double e = e2b::get_2b_energy(mon1, mon2, nm, xyz1, xyz2);
double e2 = e2b::get_2b_energy(mon2, mon1, nm, xyz2, xyz1);
REQUIRE(e == Approx(expected_energy).margin(TOL));
REQUIRE(e2 == Approx(expected_energy).margin(TOL));
}
SECTION("With gradients") {
double e = e2b::get_2b_energy(mon1, mon2, nm, xyz1, xyz2, grad1, grad2, &virial);
REQUIRE(e == Approx(expected_energy).margin(TOL));
REQUIRE(VectorsAreEqual(grad1, grad1_expected, TOL));
REQUIRE(VectorsAreEqual(grad2, grad2_expected, TOL));
REQUIRE(VectorsAreEqual(virial, virial_expected, TOL));
}
}
*/
SECTION("co2-co2") {
std::vector<double> xyz1 = {6.6630444410e-01, -3.8357176030e-01, 1.1519802350e-01, 1.7838183644e+00,
-1.9222069500e-01, -1.7587628680e-01, -4.4811475090e-01, -5.7997649630e-01,
Expand Down

0 comments on commit d7390aa

Please sign in to comment.