tFix input and visualization issues - sphere - GPU-based 3D discrete element me… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 6fc9ec5215b4ee5c0ed3e666ac0a0298d6fec7f3 | |
parent c07cff509228069d18a5d0b0f93a744e503b0167 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 26 Nov 2019 11:42:32 +0100 | |
Fix input and visualization issues | |
Diffstat: | |
M python/supraglacial-plots.py | 13 +++++++------ | |
1 file changed, 7 insertions(+), 6 deletions(-) | |
--- | |
diff --git a/python/supraglacial-plots.py b/python/supraglacial-plots.py | |
t@@ -91,8 +91,8 @@ plt.savefig('supraglacial_flux.pdf') | |
for dpdz in dpdz_values: | |
for slope_angle in slope_angle_values: | |
- print('### ' + sim.id()) | |
sim = sphere.sim("supraglacial-slope{}-dpdz{}".format(slope_angle, dpd… | |
+ print('### ' + sim.id()) | |
sim.readlast() | |
N_time = sim.status() - 1 | |
t@@ -105,7 +105,7 @@ for dpdz in dpdz_values: | |
v_x_space_avg = np.empty_like(z) | |
xsum_space_avg = np.empty_like(z) | |
- for it in np.arange(N_time): | |
+ for it in np.arange(1, N_time): | |
sim.readstep(it) | |
dz = np.max(sim.x[:,2])/len(z) | |
t@@ -120,25 +120,26 @@ for dpdz in dpdz_values: | |
flux[it] = np.trapz(xsum_space_avg/sim.time_current, dx=dz) | |
ax1 = plt.subplot(4,1,1) | |
- plt.plot(timesteps, porosity, '+-') | |
+ plt.plot(timesteps, porosity, '-') | |
plt.ylabel('Porosity [-]') | |
plt.setp(ax1.get_xticklabels(), visible=False) | |
ax2 = plt.subplot(4,1,2) | |
- plt.plot(timesteps, velocity, '+-') | |
+ plt.semilogy(timesteps, velocity, '-') | |
plt.ylabel('Avg. velocity [m/s]') | |
plt.setp(ax2.get_xticklabels(), visible=False) | |
ax3 = plt.subplot(4,1,3) | |
- plt.plot(timesteps, displacement, '+-') | |
+ plt.plot(timesteps, displacement, '-') | |
plt.ylabel('Cumulative displacement [m]') | |
plt.setp(ax3.get_xticklabels(), visible=False) | |
ax1 = plt.subplot(4,1,4) | |
- plt.plot(timesteps, flux, '+-') | |
+ plt.semilogy(timesteps, flux, '-') | |
plt.ylabel('Cumulative flux [m$^2$/s]') | |
plt.xlabel('Time [s]') | |
+ plt.tight_layout() | |
plt.savefig(sim.id() + '-timeseries.png') | |
plt.savefig(sim.id() + '-timeseries.pdf') | |
plt.clf() |