tadd min, mean and max pressures to shear strain plot - 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 e4530ec4d724ea43f1e7ec7695c426c0021247db
 (DIR) parent 279f64a789f5e9b141e0723092013014d6579d21
 (HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
       Date:   Tue,  9 Sep 2014 13:31:11 +0200
       
       add min, mean and max pressures to shear strain plot
       
       Diffstat:
         M python/shear-results.py             |      46 +++++++++++++++++++++++++------
       
       1 file changed, 38 insertions(+), 8 deletions(-)
       ---
 (DIR) diff --git a/python/shear-results.py b/python/shear-results.py
       t@@ -18,6 +18,9 @@ c_phi = 1.0
        shear_strain = [[], [], []]
        friction = [[], [], []]
        dilation = [[], [], []]
       +p_min = [[], [], []]
       +p_mean = [[], [], []]
       +p_max = [[], [], []]
        
        fluid=True
        
       t@@ -50,6 +53,17 @@ for c in numpy.arange(1,len(cvals)+1):
                shear_strain[c] = sim.shear_strain
                friction[c] = sim.tau/sim.sigma_eff
                dilation[c] = sim.dilation
       +
       +        # fluid pressures
       +        p_mean[c] = numpy.zeros_like(shear_strain[c])
       +        p_min[c] = numpy.zeros_like(shear_strain[c])
       +        p_max[c] = numpy.zeros_like(shear_strain[c])
       +        for i in numpy.arange(sim.status()):
       +            iz_top = int(sim.w_x[0]/(sim.L[2]/sim.num[2]))-1
       +            p_mean[c][i] = numpy.mean(sim.p_f[:,:,0:iz_top])
       +            p_min[c][i] = numpy.min(sim.p_f[:,:,0:iz_top])
       +            p_max[c][i] = numpy.min(sim.p_f[:,:,0:iz_top])
       +
            else:
                print(sid + ' not found')
        
       t@@ -59,33 +73,49 @@ for c in numpy.arange(1,len(cvals)+1):
                #sim.writeVTKall()
            c += 1
        
       -fig = plt.figure(figsize=(8,8))
       +
       +#fig = plt.figure(figsize=(8,8)) # (w,h)
       +fig = plt.figure(figsize=(8,12))
        
        #plt.subplot(3,1,1)
        #plt.ticklabel_format(style='sci', axis='y', scilimits=(0,0))
        
       -ax1 = plt.subplot(211)
       -ax2 = plt.subplot(212, sharex=ax1)
       +ax1 = plt.subplot(311)
       +ax2 = plt.subplot(312, sharex=ax1)
       +ax3 = plt.subplot(313, sharex=ax1)
        ax1.plot(shear_strain[0], friction[0], label='dry')
        ax2.plot(shear_strain[0], dilation[0], label='dry')
        
       +color = ['b','g','r']
        for c in numpy.arange(1,len(cvals)+1):
       +
            ax1.plot(shear_strain[c][1:], friction[c][1:], \
                    label='$c$ = %.2f' % (cvals[c-1]))
       +
            ax2.plot(shear_strain[c][1:], dilation[c][1:], \
                    label='$c$ = %.2f' % (cvals[c-1]))
       -    #plt.plot(dpdz[c], K[c], 'o-', label='$c$ = %.2f' % (cvals[c]))
       -    #plt.semilogx(dpdz[c], K[c], 'o-', label='$c$ = %.2f' % (cvals[c]))
       -    #plt.semilogy(dpdz[c], K[c], 'o-', label='$c$ = %.2f' % (cvals[c]))
       -    #plt.loglog(dpdz[c], K[c], 'o-', label='$c$ = %.2f' % (cvals[c]))
       -ax2.set_xlabel('Shear strain [-]')
       +
       +    ax3.plot(shear_strain[c][1:], p_max[c][1:], '--' + color[c])
       +    ax3.plot(shear_strain[c][1:], p_mean[c][1:], '-' + color[c], \
       +            label='$c$ = %.2f' % (cvals[c-1]))
       +    ax3.plot(shear_strain[c][1:], p_min[c][1:], '--' + color[c])
       +
       +ax3.set_xlabel('Shear strain $\\gamma$ [-]')
       +
        ax1.set_ylabel('Shear friction $\\tau/\\sigma\'$ [-]')
        ax2.set_ylabel('Dilation $\\Delta h/(2r)$ [-]')
       +ax3.set_ylabel('Fluid pressure $p_\\text{f}$ [Pa]')
       +
        plt.setp(ax1.get_xticklabels(), visible=False)
       +plt.setp(ax2.get_xticklabels(), visible=False)
       +
        ax1.grid()
        ax2.grid()
       +ax3.grid()
       +
        ax1.legend(loc='lower right', prop={'size':18})
        ax2.legend(loc='lower right', prop={'size':18})
       +ax3.legend(loc='lower right', prop={'size':18})
        
        plt.tight_layout()
        filename = 'shear-10kPa-stress-dilation.pdf'