← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3928: Increase the size of force container.

 

------------------------------------------------------------
revno: 3928
committer: Anton Gladky <gladky.anton@xxxxxxxxx>
timestamp: Wed 2016-08-24 18:28:27 +0200
message:
  Increase the size of force container.
  
  Prevents crashes, when the simulation is loaded
  with O.load, but force container is not large
  enough to keep all 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	2016-04-12 04:37:00 +0000
+++ pkg/common/InsertionSortCollider.cpp	2016-08-24 16:28:27 +0000
@@ -221,6 +221,9 @@
 		}
 		if(minima.size()!=(size_t)3*nBodies){ minima.resize(3*nBodies); maxima.resize(3*nBodies); }
 		assert((size_t)BB[0].size==2*scene->bodies->size());
+		
+		//Increase the size of force container.
+		scene->forces.addMaxId(2*scene->bodies->size());
 
 		// update periodicity
 		assert(BB[0].axis==0); assert(BB[1].axis==1); assert(BB[2].axis==2);