added run_torque and EXPECT_TORQUES
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_torque"] = &TestConfigReader::run_torque;
|
||||
|
||||
consumers["pair_style"] = &TestConfigReader::pair_style;
|
||||
consumers["pair_coeff"] = &TestConfigReader::pair_coeff;
|
||||
@ -228,6 +229,21 @@ void TestConfigReader::run_vel(const yaml_event_t &event)
|
||||
}
|
||||
}
|
||||
|
||||
void TestConfigReader::run_torque(const yaml_event_t &event)
|
||||
{
|
||||
config.run_torque.clear();
|
||||
config.run_torque.resize(config.natoms + 1);
|
||||
std::stringstream data((char *)event.data.scalar.value);
|
||||
std::string line;
|
||||
|
||||
while (std::getline(data, line, '\n')) {
|
||||
int tag;
|
||||
coord_t xyz;
|
||||
sscanf(line.c_str(), "%d %lg %lg %lg", &tag, &xyz.x, &xyz.y, &xyz.z);
|
||||
config.run_torque[tag] = xyz;
|
||||
}
|
||||
}
|
||||
|
||||
void TestConfigReader::pair_style(const yaml_event_t &event)
|
||||
{
|
||||
config.pair_style = (char *)event.data.scalar.value;
|
||||
|
||||
Reference in New Issue
Block a user