Merge pull request #2455 from stanmoore1/relax_NaN

Add non-numeric pressure check to fix box/relax
This commit is contained in:
Axel Kohlmeyer
2020-10-28 17:37:42 -04:00
committed by GitHub

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");
}
}