← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-dev/yade/trunk] Rev 2326: 1. Fix InteractionGeometryDispatcher (in case someone still uses it).

 

------------------------------------------------------------
revno: 2326
committer: Václav Šmilauer <eudoxos@xxxxxxxx>
branch nick: trunk
timestamp: Tue 2010-07-06 13:47:43 +0200
message:
  1. Fix InteractionGeometryDispatcher (in case someone still uses it).
modified:
  examples/concrete/uniax.py
  pkg/common/Engine/Dispatcher/InteractionDispatchers.cpp
  pkg/common/Engine/Dispatcher/InteractionGeometryDispatcher.cpp


--
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 'examples/concrete/uniax.py'
--- examples/concrete/uniax.py	2010-07-06 11:31:29 +0000
+++ examples/concrete/uniax.py	2010-07-06 11:47:43 +0000
@@ -162,8 +162,8 @@
 			title=O.tags['description'] if 'description' in O.tags.keys() else O.tags['params']
 			print 'gnuplot',plot.saveGnuplot(O.tags['id'],title=title)
 			print 'Bye.'
-			O.pause()
-			#sys.exit(0)
+			#O.pause()
+			sys.exit(0)
 		
 def addPlotData():
 	yade.plot.addData({'t':O.time,'i':O.iter,'eps':strainer.strain,'sigma':strainer.avgStress+isoPrestress,

=== modified file 'pkg/common/Engine/Dispatcher/InteractionDispatchers.cpp'
--- pkg/common/Engine/Dispatcher/InteractionDispatchers.cpp	2010-07-05 13:41:14 +0000
+++ pkg/common/Engine/Dispatcher/InteractionDispatchers.cpp	2010-07-06 11:47:43 +0000
@@ -107,7 +107,7 @@
 				geomCreated=I->functorCache.geom->go(b1->shape,b2->shape, *b1->state, *b2->state, Vector3r::Zero(), /*force*/false, I);
 			#endif
 		} else { // handle periodicity
-			Vector3r shift2=cellHsize*Vector3r(I->cellDist[0],I->cellDist[1],I->cellDist[2]);
+			Vector3r shift2=cellHsize*I->cellDist.cast<Real>();
 			// in sheared cell, apply shear on the mutual position as well
 			//shift2=scene->cell->shearPt(shift2);
 			#ifdef YADE_DEVIRT_FUNCTORS

=== modified file 'pkg/common/Engine/Dispatcher/InteractionGeometryDispatcher.cpp'
--- pkg/common/Engine/Dispatcher/InteractionGeometryDispatcher.cpp	2010-04-25 13:18:11 +0000
+++ pkg/common/Engine/Dispatcher/InteractionGeometryDispatcher.cpp	2010-07-06 11:47:43 +0000
@@ -48,7 +48,7 @@
 	updateScenePtr();
 
 	shared_ptr<BodyContainer>& bodies = scene->bodies;
-	Vector3r cellSize; if(scene->isPeriodic) cellSize=scene->cell->trsf*scene->cell->refSize;
+	Matrix3r cellHsize; if(scene->isPeriodic) cellHsize=scene->cell->Hsize;
 	bool removeUnseenIntrs=(scene->interactions->iterColliderLastRun>=0 && scene->interactions->iterColliderLastRun==scene->currentIteration);
 	#ifdef YADE_OPENMP
 		const long size=scene->interactions->size();
@@ -73,7 +73,7 @@
 			if(!scene->isPeriodic){
 				geomCreated=operator()(b1->shape, b2->shape, *b1->state, *b2->state, Vector3r::Zero(), /*force*/ false, I);
 			} else{
-				Vector3r shift2(I->cellDist[0]*cellSize[0],I->cellDist[1]*cellSize[1],I->cellDist[2]*cellSize[2]); // add periodicity to the position of the 2nd body
+				Vector3r shift2=cellHsize*I->cellDist.cast<Real>();
 				geomCreated=operator()(b1->shape, b2->shape, *b1->state, *b2->state, shift2, /*force*/ false, I);
 			}
 			// reset && erase interaction that existed but now has no geometry anymore