modernize and remove dead code
This commit is contained in:
@ -362,8 +362,9 @@ TEST(AngleStyle, plain)
|
|||||||
EXPECT_STRESS("run_stress (newton on)", angle->virial, test_config.run_stress, epsilon);
|
EXPECT_STRESS("run_stress (newton on)", angle->virial, test_config.run_stress, epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
int id = lmp->modify->find_compute("sum");
|
auto *icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
double energy = lmp->modify->compute[id]->compute_scalar();
|
double energy = 0.0;
|
||||||
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(angle->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(angle->energy, test_config.run_energy, epsilon);
|
||||||
EXPECT_FP_LE_WITH_EPS(angle->energy, energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(angle->energy, energy, epsilon);
|
||||||
if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl;
|
if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl;
|
||||||
@ -393,8 +394,8 @@ TEST(AngleStyle, plain)
|
|||||||
EXPECT_STRESS("run_stress (newton off)", angle->virial, test_config.run_stress, epsilon);
|
EXPECT_STRESS("run_stress (newton off)", angle->virial, test_config.run_stress, epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
id = lmp->modify->find_compute("sum");
|
icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
energy = lmp->modify->compute[id]->compute_scalar();
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(angle->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(angle->energy, test_config.run_energy, epsilon);
|
||||||
EXPECT_FP_LE_WITH_EPS(angle->energy, energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(angle->energy, energy, epsilon);
|
||||||
if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl;
|
if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl;
|
||||||
@ -480,8 +481,9 @@ TEST(AngleStyle, omp)
|
|||||||
EXPECT_STRESS("run_stress (newton on)", angle->virial, test_config.run_stress, 10 * epsilon);
|
EXPECT_STRESS("run_stress (newton on)", angle->virial, test_config.run_stress, 10 * epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
int id = lmp->modify->find_compute("sum");
|
auto *icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
double energy = lmp->modify->compute[id]->compute_scalar();
|
double energy = 0.0;
|
||||||
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(angle->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(angle->energy, test_config.run_energy, epsilon);
|
||||||
// TODO: this is currently broken for OPENMP with angle style hybrid
|
// TODO: this is currently broken for OPENMP with angle style hybrid
|
||||||
// needs to be fixed in the main code somewhere. Not sure where, though.
|
// needs to be fixed in the main code somewhere. Not sure where, though.
|
||||||
@ -515,8 +517,8 @@ TEST(AngleStyle, omp)
|
|||||||
10 * epsilon);
|
10 * epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
id = lmp->modify->find_compute("sum");
|
icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
energy = lmp->modify->compute[id]->compute_scalar();
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(angle->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(angle->energy, test_config.run_energy, epsilon);
|
||||||
// TODO: this is currently broken for OPENMP with angle style hybrid
|
// TODO: this is currently broken for OPENMP with angle style hybrid
|
||||||
// needs to be fixed in the main code somewhere. Not sure where, though.
|
// needs to be fixed in the main code somewhere. Not sure where, though.
|
||||||
@ -582,8 +584,9 @@ TEST(AngleStyle, kokkos_omp)
|
|||||||
EXPECT_STRESS("run_stress (newton on)", angle->virial, test_config.run_stress, epsilon);
|
EXPECT_STRESS("run_stress (newton on)", angle->virial, test_config.run_stress, epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
int id = lmp->modify->find_compute("sum");
|
auto *icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
double energy = lmp->modify->compute[id]->compute_scalar();
|
double energy = 0.0;
|
||||||
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(angle->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(angle->energy, test_config.run_energy, epsilon);
|
||||||
EXPECT_FP_LE_WITH_EPS(angle->energy, energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(angle->energy, energy, epsilon);
|
||||||
if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl;
|
if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl;
|
||||||
@ -613,8 +616,8 @@ TEST(AngleStyle, kokkos_omp)
|
|||||||
EXPECT_STRESS("run_stress (newton off)", angle->virial, test_config.run_stress, epsilon);
|
EXPECT_STRESS("run_stress (newton off)", angle->virial, test_config.run_stress, epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
id = lmp->modify->find_compute("sum");
|
icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
energy = lmp->modify->compute[id]->compute_scalar();
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(angle->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(angle->energy, test_config.run_energy, epsilon);
|
||||||
EXPECT_FP_LE_WITH_EPS(angle->energy, energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(angle->energy, energy, epsilon);
|
||||||
if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl;
|
if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl;
|
||||||
@ -649,7 +652,6 @@ TEST(AngleStyle, kokkos_omp)
|
|||||||
if (!verbose) ::testing::internal::GetCapturedStdout();
|
if (!verbose) ::testing::internal::GetCapturedStdout();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
TEST(AngleStyle, numdiff)
|
TEST(AngleStyle, numdiff)
|
||||||
{
|
{
|
||||||
if (!LAMMPS::is_installed_pkg("EXTRA-FIX")) GTEST_SKIP();
|
if (!LAMMPS::is_installed_pkg("EXTRA-FIX")) GTEST_SKIP();
|
||||||
|
|||||||
@ -362,8 +362,9 @@ TEST(BondStyle, plain)
|
|||||||
EXPECT_STRESS("run_stress (newton on)", bond->virial, test_config.run_stress, epsilon);
|
EXPECT_STRESS("run_stress (newton on)", bond->virial, test_config.run_stress, epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
int id = lmp->modify->find_compute("sum");
|
auto *icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
double energy = lmp->modify->compute[id]->compute_scalar();
|
double energy = 0.0;
|
||||||
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(bond->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(bond->energy, test_config.run_energy, epsilon);
|
||||||
EXPECT_FP_LE_WITH_EPS(bond->energy, energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(bond->energy, energy, epsilon);
|
||||||
if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl;
|
if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl;
|
||||||
@ -393,8 +394,8 @@ TEST(BondStyle, plain)
|
|||||||
EXPECT_STRESS("run_stress (newton off)", bond->virial, test_config.run_stress, epsilon);
|
EXPECT_STRESS("run_stress (newton off)", bond->virial, test_config.run_stress, epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
id = lmp->modify->find_compute("sum");
|
icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
energy = lmp->modify->compute[id]->compute_scalar();
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(bond->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(bond->energy, test_config.run_energy, epsilon);
|
||||||
EXPECT_FP_LE_WITH_EPS(bond->energy, energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(bond->energy, energy, epsilon);
|
||||||
if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl;
|
if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl;
|
||||||
@ -482,8 +483,9 @@ TEST(BondStyle, omp)
|
|||||||
EXPECT_STRESS("run_stress (newton on)", bond->virial, test_config.run_stress, 10 * epsilon);
|
EXPECT_STRESS("run_stress (newton on)", bond->virial, test_config.run_stress, 10 * epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
int id = lmp->modify->find_compute("sum");
|
auto *icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
double energy = lmp->modify->compute[id]->compute_scalar();
|
double energy = 0.0;
|
||||||
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(bond->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(bond->energy, test_config.run_energy, epsilon);
|
||||||
// TODO: this is currently broken for OPENMP with bond style hybrid
|
// TODO: this is currently broken for OPENMP with bond style hybrid
|
||||||
// needs to be fixed in the main code somewhere. Not sure where, though.
|
// needs to be fixed in the main code somewhere. Not sure where, though.
|
||||||
@ -517,8 +519,8 @@ TEST(BondStyle, omp)
|
|||||||
10 * epsilon);
|
10 * epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
id = lmp->modify->find_compute("sum");
|
icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
energy = lmp->modify->compute[id]->compute_scalar();
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(bond->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(bond->energy, test_config.run_energy, epsilon);
|
||||||
// TODO: this is currently broken for OPENMP with bond style hybrid
|
// TODO: this is currently broken for OPENMP with bond style hybrid
|
||||||
// needs to be fixed in the main code somewhere. Not sure where, though.
|
// needs to be fixed in the main code somewhere. Not sure where, though.
|
||||||
@ -584,13 +586,13 @@ TEST(BondStyle, kokkos_omp)
|
|||||||
EXPECT_STRESS("run_stress (newton on)", bond->virial, test_config.run_stress, 10 * epsilon);
|
EXPECT_STRESS("run_stress (newton on)", bond->virial, test_config.run_stress, 10 * epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
int id = lmp->modify->find_compute("sum");
|
auto *icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
double energy = lmp->modify->compute[id]->compute_scalar();
|
if (icompute) icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(bond->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(bond->energy, test_config.run_energy, epsilon);
|
||||||
|
|
||||||
// FIXME: this is currently broken ??? for KOKKOS with bond style hybrid
|
// FIXME: this is currently broken ??? for KOKKOS with bond style hybrid
|
||||||
// needs to be fixed in the main code somewhere. Not sure where, though.
|
// needs to be fixed in the main code somewhere. Not sure where, though.
|
||||||
//if (test_config.bond_style.substr(0, 6) != "hybrid")
|
// if (test_config.bond_style.substr(0, 6) != "hybrid")
|
||||||
// EXPECT_FP_LE_WITH_EPS(bond->energy, energy, epsilon);
|
// EXPECT_FP_LE_WITH_EPS(bond->energy, energy, epsilon);
|
||||||
|
|
||||||
if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl;
|
if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl;
|
||||||
@ -621,13 +623,13 @@ TEST(BondStyle, kokkos_omp)
|
|||||||
10 * epsilon);
|
10 * epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
id = lmp->modify->find_compute("sum");
|
icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
energy = lmp->modify->compute[id]->compute_scalar();
|
if (icompute) icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(bond->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(bond->energy, test_config.run_energy, epsilon);
|
||||||
|
|
||||||
// FIXME: this is currently broken ??? for KOKKOS with bond style hybrid
|
// FIXME: this is currently broken ??? for KOKKOS with bond style hybrid
|
||||||
// needs to be fixed in the main code somewhere. Not sure where, though.
|
// needs to be fixed in the main code somewhere. Not sure where, though.
|
||||||
//if (test_config.bond_style.substr(0, 6) != "hybrid")
|
// if (test_config.bond_style.substr(0, 6) != "hybrid")
|
||||||
// EXPECT_FP_LE_WITH_EPS(bond->energy, energy, epsilon);
|
// EXPECT_FP_LE_WITH_EPS(bond->energy, energy, epsilon);
|
||||||
|
|
||||||
if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl;
|
if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl;
|
||||||
|
|||||||
@ -363,8 +363,9 @@ TEST(DihedralStyle, plain)
|
|||||||
EXPECT_STRESS("run_stress (newton on)", dihedral->virial, test_config.run_stress, epsilon);
|
EXPECT_STRESS("run_stress (newton on)", dihedral->virial, test_config.run_stress, epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
int id = lmp->modify->find_compute("sum");
|
auto *icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
double energy = lmp->modify->compute[id]->compute_scalar();
|
double energy = 0.0;
|
||||||
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.run_energy, epsilon);
|
||||||
EXPECT_FP_LE_WITH_EPS(dihedral->energy, energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(dihedral->energy, energy, epsilon);
|
||||||
if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl;
|
if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl;
|
||||||
@ -394,8 +395,8 @@ TEST(DihedralStyle, plain)
|
|||||||
EXPECT_STRESS("run_stress (newton off)", dihedral->virial, test_config.run_stress, epsilon);
|
EXPECT_STRESS("run_stress (newton off)", dihedral->virial, test_config.run_stress, epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
id = lmp->modify->find_compute("sum");
|
icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
energy = lmp->modify->compute[id]->compute_scalar();
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.run_energy, epsilon);
|
||||||
EXPECT_FP_LE_WITH_EPS(dihedral->energy, energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(dihedral->energy, energy, epsilon);
|
||||||
if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl;
|
if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl;
|
||||||
@ -484,8 +485,9 @@ TEST(DihedralStyle, omp)
|
|||||||
EXPECT_STRESS("run_stress (newton on)", dihedral->virial, test_config.run_stress, 10 * epsilon);
|
EXPECT_STRESS("run_stress (newton on)", dihedral->virial, test_config.run_stress, 10 * epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
int id = lmp->modify->find_compute("sum");
|
auto *icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
double energy = lmp->modify->compute[id]->compute_scalar();
|
double energy = 0.0;
|
||||||
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.run_energy, epsilon);
|
||||||
// TODO: this is currently broken for OPENMP with dihedral style hybrid
|
// TODO: this is currently broken for OPENMP with dihedral style hybrid
|
||||||
// needs to be fixed in the main code somewhere. Not sure where, though.
|
// needs to be fixed in the main code somewhere. Not sure where, though.
|
||||||
@ -519,8 +521,8 @@ TEST(DihedralStyle, omp)
|
|||||||
10 * epsilon);
|
10 * epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
id = lmp->modify->find_compute("sum");
|
icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
energy = lmp->modify->compute[id]->compute_scalar();
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.run_energy, epsilon);
|
||||||
// TODO: this is currently broken for OPENMP with dihedral style hybrid
|
// TODO: this is currently broken for OPENMP with dihedral style hybrid
|
||||||
// needs to be fixed in the main code somewhere. Not sure where, though.
|
// needs to be fixed in the main code somewhere. Not sure where, though.
|
||||||
@ -587,8 +589,8 @@ TEST(DihedralStyle, kokkos_omp)
|
|||||||
EXPECT_STRESS("run_stress (newton on)", dihedral->virial, test_config.run_stress, 10 * epsilon);
|
EXPECT_STRESS("run_stress (newton on)", dihedral->virial, test_config.run_stress, 10 * epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
int id = lmp->modify->find_compute("sum");
|
auto *icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
double energy = lmp->modify->compute[id]->compute_scalar();
|
if (icompute) icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.run_energy, epsilon);
|
||||||
|
|
||||||
// FIXME: this is currently broken ??? for KOKKOS with dihedral style hybrid
|
// FIXME: this is currently broken ??? for KOKKOS with dihedral style hybrid
|
||||||
@ -623,8 +625,8 @@ TEST(DihedralStyle, kokkos_omp)
|
|||||||
10 * epsilon);
|
10 * epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
id = lmp->modify->find_compute("sum");
|
auto *icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
energy = lmp->modify->compute[id]->compute_scalar();
|
if (icompute) icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(dihedral->energy, test_config.run_energy, epsilon);
|
||||||
|
|
||||||
// FIXME: this is currently broken ??? for KOKKOS with dihedral style hybrid
|
// FIXME: this is currently broken ??? for KOKKOS with dihedral style hybrid
|
||||||
|
|||||||
@ -356,8 +356,9 @@ TEST(ImproperStyle, plain)
|
|||||||
EXPECT_STRESS("run_stress (newton on)", improper->virial, test_config.run_stress, epsilon);
|
EXPECT_STRESS("run_stress (newton on)", improper->virial, test_config.run_stress, epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
int id = lmp->modify->find_compute("sum");
|
auto *icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
double energy = lmp->modify->compute[id]->compute_scalar();
|
double energy = 0.0;
|
||||||
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.run_energy, epsilon);
|
||||||
EXPECT_FP_LE_WITH_EPS(improper->energy, energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(improper->energy, energy, epsilon);
|
||||||
if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl;
|
if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl;
|
||||||
@ -387,8 +388,8 @@ TEST(ImproperStyle, plain)
|
|||||||
EXPECT_STRESS("run_stress (newton off)", improper->virial, test_config.run_stress, epsilon);
|
EXPECT_STRESS("run_stress (newton off)", improper->virial, test_config.run_stress, epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
id = lmp->modify->find_compute("sum");
|
icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
energy = lmp->modify->compute[id]->compute_scalar();
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.run_energy, epsilon);
|
||||||
EXPECT_FP_LE_WITH_EPS(improper->energy, energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(improper->energy, energy, epsilon);
|
||||||
if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl;
|
if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl;
|
||||||
@ -477,8 +478,9 @@ TEST(ImproperStyle, omp)
|
|||||||
EXPECT_STRESS("run_stress (newton on)", improper->virial, test_config.run_stress, 10 * epsilon);
|
EXPECT_STRESS("run_stress (newton on)", improper->virial, test_config.run_stress, 10 * epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
int id = lmp->modify->find_compute("sum");
|
auto *icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
double energy = lmp->modify->compute[id]->compute_scalar();
|
double energy = 0.0;
|
||||||
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.run_energy, epsilon);
|
||||||
// TODO: this is currently broken for OPENMP with improper style hybrid
|
// TODO: this is currently broken for OPENMP with improper style hybrid
|
||||||
// needs to be fixed in the main code somewhere. Not sure where, though.
|
// needs to be fixed in the main code somewhere. Not sure where, though.
|
||||||
@ -512,8 +514,8 @@ TEST(ImproperStyle, omp)
|
|||||||
10 * epsilon);
|
10 * epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
id = lmp->modify->find_compute("sum");
|
icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
energy = lmp->modify->compute[id]->compute_scalar();
|
if (icompute) energy = icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.run_energy, epsilon);
|
||||||
// TODO: this is currently broken for OPENMP with improper style hybrid
|
// TODO: this is currently broken for OPENMP with improper style hybrid
|
||||||
// needs to be fixed in the main code somewhere. Not sure where, though.
|
// needs to be fixed in the main code somewhere. Not sure where, though.
|
||||||
@ -532,8 +534,9 @@ TEST(ImproperStyle, kokkos_omp)
|
|||||||
if (!LAMMPS::is_installed_pkg("KOKKOS")) GTEST_SKIP();
|
if (!LAMMPS::is_installed_pkg("KOKKOS")) GTEST_SKIP();
|
||||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||||
|
|
||||||
LAMMPS::argv args = {"ImproperStyle", "-log", "none", "-echo", "screen", "-nocite",
|
LAMMPS::argv args = {"ImproperStyle", "-log", "none", "-echo", "screen",
|
||||||
"-k", "on", "t", "4", "-sf", "kk"};
|
"-nocite", "-k", "on", "t", "4",
|
||||||
|
"-sf", "kk"};
|
||||||
|
|
||||||
::testing::internal::CaptureStdout();
|
::testing::internal::CaptureStdout();
|
||||||
LAMMPS *lmp = init_lammps(args, test_config, true);
|
LAMMPS *lmp = init_lammps(args, test_config, true);
|
||||||
@ -579,12 +582,12 @@ TEST(ImproperStyle, kokkos_omp)
|
|||||||
EXPECT_STRESS("run_stress (newton on)", improper->virial, test_config.run_stress, 10 * epsilon);
|
EXPECT_STRESS("run_stress (newton on)", improper->virial, test_config.run_stress, 10 * epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
int id = lmp->modify->find_compute("sum");
|
auto *icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
double energy = lmp->modify->compute[id]->compute_scalar();
|
if (icompute) icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.run_energy, epsilon);
|
||||||
// FIXME: this is currently broken ??? for KOKKOS with improper style hybrid
|
// FIXME: this is currently broken ??? for KOKKOS with improper style hybrid
|
||||||
// needs to be fixed in the main code somewhere. Not sure where, though.
|
// needs to be fixed in the main code somewhere. Not sure where, though.
|
||||||
//if (test_config.improper_style.substr(0, 6) != "hybrid")
|
// if (test_config.improper_style.substr(0, 6) != "hybrid")
|
||||||
// EXPECT_FP_LE_WITH_EPS(improper->energy, energy, epsilon);
|
// EXPECT_FP_LE_WITH_EPS(improper->energy, energy, epsilon);
|
||||||
if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl;
|
if (print_stats) std::cerr << "run_energy stats, newton on: " << stats << std::endl;
|
||||||
|
|
||||||
@ -614,12 +617,12 @@ TEST(ImproperStyle, kokkos_omp)
|
|||||||
10 * epsilon);
|
10 * epsilon);
|
||||||
|
|
||||||
stats.reset();
|
stats.reset();
|
||||||
id = lmp->modify->find_compute("sum");
|
icompute = lmp->modify->get_compute_by_id("sum");
|
||||||
energy = lmp->modify->compute[id]->compute_scalar();
|
if (icompute) icompute->compute_scalar();
|
||||||
EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.run_energy, epsilon);
|
EXPECT_FP_LE_WITH_EPS(improper->energy, test_config.run_energy, epsilon);
|
||||||
// FIXME: this is currently broken ??? for KOKKOS with improper style hybrid
|
// FIXME: this is currently broken ??? for KOKKOS with improper style hybrid
|
||||||
// needs to be fixed in the main code somewhere. Not sure where, though.
|
// needs to be fixed in the main code somewhere. Not sure where, though.
|
||||||
//if (test_config.improper_style.substr(0, 6) != "hybrid")
|
// if (test_config.improper_style.substr(0, 6) != "hybrid")
|
||||||
// EXPECT_FP_LE_WITH_EPS(improper->energy, energy, epsilon);
|
// EXPECT_FP_LE_WITH_EPS(improper->energy, energy, epsilon);
|
||||||
if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl;
|
if (print_stats) std::cerr << "run_energy stats, newton off:" << stats << std::endl;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user