add error check when updating variables in ::single() function

This commit is contained in:
Axel Kohlmeyer
2021-04-13 14:59:37 -04:00
parent 9dbdb4386b
commit 8aed7e55b3

View File

@ -396,6 +396,9 @@ double PairHybridScaled::single(int i, int j, int itype, int jtype, double rsq,
double *vals = new double[nvars];
for (i = 0; i < nvars; ++i) {
j = input->variable->find(scalevars[i].c_str());
if (j < 0)
error->all(FLERR,fmt::format("Variable '{}' not found when updating "
"scale factors",scalevars[i]));
vals[i] = input->variable->compute_equal(j);
}
for (i = 0; i < nstyles; ++i) {