tAdded void ratio function - sphere - GPU-based 3D discrete element method algo… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit fd4911c71e33e2676faec3512d6fea2fba47a120 | |
parent 4c584cfa1126b464c9df23690533d7e8758ee55d | |
Author: Anders Damsgaard <[email protected]> | |
Date: Wed, 29 Aug 2012 13:56:47 +0200 | |
Added void ratio function | |
Diffstat: | |
M python/sphere.py | 15 +++++++++++++++ | |
1 file changed, 15 insertions(+), 0 deletions(-) | |
--- | |
diff --git a/python/sphere.py b/python/sphere.py | |
t@@ -730,6 +730,21 @@ class Spherebin: | |
elif method == 'shearrate': | |
return numpy.sum(self.es_dot) | |
+ def voidRatio(self): | |
+ """ Return the current void ratio | |
+ """ | |
+ | |
+ # Find the bulk volume | |
+ V_t = (self.L[0] - self.origo[0]) | |
+ *(self.L[1] - self.origo[1]) | |
+ *(self.w_x[0] - self.origo[2]) | |
+ | |
+ # Find the volume of solids | |
+ V_s = numpy.sum(4.0/3.0 * math.pi * self.radius**3) | |
+ | |
+ # Return the void ratio | |
+ e = (V_t - V_s)/V_s | |
+ return e | |
def render(binary, | |
out = '~/img_out/rt-out', |