tupdate dynamic wall function call and add plotting routines - Granular.jl - Julia package for granular dynamics simulation
 (HTM) git clone git://src.adamsgaard.dk/Granular.jl
 (DIR) Log
 (DIR) Files
 (DIR) Refs
 (DIR) README
 (DIR) LICENSE
       ---
 (DIR) commit 710c5c9ec78913f4e95a06de9028a9778229edf1
 (DIR) parent bb73c093ae2450a3c1b80889a5edb356157fe705
 (HTM) Author: Anders Damsgaard <andersd@riseup.net>
       Date:   Wed, 15 Nov 2017 19:02:36 -0500
       
       update dynamic wall function call and add plotting routines
       
       Diffstat:
         M examples/shear.jl                   |      32 ++++++++++++++++++++++++-------
       
       1 file changed, 25 insertions(+), 7 deletions(-)
       ---
 (DIR) diff --git a/examples/shear.jl b/examples/shear.jl
       t@@ -1,6 +1,8 @@
        #/usr/bin/env julia
        import Granular
        import JLD
       +ENV["MPLBACKEND"] = "Agg"
       +import PyPlot
        
        # Common simulation identifier
        const id_prefix = "test0"
       t@@ -83,10 +85,8 @@ for grain in grains
                y_top = grain.lin_pos[2] + grain.contact_radius
            end
        end
       -# TODO
       -Granular.addDynamicWall!(sim, normal=[0., -1.], pos=y_top,
       -                         boundary_condition="normal stress",
       -                         normal_stress=N)
       +Granular.addWallLinearFrictionless!(sim, normal=[0., 1.], pos=y_top,
       +                                    bc="normal stress", normal_stress=-N)
        
        # Resize the grid to span the current state
        Granular.fitGridToGrains!(sim, sim.ocean)
       t@@ -201,10 +201,28 @@ while sim.time < sim.time_total
        Granular.writeSimulation(sim)
        
        # Plot time vs. shear stress and dilation
       -# TODO
       +PyPlot.subplot(211)
       +PyPlot.plot(time, shear_stress)
       +PyPlot.subplot(212)
       +PyPlot.plot(time, dilation)
       +PyPlot.xlabel("Time [s]")
       +PyPlot.ylabel("Shear stress [Pa]")
       +PyPlot.savefig(sim.id * "-time_vs_shear-stress.pdf")
       +PyPlot.clf()
        
        # Plot shear strain vs. shear stress and dilation
       -# TODO
       +PyPlot.subplot(211)
       +PyPlot.plot(shear_strain, shear_stress)
       +PyPlot.subplot(212)
       +PyPlot.plot(shear_strain, dilation)
       +PyPlot.xlabel("Shear strain [-]")
       +PyPlot.ylabel("Shear stress [Pa]")
       +PyPlot.savefig(sim.id * "-shear-strain_vs_shear-stress.pdf")
       +PyPlot.clf()
        
        # Plot time vs. shear strain (boring when the shear experiment is rate controlled)
       -# TODO
       +PyPlot.plot(time, shear_strain)
       +PyPlot.xlabel("Time [s]")
       +PyPlot.ylabel("Shear strain [-]")
       +PyPlot.savefig(sim.id * "-time_vs_shear-strain.pdf")
       +PyPlot.clf()