← Back to team overview

yade-dev team mailing list archive

[Branch ~yade-pkg/yade/git-trunk] Rev 3778: Fix volume calculation. Closes LP:1261415

 

------------------------------------------------------------
revno: 3778
committer: Anton Gladky <gladk@xxxxxxxxxx>
timestamp: Mon 2013-12-16 16:05:33 +0100
message:
  Fix volume calculation. Closes LP:1261415
  
  Fixes volume calculation in py/yade/pack.py due to integer arithmetics.
  proposed solution. Thanks to Rafael Torres
modified:
  py/pack/pack.py


--
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 'py/pack/pack.py'
--- py/pack/pack.py	2013-09-19 08:50:04 +0000
+++ py/pack/pack.py	2013-12-16 15:05:33 +0000
@@ -459,7 +459,7 @@
 		# repetition to the required cell size will be done below, after memoizing the result
 	else:
 		assumedFinalDensity=0.6
-		V=(4/3)*pi*radius**3; N=assumedFinalDensity*fullDim[0]*fullDim[1]*fullDim[2]/V;
+		V=(4.0/3.0)*pi*radius**3.0; N=assumedFinalDensity*fullDim[0]*fullDim[1]*fullDim[2]/V;
 		TriaxialTest(
 			numberOfGrains=int(N),radiusMean=radius,radiusStdDev=rRelFuzz,
 			# upperCorner is just size ratio, if radiusMean is specified