From f2d23f681e97941a4b9f625ea3233f41c7fbe6f4 Mon Sep 17 00:00:00 2001 From: sjplimp Date: Fri, 24 May 2013 22:27:03 +0000 Subject: [PATCH] git-svn-id: svn://svn.icms.temple.edu/lammps-ro/trunk@9923 f3b2605a-c512-4ea7-a41b-209d697bcdaa --- src/MC/fix_bond_break.cpp | 13 +++++++------ src/MC/fix_bond_create.cpp | 13 +++++++------ 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/src/MC/fix_bond_break.cpp b/src/MC/fix_bond_break.cpp index 57828e909f..ff6c52507c 100755 --- a/src/MC/fix_bond_break.cpp +++ b/src/MC/fix_bond_break.cpp @@ -154,7 +154,7 @@ void FixBondBreak::init() void FixBondBreak::post_integrate() { int i,j,k,m,n,i1,i2,n1,n3,type; - double delx,dely,delz,rsq,min,max; + double delx,dely,delz,rsq; int *slist; if (update->ntimestep % nevery) return; @@ -248,13 +248,14 @@ void FixBondBreak::post_integrate() j = atom->map(partner[i]); if (partner[j] != tag[i]) continue; - // apply probability constraint - // MIN,MAX insures values are added in same order on different procs + // apply probability constraint using RN for atom with smallest ID if (fraction < 1.0) { - min = MIN(probability[i],probability[j]); - max = MAX(probability[i],probability[j]); - if (0.5*(min+max) >= fraction) continue; + if (tag[i] < tag[j]) { + if (probability[i] >= fraction) continue; + } else { + if (probability[j] >= fraction) continue; + } } // delete bond from atom I if I stores it diff --git a/src/MC/fix_bond_create.cpp b/src/MC/fix_bond_create.cpp index 6f9a647dd2..1cf8a3cdec 100755 --- a/src/MC/fix_bond_create.cpp +++ b/src/MC/fix_bond_create.cpp @@ -268,7 +268,7 @@ void FixBondCreate::setup(int vflag) void FixBondCreate::post_integrate() { int i,j,m,ii,jj,inum,jnum,itype,jtype,n1,n3,possible; - double xtmp,ytmp,ztmp,delx,dely,delz,rsq,min,max; + double xtmp,ytmp,ztmp,delx,dely,delz,rsq; int *ilist,*jlist,*numneigh,**firstneigh,*slist; if (update->ntimestep % nevery) return; @@ -397,13 +397,14 @@ void FixBondCreate::post_integrate() j = atom->map(partner[i]); if (partner[j] != tag[i]) continue; - // apply probability constraint - // MIN,MAX insures values are added in same order on different procs + // apply probability constraint using RN for atom with smallest ID if (fraction < 1.0) { - min = MIN(probability[i],probability[j]); - max = MAX(probability[i],probability[j]); - if (0.5*(min+max) >= fraction) continue; + if (tag[i] < tag[j]) { + if (probability[i] >= fraction) continue; + } else { + if (probability[j] >= fraction) continue; + } } // if newton_bond is set, only store with I or J