From a019c5cb581afe67fd4f81eb5ecaa38f68f674fd Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 26 Jul 2013 15:37:34 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@10408 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/USER-MISC/compute_basal_atom.cpp | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/src/USER-MISC/compute_basal_atom.cpp b/src/USER-MISC/compute_basal_atom.cpp index 4ffcb3753b..51aae44770 100644 --- a/src/USER-MISC/compute_basal_atom.cpp +++ b/src/USER-MISC/compute_basal_atom.cpp @@ -412,20 +412,17 @@ void ComputeBasalAtom::compute_peratom() } } //if there are less than two ~180 degree bond angles, the algorithm returns null - else { - BPV[i][0] = 0.0; - BPV[i][1] = 0.0; - BPV[i][2] = 0.0; - } + else BPV[i][0] = BPV[i][1] = BPV[i][2] = 0.0; + //normalize BPV: double Mag = sqrt(BPV[i][0]*BPV[i][0] + BPV[i][1]*BPV[i][1] + BPV[i][2]*BPV[i][2]); if (Mag > 0){ - BPV[i][0] = BPV[i][0]/Mag; - BPV[i][1] = BPV[i][1]/Mag; - BPV[i][2] = BPV[i][2]/Mag; + BPV[i][0] = BPV[i][0]/Mag; + BPV[i][1] = BPV[i][1]/Mag; + BPV[i][2] = BPV[i][2]/Mag; } - } + } else BPV[i][0] = BPV[i][1] = BPV[i][2] = 0.0; } } /* ----------------------------------------------------------------------