simulation_sheardisp_plot.jl (1211B)
1 #/usr/bin/env julia 2 ENV["MPLBACKEND"] = "Agg" 3 import PyPlot 4 import LsqFit 5 6 const id_prefix = "mohr_coulomb" 7 const vel_shear = 1.0 8 9 # Normal stresses for consolidation and shear [Pa] 10 const N_list = [20e3] 11 12 ypos = Float64[] 13 xdisp = Float64[] 14 sim_id = "" 15 16 alpha=0.7 17 18 for kind in ["mu0.3_sigma_c0kPa", "mu0.0_sigma_c200kPa"] 19 for N in N_list 20 21 #mohr_coulomb_mu0.3_sigma_c0kPa.pdf-seed1-shear-N20000.0Pa-vel_shear1.0m-s-data 22 sim_id = "$(id_prefix)_$(kind).pdf-seed1-shear-N$(N)Pa-vel_shear$(vel_shear)m-s" 23 info(sim_id) 24 data = readdlm(sim_id * "/ypos-xdisp.csv", ',', skipstart=1) 25 26 xdisp = data[:,1] 27 ypos = data[:,5] 28 29 if kind == "mu0.3_sigma_c0kPa" 30 PyPlot.plot(xdisp, ypos, "xk", label="Frictional DEM", alpha=alpha) 31 32 elseif kind == "mu0.0_sigma_c200kPa" 33 PyPlot.plot(xdisp, ypos, "+b", label="Cohesive DEM", alpha=alpha) 34 35 else 36 error("kind $kind not understood") 37 end 38 end 39 end 40 41 # Annotation 42 PyPlot.ylabel("\$y\$ [m]") 43 PyPlot.xlabel("Displacement along \$x\$ [m]") 44 #PyPlot.xlim(minimum(N_list)*0.9/1e3, maximum(N_list)*1.1/1e3) 45 PyPlot.legend() 46 PyPlot.savefig(id_prefix * "-xdisp.pdf") 47 PyPlot.clf()