← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3810: fix a bug in ISCollider that would create interactions with unbounded bodies

 

------------------------------------------------------------
revno: 3810
committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxxxxxx>
timestamp: Sun 2014-02-02 21:49:51 +0100
message:
  fix a bug in ISCollider that would create interactions with unbounded bodies
modified:
  pkg/common/InsertionSortCollider.cpp


--
lp:yade
https://code.launchpad.net/~yade-pkg/yade/git-trunk

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-pkg/yade/git-trunk/+edit-subscription
=== modified file 'pkg/common/InsertionSortCollider.cpp'
--- pkg/common/InsertionSortCollider.cpp	2013-05-30 20:20:59 +0000
+++ pkg/common/InsertionSortCollider.cpp	2014-02-02 20:49:51 +0000
@@ -264,7 +264,7 @@
 					for(long j=i+1; /* handle case 2. of swapped min/max */ j<2*nBodies && V[j].id!=iid; j++){
 						const Body::id_t& jid=V[j].id;
 						// take 2 of the same condition (only handle collision [min_i..max_i]+min_j, not [min_i..max_i]+min_i (symmetric)
-						if(!V[j].flags.isMin) continue;
+						if(!(V[j].flags.isMin && V[j].flags.hasBB)) continue;
 						/* abuse the same function here; since it does spatial overlap check first, it is OK to use it */
 						handleBoundInversion(iid,jid,interactions,scene);
 						assert(j<2*nBodies-1);
@@ -278,7 +278,7 @@
 					// we might wrap over the periodic boundary here; that's why the condition is different from the aperiodic case
 					for(long j=V.norm(i+1); V[j].id!=iid; j=V.norm(j+1)){
 						const Body::id_t& jid=V[j].id;
-						if(!V[j].flags.isMin) continue;
+						if(!(V[j].flags.isMin && V[j].flags.hasBB)) continue;
 						handleBoundInversionPeri(iid,jid,interactions,scene);
 						if(cnt++>2*(long)nBodies){ LOG_FATAL("Uninterrupted loop in the initial sort?"); throw std::logic_error("loop??"); }
 					}