tuse time as x axis if experiment is stress-controlled - sphere - GPU-based 3D discrete element method algorithm with optional fluid coupling
(HTM) git clone git://src.adamsgaard.dk/sphere
(DIR) Log
(DIR) Files
(DIR) Refs
(DIR) LICENSE
---
(DIR) commit be8b27cd34e042987b05a57e1e4e4d55535acc99
(DIR) parent 7f45ab66ff84ca552892b16da784395b5b3e5082
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Fri, 23 Jan 2015 09:43:55 +0100
use time as x axis if experiment is stress-controlled
Diffstat:
M python/sphere.py | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
---
(DIR) diff --git a/python/sphere.py b/python/sphere.py
t@@ -6042,7 +6042,7 @@ class sim:
sb.readstep(i, verbose = False)
pres[:,i] = numpy.average(numpy.average(sb.p_f, axis=0), axis=0)
shear_strain[i] = sb.shearStrain()
- #t = numpy.linspace(0.0, sb.time_current, lastfile+1)
+ t = numpy.linspace(0.0, sb.time_current, lastfile+1)
# Plotting
if (outformat != 'txt'):
t@@ -6053,9 +6053,12 @@ class sim:
# use largest difference in p from 0 as +/- limit on colormap
p_ext = numpy.max(numpy.abs(pres))
+ if self.wmode[0] == 3:
+ x = t
+ else:
+ x = shear_strain
im1 = ax.pcolormesh(
- #t, zpos_c, pres,
- shear_strain, zpos_c, pres,
+ x, zpos_c, pres,
cmap=matplotlib.cm.get_cmap('bwr'),
#cmap=matplotlib.cm.get_cmap('coolwarm'),
vmin=-p_ext, vmax=p_ext,
t@@ -6066,7 +6069,10 @@ class sim:
ax.set_ylim([zpos_c[0], sb.w_x[0]])
else:
ax.set_ylim([zpos_c[0], zpos_c[-1]])
- ax.set_xlabel('Shear strain $\\gamma$ [-]')
+ if numpy.abs(self.p_mod_A) > 1.0e-3:
+ ax.set_xlabel('Time $t$ [s]')
+ else:
+ ax.set_xlabel('Shear strain $\\gamma$ [-]')
#ax.set_xlabel('Time $t$ [s]')
ax.set_ylabel('Vertical position $z$ [m]')