← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3884: Fix bug in polyhedra_splitter.

 

------------------------------------------------------------
revno: 3884
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Wed 2016-06-01 21:16:04 +0200
message:
  Fix bug in polyhedra_splitter.
  
  Used not the pointer, but reference of the pointer...
modified:
  pkg/dem/Polyhedra_splitter.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/dem/Polyhedra_splitter.cpp'
--- pkg/dem/Polyhedra_splitter.cpp	2016-04-19 20:18:46 +0000
+++ pkg/dem/Polyhedra_splitter.cpp	2016-06-01 19:16:04 +0000
@@ -13,7 +13,7 @@
 YADE_PLUGIN((PolyhedraSplitter));
 CREATE_LOGGER(PolyhedraSplitter);
 
-using PSplitT = std::tuple<const shared_ptr<Body>&, Vector3r, Vector3r>;
+using PSplitT = std::tuple<const shared_ptr<Body>, Vector3r, Vector3r>;
 
 //*********************************************************************************
 /* Evaluate tensorial stress estimation in polyhedras */
@@ -81,7 +81,7 @@
 	vector<Matrix3r> bStresses (scene->bodies->size(), Matrix3r::Zero());
 	getStressForEachBody(bStresses);
 
-	FOREACH(const shared_ptr<Body>& b, *rb->bodies){
+	for(const auto b : *(rb->bodies)) {
 		if(!b || !b->material || !b->shape) continue;
 		shared_ptr<Polyhedra> p=YADE_PTR_DYN_CAST<Polyhedra>(b->shape);
 		shared_ptr<PolyhedraMat> m=YADE_PTR_DYN_CAST<PolyhedraMat>(b->material);