tAdded error handling if visualization method is called with empty self.radius - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
(HTM) git clone git://src.adamsgaard.dk/sphere
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit 874be72bf7a0fa969d777e4ad5e24061e6c7047a
(DIR) parent 5b0fa442b5e122f0f574ba1f14b1c9fc83c5f601
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Mon, 31 Mar 2014 13:39:23 +0200
Added error handling if visualization method is called with empty self.radius
Diffstat:
M python/sphere.py | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/python/sphere.py b/python/sphere.py
t@@ -4191,6 +4191,9 @@ class sim:
# dilation in number of mean particle diameters
d_bar = numpy.mean(self.radius)*2.0
+ if numpy.isnan(d_bar):
+ raise Exception("Error, d_bar is NaN. Please check that the"
+ + " radii are initialized.")
dilation[i] = (sb.w_x[0] - w_x0)/d_bar
# Test if this was the max. shear stress
t@@ -4218,7 +4221,8 @@ class sim:
ax2 = plt.subplot2grid((2,1),(1,0))
ax2.set_xlabel('Shear strain [-]')
#ax2.set_ylabel('Dilation [m]')
- ax2.set_ylabel('Dilation [%]')
+ #ax2.set_ylabel('Dilation [%]')
+ ax2.set_ylabel('Dilation, $\Delta h/(2\\bar{r})$ [m]')
ax2.plot(xdisp/w_x0, dilation, '+-')
ax2.grid()