From 412cb8f089bb9e3b2ae5cfc49bc310fa38425c32 Mon Sep 17 00:00:00 2001 From: Axel Kohlmeyer Date: Tue, 30 May 2017 08:15:55 -0400 Subject: [PATCH] avoid hang in fix reax/c/species when multiple atoms have the exact same x-coordinate --- src/USER-REAXC/fix_reaxc_species.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/USER-REAXC/fix_reaxc_species.cpp b/src/USER-REAXC/fix_reaxc_species.cpp index fe74337128..4e57dd1c4b 100644 --- a/src/USER-REAXC/fix_reaxc_species.cpp +++ b/src/USER-REAXC/fix_reaxc_species.cpp @@ -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; }