Add non-numeric pressure check to fix box/relax

This commit is contained in:
Stan Moore
2020-10-27 13:55:50 -06:00
parent 5872b05e2f
commit 6f66f5b23b

View File

@ -735,12 +735,18 @@ void FixBoxRelax::couple()
p_current[2] = tensor[2];
}
if (!std::isfinite(p_current[0]) || !std::isfinite(p_current[1]) || !std::isfinite(p_current[2]))
error->all(FLERR,"Non-numeric pressure - simulation unstable");
// switch order from xy-xz-yz to Voigt
if (pstyle == TRICLINIC) {
p_current[3] = tensor[5];
p_current[4] = tensor[4];
p_current[5] = tensor[3];
if (!std::isfinite(p_current[3]) || !std::isfinite(p_current[4]) || !std::isfinite(p_current[5]))
error->all(FLERR,"Non-numeric pressure - simulation unstable");
}
}