tadd plot of inertia parameter - 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 ab6a20e6db11c8ccafdae970b22c88d4d88d0b59
 (DIR) parent 3a0dffe3b2b4ac5ad6ad10473b1fb64f6741769d
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Mon,  2 Mar 2015 13:24:38 +0100
       
       add plot of inertia parameter
       
       Diffstat:
         M python/sphere.py                    |      32 ++++++++++++++++++++++++++++---
       
       1 file changed, 29 insertions(+), 3 deletions(-)
       ---
 (DIR) diff --git a/python/sphere.py b/python/sphere.py
       t@@ -4484,9 +4484,10 @@ class sim:
        
                # Current height
                w_x0 = self.w_x[0]
       +        v = self.shearVelocity()
        
                # Return shear strain rate
       -        return self.shearVelocity()/w_x0
       +        return v/w_x0
        
            def inertiaParameterPlanarShear(self):
                '''
       t@@ -5873,8 +5874,9 @@ class sim:
                method.
        
                :param method: The type of plot to render. Possible values are 'energy',
       -            'walls', 'triaxial', 'mean-fluid-pressure', 'fluid-pressure', 
       -            'shear', 'shear-displacement', 'porosity', 'rate-dependence'
       +            'walls', 'triaxial', 'inertia', 'mean-fluid-pressure',
       +            'fluid-pressure', 'shear', 'shear-displacement', 'porosity',
       +            'rate-dependence'
                :type method: str
                :param savefig: Save the image instead of showing it on screen
                :type savefig: bool
       t@@ -6538,6 +6540,30 @@ class sim:
                    ax1.set_ylabel('Shear velocity [m/s]')
                    '''
        
       +        elif method == 'inertia':
       +
       +            t = numpy.zeros(sb.status())
       +            I = numpy.zeros(sb.status())
       +
       +            for i in numpy.arange(sb.status):
       +                sb.readstep(i, verbose = False)
       +                t = sb.currentTime()
       +                I = sb.inertiaParameterPlanarShear()
       +
       +            # Plotting
       +            if outformat != 'txt':
       +
       +                if xlim:
       +                    ax1.set_xlim(xlim)
       +
       +                # linear plot of deviatoric stress
       +                ax1 = plt.subplot2grid((1,1),(0,0))
       +                ax1.set_xlabel('Time $t$ [s]')
       +                ax1.set_ylabel('Inertia parameter $I$ [-]')
       +                ax1.semilogy(t, I)
       +                #ax1.legend()
       +                ax1.grid()
       +
                elif method == 'mean-fluid-pressure':
        
                    # Read pressure values from simulation binaries