tfancy legends, fix consolidation plot - sphere - GPU-based 3D discrete element… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 78d454149f22e5d2eb8b39a84159b78ff5259dc0 | |
parent 3a3e4b680084c869f0c33d45b9c289b47b53962b | |
Author: Anders Damsgaard <[email protected]> | |
Date: Thu, 11 Sep 2014 14:24:12 +0200 | |
fancy legends, fix consolidation plot | |
Diffstat: | |
M python/consolidation-curve.py | 13 +++++++------ | |
M python/permeability-results.py | 2 +- | |
M python/shear-results.py | 33 ++++++++++++++++++++---------… | |
3 files changed, 29 insertions(+), 19 deletions(-) | |
--- | |
diff --git a/python/consolidation-curve.py b/python/consolidation-curve.py | |
t@@ -34,15 +34,16 @@ for c_grad_p in c_grad_p_list: | |
if os.path.isfile('../output/' + sid + '.status.dat'): | |
sim = sphere.sim(sid, fluid=True) | |
- t[c] = numpy.ones(sim.status()) | |
- H[c] = numpy.ones(sim.status()) | |
+ t[c] = numpy.ones(sim.status()-1) | |
+ H[c] = numpy.ones(sim.status()-1) | |
#sim.visualize('walls') | |
#sim.writeVTKall() | |
#sim.plotLoadCurve() | |
#sim.readfirst(verbose=True) | |
- for i in numpy.arange(1, sim.status()+1): | |
+ #for i in numpy.arange(1, sim.status()+1): | |
+ for i in numpy.arange(1, sim.status()): | |
sim.readstep(i, verbose=False) | |
t[c][i-1] = sim.time_current[0] | |
H[c][i-1] = sim.w_x[0] | |
t@@ -92,11 +93,11 @@ plt.ylabel('Thickness change [m]') | |
#plt.ticklabel_format(style='sci', axis='y', scilimits=(0,0)) | |
#for c in range(len(c_grad_p_list)): | |
#H[c] /= -min_H_c | |
-plt.semilogx(t[0], H[1], '-', label='$c$ = %.2f' % (c_grad_p_list[c])) | |
-plt.semilogx(t[1], H[0], '--', label='$c$ = %.2f' % (c_grad_p_list[c])) | |
+plt.semilogx(t[0], H[0], '-k', label='$c$ = %.2f' % (c_grad_p_list[0])) | |
+plt.semilogx(t[1], H[1], '--k', label='$c$ = %.2f' % (c_grad_p_list[1])) | |
#plt.grid() | |
-plt.legend(loc=0, prop={'size':18}) | |
+plt.legend(loc='best', prop={'size':18}, fancybox=True, framealpha=0.5) | |
plt.tight_layout() | |
filename = 'cons-curves.pdf' | |
plt.savefig(filename) | |
diff --git a/python/permeability-results.py b/python/permeability-results.py | |
t@@ -86,7 +86,7 @@ plt.grid() | |
#plt.plot(dpdz, phi_bar, '+') | |
#plt.grid() | |
-plt.legend(loc='lower left', prop={'size':18}) | |
+plt.legend(loc='lower left', prop={'size':18}, fancybox=True, framealpha=0.5) | |
plt.tight_layout() | |
filename = 'permeability-dpdz-vs-K-vs-c.pdf' | |
#print(os.getcwd() + '/' + filename) | |
diff --git a/python/shear-results.py b/python/shear-results.py | |
t@@ -14,7 +14,8 @@ import matplotlib.pyplot as plt | |
#sigma0_list = numpy.array([1.0e3, 2.0e3, 4.0e3, 10.0e3, 20.0e3, 40.0e3]) | |
sigma0 = 10.0e3 | |
-cvals = [1.0, 0.1] | |
+#cvals = [1.0, 0.1] | |
+cvals = [1.0] | |
c_phi = 1.0 | |
shear_strain = [[], [], []] | |
t@@ -62,9 +63,9 @@ for c in numpy.arange(1,len(cvals)+1): | |
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.max(sim.p_f[:,:,0:iz_top]) | |
+ p_mean[c][i] = numpy.mean(sim.p_f[:,:,0:iz_top])/1000 | |
+ p_min[c][i] = numpy.min(sim.p_f[:,:,0:iz_top])/1000 | |
+ p_max[c][i] = numpy.max(sim.p_f[:,:,0:iz_top])/1000 | |
else: | |
print(sid + ' not found') | |
t@@ -95,12 +96,17 @@ for c in numpy.arange(1,len(cvals)+1): | |
label='$c$ = %.2f' % (cvals[c-1])) | |
ax2.plot(shear_strain[c][1:], dilation[c][1:], \ | |
- label='$c$ = %.2f' % (cvals[c-1])) | |
+ label='$c$ = %.2f' % (cvals[c-1]), linewidth=2) | |
- ax3.plot(shear_strain[c][1:], p_max[c][1:]/1000, '--' + color[c]) | |
- ax3.plot(shear_strain[c][1:], p_mean[c][1:]/1000, '-' + color[c], \ | |
- label='$c$ = %.2f' % (cvals[c-1])) | |
- ax3.plot(shear_strain[c][1:], p_min[c][1:]/1000, '--' + color[c]) | |
+ alpha = 0.5 | |
+ ax3.plot(shear_strain[c][1:], p_max[c][1:], '-' + color[c], alpha=alpha) | |
+ ax3.plot(shear_strain[c][1:], p_mean[c][1:], '-' + color[c], \ | |
+ label='$c$ = %.2f' % (cvals[c-1]), linewidth=2) | |
+ ax3.plot(shear_strain[c][1:], p_min[c][1:], '-' + color[c], alpha=alpha) | |
+ | |
+ ax3.fill_between(shear_strain[c][1:], p_min[c][1:], p_max[c][1:], | |
+ where=p_min[c][1:]<=p_max[c][1:], facecolor=color[c], | |
+ interpolate=True, alpha=alpha) | |
ax3.set_xlabel('Shear strain $\\gamma$ [-]') | |
t@@ -115,9 +121,12 @@ 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}) | |
+legend_alpha=0.5 | |
+ax1.legend(loc='best', prop={'size':18}, fancybox=True, framealpha=legend_alph… | |
+ax2.legend(loc='lower right', prop={'size':18}, fancybox=True, | |
+ framealpha=legend_alpha) | |
+ax3.legend(loc='lower right', prop={'size':18}, fancybox=True, | |
+ framealpha=legend_alpha) | |
plt.tight_layout() | |
filename = 'shear-10kPa-stress-dilation.pdf' |