avoid hang in fix reax/c/species when multiple atoms have the exact same x-coordinate

This commit is contained in:
Axel Kohlmeyer 2017-05-30 08:15:55 -04:00
parent 092806ad4f
commit 412cb8f089
1 changed files with 9 additions and 1 deletions

View File

@ -500,8 +500,16 @@ void FixReaxCSpecies::Output_ReaxC_Bonds(bigint ntimestep, FILE *fp)
AtomCoord FixReaxCSpecies::chAnchor(AtomCoord in1, AtomCoord in2)
{
if (in1.x <= in2.x)
if (in1.x < in2.x)
return in1;
else if (in1.x == in2.x) {
if (in1.y < in2.y)
return in1;
else if (in1.y == in2.y) {
if (in1.z < in2.z)
return in1;
}
}
return in2;
}