← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2985: - enable interaction of two larger-than period bodies (e.g. cylinder vs. box) in addition to prev...

 

------------------------------------------------------------
revno: 2985
committer: Bruno Chareyre <bruno.chareyre@xxxxxxxxxxx>
branch nick: trunk
timestamp: Fri 2011-12-16 20:53:43 +0100
message:
  - enable interaction of two larger-than period bodies (e.g. cylinder vs. box) in addition to previous commit.
modified:
  pkg/common/InsertionSortCollider.cpp
  pkg/common/InsertionSortCollider.hpp


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

Your team Yade developers is subscribed to branch lp:yade.
To unsubscribe from this branch go to https://code.launchpad.net/~yade-dev/yade/trunk/+edit-subscription
=== modified file 'pkg/common/InsertionSortCollider.cpp'
--- pkg/common/InsertionSortCollider.cpp	2011-12-16 19:41:14 +0000
+++ pkg/common/InsertionSortCollider.cpp	2011-12-16 19:53:43 +0000
@@ -465,8 +465,8 @@
 			}
 		#endif
 		if (allowBiggerThanPeriod &&  ((pmn1!=pmx1) || (pmn2!=pmx2)) ){
-			// If both bodies are bigger, we don't handle the interaction, return
-			if(unlikely((pmn1!=pmx1) && (pmn2!=pmx2))) return false;
+			// If both bodies are bigger, we place them in the (0,0,0) period
+			if(unlikely((pmn1!=pmx1) && (pmn2!=pmx2))) {periods[axis]=0; return true;}
 			// else we define period with the position of the small body (we assume the big one sits in period (0,0,0), keep that in mind if velGrad(.,axis) is not a null vector)
 			else {periods[axis]=(pmn1==pmx1)? pmn1 : -pmn2; return true;}
 		} else if(unlikely((pmn1!=pmx1) || (pmn2!=pmx2))){

=== modified file 'pkg/common/InsertionSortCollider.hpp'
--- pkg/common/InsertionSortCollider.hpp	2011-12-16 19:41:14 +0000
+++ pkg/common/InsertionSortCollider.hpp	2011-12-16 19:53:43 +0000
@@ -199,7 +199,7 @@
 	",
 		((int,sortAxis,0,,"Axis for the initial contact detection."))
 		((bool,sortThenCollide,false,,"Separate sorting and colliding phase; it is MUCH slower, but all interactions are processed at every step; this effectively makes the collider non-persistent, not remembering last state. (The default behavior relies on the fact that inversions during insertion sort are overlaps of bounding boxes that just started/ceased to exist, and only processes those; this makes the collider much more efficient.)"))
-		((bool,allowBiggerThanPeriod,false,,"If true, tests on bodies sizes will be disabled, and the simulation will run normaly even if bodies larger than period are found. It can be usefull when the periodic problem include e.g. a floor modelized with wall/box/facet.\nBe sure you know what you are doing if you touch this flag. Bodies larger than period are acceptable only if they should not interact with other larger-than-period bodies, else it will result in undefined behaviour without any warning at run-time. It is safer to keep the flag false in general."))
+		((bool,allowBiggerThanPeriod,false,,"If true, tests on bodies sizes will be disabled, and the simulation will run normaly even if bodies larger than period are found. It can be usefull when the periodic problem include e.g. a floor modelized with wall/box/facet.\nBe sure you know what you are doing if you touch this flag. The result is undefined if one large body moves out of the (0,0,0) period."))
 		((Real,verletDist,((void)"Automatically initialized",-.05),,"Length by which to enlarge particle bounds, to avoid running collider at every step. Stride disabled if zero. Negative value will trigger automatic computation, so that the real value will be |verletDist| × minimum spherical particle radius; if there are no spherical particles, it will be disabled."))
 		((Real,sweepFactor,1.05,,"Overestimation factor for the sweep velocity; must be >=1.0. Has no influence on verletDist, only on the computed stride. [DEPRECATED, is used only when bins are not used]."))
 		((Real,fastestBodyMaxDist,-1,,"Maximum displacement of the fastest body since last run; if >= verletDist, we could get out of bboxes and will trigger full run. DEPRECATED, was only used without bins. |yupdate|"))