add 'atom type' test option to force style tests
This commit is contained in:
@ -48,6 +48,7 @@ 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;
|
||||
@ -228,6 +229,20 @@ 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;
|
||||
|
||||
Reference in New Issue
Block a user