add tester tool for timestep related fixes: integrators, thermostats, force manipulations, constraints

This commit is contained in:
Axel Kohlmeyer
2020-08-08 22:54:17 -04:00
parent 0ce43efc34
commit faac18ffd2
5 changed files with 684 additions and 0 deletions

View File

@ -40,6 +40,8 @@ TestConfigReader::TestConfigReader(TestConfig &config) : YamlReader(), config(co
consumers["run_stress"] = &TestConfigReader::run_stress;
consumers["init_forces"] = &TestConfigReader::init_forces;
consumers["run_forces"] = &TestConfigReader::run_forces;
consumers["run_pos"] = &TestConfigReader::run_pos;
consumers["run_vel"] = &TestConfigReader::run_vel;
consumers["pair_style"] = &TestConfigReader::pair_style;
consumers["pair_coeff"] = &TestConfigReader::pair_coeff;
@ -176,6 +178,36 @@ void TestConfigReader::run_forces(const yaml_event_t &event)
}
}
void TestConfigReader::run_pos(const yaml_event_t &event)
{
config.run_pos.clear();
config.run_pos.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_pos[tag] = xyz;
}
}
void TestConfigReader::run_vel(const yaml_event_t &event)
{
config.run_vel.clear();
config.run_vel.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_vel[tag] = xyz;
}
}
void TestConfigReader::pair_style(const yaml_event_t &event)
{
config.pair_style = (char *)event.data.scalar.value;