Granular.jl

Julia package for granular dynamics simulation
git clone git://src.adamsgaard.dk/Granular.jl
Log | Files | Refs | README | LICENSE

commit ef80fff084cc711ed619362809d7b02b38888954
parent 710c5c9ec78913f4e95a06de9028a9778229edf1
Author: Anders Damsgaard <andersd@riseup.net>
Date:   Wed, 15 Nov 2017 19:13:50 -0500

attempt to render after each phase

Diffstat:
Mexamples/shear.jl | 9++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/examples/shear.jl b/examples/shear.jl @@ -114,6 +114,9 @@ Granular.setTotalTime!(sim, 5.0) # Run the consolidation experiment Granular.run!(sim) +# Try to render the simulation if `pvpython` is installed on the system +Granular.render(sim, trim=false) + # Save the simulation state to disk in case we need to reuse the consolidated # state (e.g. different shear velocities below) Granular.writeSimulation(sim) @@ -196,6 +199,10 @@ while sim.time < sim.time_total # Determine the current dilation append!(dilation, (sim.walls[1].pos - y_bot)/thickness_initial) +end + +# Try to render the simulation if `pvpython` is installed on the system +Granular.render(sim, trim=false) # Save the simulation state to disk in case we need to reuse the sheared state Granular.writeSimulation(sim) @@ -212,7 +219,7 @@ PyPlot.clf() # Plot shear strain vs. shear stress and dilation PyPlot.subplot(211) -PyPlot.plot(shear_strain, shear_stress) +PyPlot.plot(time, shear_stress) PyPlot.subplot(212) PyPlot.plot(shear_strain, dilation) PyPlot.xlabel("Shear strain [-]")