diff --git a/unittest/force-styles/test_config.h b/unittest/force-styles/test_config.h index e3d6c06033..b284052d6d 100644 --- a/unittest/force-styles/test_config.h +++ b/unittest/force-styles/test_config.h @@ -70,7 +70,6 @@ public: std::vector restart_pos; std::vector run_vel; std::vector restart_vel; - std::vector run_atom_types; TestConfig() : lammps_version(""), date_generated(""), basename(""), epsilon(1.0e-14), input_file(""), @@ -95,7 +94,6 @@ public: restart_pos.clear(); run_vel.clear(); restart_vel.clear(); - run_atom_types.clear(); global_vector.clear(); } TestConfig(const TestConfig &) = delete; diff --git a/unittest/force-styles/test_config_reader.cpp b/unittest/force-styles/test_config_reader.cpp index 5eb41db4bf..3f99f251a5 100644 --- a/unittest/force-styles/test_config_reader.cpp +++ b/unittest/force-styles/test_config_reader.cpp @@ -48,7 +48,6 @@ TestConfigReader::TestConfigReader(TestConfig &config) : config(config) consumers["run_forces"] = &TestConfigReader::run_forces; consumers["run_pos"] = &TestConfigReader::run_pos; consumers["run_vel"] = &TestConfigReader::run_vel; - consumers["run_atom_types"] = &TestConfigReader::run_atom_types; consumers["pair_style"] = &TestConfigReader::pair_style; consumers["pair_coeff"] = &TestConfigReader::pair_coeff; @@ -229,20 +228,6 @@ void TestConfigReader::run_vel(const yaml_event_t &event) } } -void TestConfigReader::run_atom_types(const yaml_event_t &event) -{ - config.run_atom_types.clear(); - config.run_atom_types.resize(config.natoms + 1); - std::stringstream data((char *)event.data.scalar.value); - std::string line; - - while (std::getline(data, line, '\n')) { - int tag, atom_type; - sscanf(line.c_str(), "%d %d", &tag, &atom_type); - config.run_atom_types[tag] = atom_type; - } -} - void TestConfigReader::pair_style(const yaml_event_t &event) { config.pair_style = (char *)event.data.scalar.value; diff --git a/unittest/force-styles/test_config_reader.h b/unittest/force-styles/test_config_reader.h index 91512da655..1af7589add 100644 --- a/unittest/force-styles/test_config_reader.h +++ b/unittest/force-styles/test_config_reader.h @@ -41,7 +41,6 @@ public: void run_forces(const yaml_event_t &event); void run_pos(const yaml_event_t &event); void run_vel(const yaml_event_t &event); - void run_atom_types(const yaml_event_t &event); void pair_style(const yaml_event_t &event); void pair_coeff(const yaml_event_t &event); void bond_style(const yaml_event_t &event); diff --git a/unittest/force-styles/test_fix_timestep.cpp b/unittest/force-styles/test_fix_timestep.cpp index 302425ebd3..d2e35b463f 100644 --- a/unittest/force-styles/test_fix_timestep.cpp +++ b/unittest/force-styles/test_fix_timestep.cpp @@ -284,7 +284,6 @@ TEST(FixTimestep, plain) 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_ATOM_TYPES("run_atom_types (normal run, verlet)", lmp->atom, test_config.run_atom_types); int ifix = lmp->modify->find_fix("test"); if (ifix < 0) { @@ -335,7 +334,6 @@ TEST(FixTimestep, plain) 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_ATOM_TYPES("run_atom_types (restart, verlet)", lmp->atom, test_config.run_atom_types); ifix = lmp->modify->find_fix("test"); if (ifix < 0) { @@ -375,7 +373,6 @@ TEST(FixTimestep, plain) EXPECT_POSITIONS("run_pos (rmass, verlet)", lmp->atom, test_config.run_pos, epsilon); EXPECT_VELOCITIES("run_vel (rmass, verlet)", lmp->atom, test_config.run_vel, epsilon); - EXPECT_ATOM_TYPES("run_atom_types (rmass, verlet)", lmp->atom, test_config.run_atom_types); ifix = lmp->modify->find_fix("test"); if (ifix < 0) { @@ -429,7 +426,6 @@ TEST(FixTimestep, plain) EXPECT_POSITIONS("run_pos (normal run, respa)", lmp->atom, test_config.run_pos, epsilon); EXPECT_VELOCITIES("run_vel (normal run, respa)", lmp->atom, test_config.run_vel, epsilon); - EXPECT_ATOM_TYPES("run_atom_types (normal run, respa)", lmp->atom, test_config.run_atom_types); ifix = lmp->modify->find_fix("test"); if (ifix < 0) { @@ -468,7 +464,6 @@ TEST(FixTimestep, plain) EXPECT_POSITIONS("run_pos (restart, respa)", lmp->atom, test_config.run_pos, epsilon); EXPECT_VELOCITIES("run_vel (restart, respa)", lmp->atom, test_config.run_vel, epsilon); - EXPECT_ATOM_TYPES("run_atom_types (restart, respa)", lmp->atom, test_config.run_atom_types); ifix = lmp->modify->find_fix("test"); if (ifix < 0) { @@ -508,7 +503,6 @@ TEST(FixTimestep, plain) EXPECT_POSITIONS("run_pos (rmass, respa)", lmp->atom, test_config.run_pos, epsilon); EXPECT_VELOCITIES("run_vel (rmass, respa)", lmp->atom, test_config.run_vel, epsilon); - EXPECT_ATOM_TYPES("run_atom_types (rmass, respa)", lmp->atom, test_config.run_atom_types); ifix = lmp->modify->find_fix("test"); if (ifix < 0) { @@ -590,7 +584,6 @@ TEST(FixTimestep, omp) 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_ATOM_TYPES("run_atom_types (normal run, verlet)", lmp->atom, test_config.run_atom_types); int ifix = lmp->modify->find_fix("test"); if (ifix < 0) { @@ -641,7 +634,6 @@ TEST(FixTimestep, omp) 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_ATOM_TYPES("run_atom_types (restart, verlet)", lmp->atom, test_config.run_atom_types); ifix = lmp->modify->find_fix("test"); if (ifix < 0) { @@ -681,7 +673,6 @@ TEST(FixTimestep, omp) EXPECT_POSITIONS("run_pos (rmass, verlet)", lmp->atom, test_config.run_pos, epsilon); EXPECT_VELOCITIES("run_vel (rmass, verlet)", lmp->atom, test_config.run_vel, epsilon); - EXPECT_ATOM_TYPES("run_atom_types (rmass, verlet)", lmp->atom, test_config.run_atom_types); ifix = lmp->modify->find_fix("test"); if (ifix < 0) { @@ -734,7 +725,6 @@ TEST(FixTimestep, omp) EXPECT_POSITIONS("run_pos (normal run, respa)", lmp->atom, test_config.run_pos, epsilon); EXPECT_VELOCITIES("run_vel (normal run, respa)", lmp->atom, test_config.run_vel, epsilon); - EXPECT_ATOM_TYPES("run_atom_types (normal run, respa)", lmp->atom, test_config.run_atom_types); ifix = lmp->modify->find_fix("test"); if (ifix < 0) { @@ -773,7 +763,6 @@ TEST(FixTimestep, omp) EXPECT_POSITIONS("run_pos (restart, respa)", lmp->atom, test_config.run_pos, epsilon); EXPECT_VELOCITIES("run_vel (restart, respa)", lmp->atom, test_config.run_vel, epsilon); - EXPECT_ATOM_TYPES("run_atom_types (restart, respa)", lmp->atom, test_config.run_atom_types); ifix = lmp->modify->find_fix("test"); if (ifix < 0) { @@ -813,7 +802,6 @@ TEST(FixTimestep, omp) EXPECT_POSITIONS("run_pos (rmass, respa)", lmp->atom, test_config.run_pos, epsilon); EXPECT_VELOCITIES("run_vel (rmass, respa)", lmp->atom, test_config.run_vel, epsilon); - EXPECT_ATOM_TYPES("run_atom_types (rmass, respa)", lmp->atom, test_config.run_atom_types); ifix = lmp->modify->find_fix("test"); if (ifix < 0) { diff --git a/unittest/force-styles/test_main.cpp b/unittest/force-styles/test_main.cpp index 4a98c489be..80f1ca4e30 100644 --- a/unittest/force-styles/test_main.cpp +++ b/unittest/force-styles/test_main.cpp @@ -70,7 +70,6 @@ void EXPECT_FORCES(const std::string &name, Atom *atom, const std::vector &x_ref, double epsilon) { - if (x_ref.empty()) return; SCOPED_TRACE("EXPECT_POSITIONS: " + name); double **x = atom->x; tagint *tag = atom->tag; @@ -88,7 +87,6 @@ void EXPECT_POSITIONS(const std::string &name, Atom *atom, const std::vector &v_ref, double epsilon) { - if (v_ref.empty()) return; SCOPED_TRACE("EXPECT_VELOCITIES: " + name); double **v = atom->v; tagint *tag = atom->tag; @@ -103,23 +101,6 @@ void EXPECT_VELOCITIES(const std::string &name, Atom *atom, const std::vector &at_ref) -{ - if (at_ref.empty()) return; - SCOPED_TRACE("EXPECT_ATOM_TYPES: " + name); - int *type = atom->type; - tagint *tag = atom->tag; - const int nlocal = atom->nlocal; - ASSERT_EQ(nlocal + 1, at_ref.size()); - ErrorStats stats; - for (int i = 0; i < nlocal; ++i) { - EXPECT_EQ(type[i], at_ref[tag[i]]); - EXPECT_EQ(type[i], at_ref[tag[i]]); - EXPECT_EQ(type[i], at_ref[tag[i]]); - } - if (print_stats) std::cerr << name << " stats" << stats << std::endl; -} - // common read_yaml_file function bool read_yaml_file(const char *infile, TestConfig &config) { diff --git a/unittest/force-styles/test_main.h b/unittest/force-styles/test_main.h index ede7402cdc..36bcd7bdff 100644 --- a/unittest/force-styles/test_main.h +++ b/unittest/force-styles/test_main.h @@ -41,6 +41,5 @@ void EXPECT_STRESS(const std::string & name, double * stress, const stress_t & e void EXPECT_FORCES(const std::string & name, LAMMPS_NS::Atom * atom, const std::vector & f_ref, double epsilon); void EXPECT_POSITIONS(const std::string & name, LAMMPS_NS::Atom * atom, const std::vector & x_ref, double epsilon); void EXPECT_VELOCITIES(const std::string & name, LAMMPS_NS::Atom * atom, const std::vector & v_ref, double epsilon); -void EXPECT_ATOM_TYPES(const std::string & name, LAMMPS_NS::Atom * atom, const std::vector & at_ref); #endif