tplot stresses along with wall position during consolidation - 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 5ee27b3f9a8253d2ed7a5797882e1bc04299ea81
 (DIR) parent 345c817c25dcf50105367e45e2f5cce5c4e206de
 (HTM) Author: Anders Damsgaard <andersd@riseup.net>
       Date:   Thu, 16 Nov 2017 06:56:02 -0800
       
       plot stresses along with wall position during consolidation
       
       Diffstat:
         M examples/shear.jl                   |      15 +++++++++++++--
       
       1 file changed, 13 insertions(+), 2 deletions(-)
       ---
 (DIR) diff --git a/examples/shear.jl b/examples/shear.jl
       t@@ -115,6 +115,7 @@ Granular.setTotalTime!(sim, 5.0)
        # Run the consolidation experiment, and monitor top wall position over time
        time = Float64[]
        compaction = Float64[]
       +effective_normal_stress = Float64[]
        while sim.time < sim.time_total
        
            for i=1:100  # run for 100 steps before measuring shear stress and dilation
       t@@ -123,13 +124,23 @@ while sim.time < sim.time_total
        
            append!(time, sim.time)
            append!(compaction, sim.walls[1].pos)
       +    append!(effective_normal_stress, Granular.getWallNormalStress(sim))
        
        end
       +defined_normal_stress = ones(length(effective_normal_stress)) *
       +    Granular.getWallNormalStress(sim, stress_type="effective")
       +PyPlot.subplot(211)
       +PyPlot.subplots_adjust(hspace=0.0)
       +ax1 = gca()
       +PyPlot.setp(ax1[:get_xticklabels](),visible=false) # Disable x tick labels
        PyPlot.plot(time, compaction)
       -PyPlot.subplot(212, sharex=ax1)
       -PyPlot.plot(time, dilation)
        PyPlot.xlabel("Time [s]")
        PyPlot.ylabel("Top wall height [m]")
       +PyPlot.subplot(212, sharex=ax1)
       +PyPlot.plot(time, defined_normal_stress)
       +PyPlot.plot(time, effective_normal_stress)
       +PyPlot.xlabel("Time [s]")
       +PyPlot.ylabel("Normal stress [Pa]")
        PyPlot.savefig(sim.id * "-time_vs_compaction-stress.pdf")
        PyPlot.clf()