support old ReaxFF force field files without ovcorr entry in bonds section

This commit is contained in:
Axel Kohlmeyer
2023-09-27 00:06:15 -04:00
parent b5480e4e1b
commit f3beb206c9

View File

@ -336,7 +336,7 @@ namespace ReaxFF {
values = reader.next_values(0);
++lineno;
if (values.count() < 8)
if (values.count() < 7)
THROW_ERROR("Invalid force field file format");
if ((j < ntypes) && (k < ntypes)) {
@ -346,7 +346,11 @@ namespace ReaxFF {
values.skip();
tbp[j][k].p_bo1 = tbp[k][j].p_bo1 = values.next_double();
tbp[j][k].p_bo2 = tbp[k][j].p_bo2 = values.next_double();
tbp[j][k].ovc = tbp[k][j].ovc = values.next_double();
// if the 8th value is missing use 0.0
if (values.has_next())
tbp[j][k].ovc = tbp[k][j].ovc = values.next_double();
else
tbp[j][k].ovc = tbp[k][j].ovc = 0.0;
}
}