apply clang-format
This commit is contained in:
@ -518,6 +518,4 @@ void FixEfield::update_efield_variables()
|
|||||||
input->variable->compute_atom(evar, igroup, &efield[0][3], 4, 0);
|
input->variable->compute_atom(evar, igroup, &efield[0][3], 4, 0);
|
||||||
|
|
||||||
modify->addstep_compute(update->ntimestep + 1);
|
modify->addstep_compute(update->ntimestep + 1);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -542,8 +542,9 @@ TEST(DihedralStyle, kokkos_omp)
|
|||||||
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
if (test_config.skip_tests.count(test_info_->name())) GTEST_SKIP();
|
||||||
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) GTEST_SKIP();
|
if (!Info::has_accelerator_feature("KOKKOS", "api", "openmp")) GTEST_SKIP();
|
||||||
|
|
||||||
LAMMPS::argv args = {"DihedralStyle", "-log", "none", "-echo", "screen", "-nocite",
|
LAMMPS::argv args = {"DihedralStyle", "-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);
|
||||||
@ -595,9 +596,9 @@ TEST(DihedralStyle, kokkos_omp)
|
|||||||
|
|
||||||
// FIXME: this is currently broken ??? for KOKKOS with dihedral style hybrid
|
// FIXME: this is currently broken ??? for KOKKOS 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.
|
||||||
//if (test_config.dihedral_style.substr(0, 6) != "hybrid")
|
// if (test_config.dihedral_style.substr(0, 6) != "hybrid")
|
||||||
// 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;
|
||||||
|
|
||||||
if (!verbose) ::testing::internal::CaptureStdout();
|
if (!verbose) ::testing::internal::CaptureStdout();
|
||||||
cleanup_lammps(lmp, test_config);
|
cleanup_lammps(lmp, test_config);
|
||||||
@ -631,7 +632,7 @@ TEST(DihedralStyle, kokkos_omp)
|
|||||||
|
|
||||||
// FIXME: this is currently broken ??? for KOKKOS with dihedral style hybrid
|
// FIXME: this is currently broken ??? for KOKKOS 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.
|
||||||
//if (test_config.dihedral_style.substr(0, 6) != "hybrid")
|
// if (test_config.dihedral_style.substr(0, 6) != "hybrid")
|
||||||
// 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;
|
||||||
|
|||||||
@ -247,12 +247,13 @@ void generate_yaml_file(const char *outfile, const TestConfig &config)
|
|||||||
|
|
||||||
// run_torque
|
// run_torque
|
||||||
|
|
||||||
if(lmp->atom->torque_flag) {
|
if (lmp->atom->torque_flag) {
|
||||||
block.clear();
|
block.clear();
|
||||||
auto *t = lmp->atom->torque;
|
auto *t = lmp->atom->torque;
|
||||||
for (int i = 1; i <= natoms; ++i) {
|
for (int i = 1; i <= natoms; ++i) {
|
||||||
const int j = lmp->atom->map(i);
|
const int j = lmp->atom->map(i);
|
||||||
block += fmt::format("{:3} {:23.16e} {:23.16e} {:23.16e}\n", i, t[j][0], t[j][1], t[j][2]);
|
block +=
|
||||||
|
fmt::format("{:3} {:23.16e} {:23.16e} {:23.16e}\n", i, t[j][0], t[j][1], t[j][2]);
|
||||||
}
|
}
|
||||||
writer.emit_block("run_torque", block);
|
writer.emit_block("run_torque", block);
|
||||||
}
|
}
|
||||||
@ -301,9 +302,9 @@ TEST(FixTimestep, plain)
|
|||||||
|
|
||||||
EXPECT_POSITIONS("run_pos (normal run, verlet)", lmp->atom, test_config.run_pos, epsilon);
|
EXPECT_POSITIONS("run_pos (normal run, verlet)", lmp->atom, test_config.run_pos, epsilon);
|
||||||
EXPECT_VELOCITIES("run_vel (normal run, verlet)", lmp->atom, test_config.run_vel, epsilon);
|
EXPECT_VELOCITIES("run_vel (normal run, verlet)", lmp->atom, test_config.run_vel, epsilon);
|
||||||
if(lmp->atom->torque_flag)
|
if (lmp->atom->torque_flag)
|
||||||
EXPECT_TORQUES("run_torques (normal run, verlet)", lmp->atom, test_config.run_torque, epsilon);
|
EXPECT_TORQUES("run_torques (normal run, verlet)", lmp->atom, test_config.run_torque,
|
||||||
|
epsilon);
|
||||||
|
|
||||||
auto *ifix = lmp->modify->get_fix_by_id("test");
|
auto *ifix = lmp->modify->get_fix_by_id("test");
|
||||||
if (!ifix) {
|
if (!ifix) {
|
||||||
@ -353,7 +354,7 @@ TEST(FixTimestep, plain)
|
|||||||
|
|
||||||
EXPECT_POSITIONS("run_pos (restart, verlet)", lmp->atom, test_config.run_pos, epsilon);
|
EXPECT_POSITIONS("run_pos (restart, verlet)", lmp->atom, test_config.run_pos, epsilon);
|
||||||
EXPECT_VELOCITIES("run_vel (restart, verlet)", lmp->atom, test_config.run_vel, epsilon);
|
EXPECT_VELOCITIES("run_vel (restart, verlet)", lmp->atom, test_config.run_vel, epsilon);
|
||||||
if(lmp->atom->torque_flag)
|
if (lmp->atom->torque_flag)
|
||||||
EXPECT_TORQUES("run_torque (restart, verlet)", lmp->atom, test_config.run_torque, epsilon);
|
EXPECT_TORQUES("run_torque (restart, verlet)", lmp->atom, test_config.run_torque, epsilon);
|
||||||
|
|
||||||
ifix = lmp->modify->get_fix_by_id("test");
|
ifix = lmp->modify->get_fix_by_id("test");
|
||||||
@ -892,8 +893,9 @@ TEST(FixTimestep, kokkos_omp)
|
|||||||
|
|
||||||
EXPECT_POSITIONS("run_pos (normal run, verlet)", lmp->atom, test_config.run_pos, epsilon);
|
EXPECT_POSITIONS("run_pos (normal run, verlet)", lmp->atom, test_config.run_pos, epsilon);
|
||||||
EXPECT_VELOCITIES("run_vel (normal run, verlet)", lmp->atom, test_config.run_vel, epsilon);
|
EXPECT_VELOCITIES("run_vel (normal run, verlet)", lmp->atom, test_config.run_vel, epsilon);
|
||||||
if(lmp->atom->torque_flag)
|
if (lmp->atom->torque_flag)
|
||||||
EXPECT_TORQUES("run_torque (normal run, verlet)", lmp->atom, test_config.run_torque, epsilon);
|
EXPECT_TORQUES("run_torque (normal run, verlet)", lmp->atom, test_config.run_torque,
|
||||||
|
epsilon);
|
||||||
|
|
||||||
auto *ifix = lmp->modify->get_fix_by_id("test");
|
auto *ifix = lmp->modify->get_fix_by_id("test");
|
||||||
|
|
||||||
@ -945,7 +947,7 @@ TEST(FixTimestep, kokkos_omp)
|
|||||||
|
|
||||||
EXPECT_POSITIONS("run_pos (restart, verlet)", lmp->atom, test_config.run_pos, epsilon);
|
EXPECT_POSITIONS("run_pos (restart, verlet)", lmp->atom, test_config.run_pos, epsilon);
|
||||||
EXPECT_VELOCITIES("run_vel (restart, verlet)", lmp->atom, test_config.run_vel, epsilon);
|
EXPECT_VELOCITIES("run_vel (restart, verlet)", lmp->atom, test_config.run_vel, epsilon);
|
||||||
if(lmp->atom->torque_flag)
|
if (lmp->atom->torque_flag)
|
||||||
EXPECT_TORQUES("run_torque (restart, verlet)", lmp->atom, test_config.run_torque, epsilon);
|
EXPECT_TORQUES("run_torque (restart, verlet)", lmp->atom, test_config.run_torque, epsilon);
|
||||||
|
|
||||||
ifix = lmp->modify->get_fix_by_id("test");
|
ifix = lmp->modify->get_fix_by_id("test");
|
||||||
@ -1023,4 +1025,3 @@ TEST(FixTimestep, kokkos_omp)
|
|||||||
cleanup_lammps(lmp, test_config);
|
cleanup_lammps(lmp, test_config);
|
||||||
if (!verbose) ::testing::internal::GetCapturedStdout();
|
if (!verbose) ::testing::internal::GetCapturedStdout();
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -32,7 +32,7 @@ void write_yaml_header(class YamlWriter *writer, TestConfig *cfg, const char *ve
|
|||||||
do { \
|
do { \
|
||||||
const double diff = fabs(val1 - val2); \
|
const double diff = fabs(val1 - val2); \
|
||||||
const double div = std::min(fabs(val1), fabs(val2)); \
|
const double div = std::min(fabs(val1), fabs(val2)); \
|
||||||
const double err = (div==0.0) ? diff : diff/div; \
|
const double err = (div == 0.0) ? diff : diff / div; \
|
||||||
stats.add(err); \
|
stats.add(err); \
|
||||||
EXPECT_PRED_FORMAT2(::testing::DoubleLE, err, eps); \
|
EXPECT_PRED_FORMAT2(::testing::DoubleLE, err, eps); \
|
||||||
} while (0);
|
} while (0);
|
||||||
|
|||||||
@ -126,13 +126,11 @@ TEST(FmtLib, insert_neg_double)
|
|||||||
TEST(FmtLib, int_for_double)
|
TEST(FmtLib, int_for_double)
|
||||||
{
|
{
|
||||||
const double val = -1.5;
|
const double val = -1.5;
|
||||||
std::string text;
|
ASSERT_THROW(auto text = fmt::format("word {:d}", val), std::exception);
|
||||||
ASSERT_THROW( text = fmt::format("word {:d}", val), std::exception);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(FmtLib, double_for_int)
|
TEST(FmtLib, double_for_int)
|
||||||
{
|
{
|
||||||
const int val = 15;
|
const int val = 15;
|
||||||
std::string text;
|
ASSERT_THROW(auto text = fmt::format("word {:g}", val), std::exception);
|
||||||
ASSERT_THROW( text = fmt::format("word {:g}", val), std::exception);
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user