[yade] 01/02: Critical bugfix for periodic boundaries.

Anton Gladky gladk at moszumanska.debian.org
Mon Apr 17 11:17:20 UTC 2017


This is an automated email from the git hooks/post-receive script.

gladk pushed a commit to branch master
in repository yade.

commit be08409933e7ead3e29e6253363776c865509125
Author: Bruno Chareyre <bruno.chareyre at 3sr-grenoble.fr>
Date:   Fri Apr 14 12:43:52 2017 +0200

    Critical bugfix for periodic boundaries.
---
 debian/patches/09_fix_periodic_boundaries.patch | 28 +++++++++++++++++++++++++
 debian/patches/series                           |  1 +
 2 files changed, 29 insertions(+)

diff --git a/debian/patches/09_fix_periodic_boundaries.patch b/debian/patches/09_fix_periodic_boundaries.patch
new file mode 100644
index 0000000..29ecfd1
--- /dev/null
+++ b/debian/patches/09_fix_periodic_boundaries.patch
@@ -0,0 +1,28 @@
+From c7c8e6f62d452c81a31415f05a12587a6cc8c452 Mon Sep 17 00:00:00 2001
+From: bchareyre <bruno.chareyre at grenoble-inp.fr>
+Date: Fri, 14 Apr 2017 12:04:32 +0200
+Subject: [PATCH] Critical bugfix for collision detection in periodic boundary
+ conditions. Bounds lists were left partially unordered,  then some
+ interactions were never detected (my toughest yade debugging until now).
+
+---
+ pkg/common/InsertionSortCollider.cpp | 6 ++++--
+ 1 file changed, 4 insertions(+), 2 deletions(-)
+
+diff --git a/pkg/common/InsertionSortCollider.cpp b/pkg/common/InsertionSortCollider.cpp
+index dc5d7ac..163a4f4 100644
+--- a/pkg/common/InsertionSortCollider.cpp
++++ b/pkg/common/InsertionSortCollider.cpp
+@@ -410,8 +410,10 @@ Real InsertionSortCollider::cellWrapRel(const Real x, const Real x0, const Real
+ void InsertionSortCollider::insertionSortPeri(VecBounds& v, InteractionContainer* interactions, Scene*, bool doCollide){
+ 	assert(periodic);
+ 	long &loIdx=v.loIdx; const long &size=v.size;
+-	for(long _i=0; _i<size; _i++){
+-		const long i=v.norm(_i);
++	/* We have to visit each bound at least once (first condition), but this is not enough. The correct ordering in the begining of the list needs a second pass to connect begin and end consistently (the second condition). Strictly the second condition should include "+ (v.norm(j+1)==loIdx ? v.cellDim : 0)" but it is ok as is since the shift is added inside the loop. */
++	long _i=0;
++	for(; (_i<size) || (v[v.norm(_i)].coord <  v[v.norm(_i-1)].coord); _i++){
++		const long i=v.norm(_i);//FIXME: useless, and many others can probably be removed
+ 		const long i_1=v.norm(i-1);
+ 		//switch period of (i) if the coord is below the lower edge cooridnate-wise and just above the split
+ 		if(i==loIdx && v[i].coord<0){ v[i].period-=1; v[i].coord+=v.cellDim; loIdx=v.norm(loIdx+1); }
diff --git a/debian/patches/series b/debian/patches/series
index f7b4863..ac0e05d 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -1,3 +1,4 @@
 01_remove_google_analytics.patch
 08_fix_gui.patch
+09_fix_periodic_boundaries.patch
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-science/packages/yade.git



More information about the debian-science-commits mailing list