tadd function to plot load path - 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 fc0101e370e16bcd388383a32f38e23a6894f3f5
(DIR) parent bcefb478f8cff583a5b132ce661a36a0aaa0e536
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Thu, 14 Aug 2014 13:50:16 +0200
add function to plot load path
Diffstat:
M python/sphere.py | 26 +++++++++++++++++++++++++-
1 file changed, 25 insertions(+), 1 deletion(-)
---
(DIR) diff --git a/python/sphere.py b/python/sphere.py
t@@ -2300,7 +2300,6 @@ class sim:
for i in range(5):
self.adjustWall(idx=i)
-
def shear(self, shear_strain_rate = 1.0):
'''
Setup shear experiment. The shear strain rate is the shear velocity
t@@ -4149,6 +4148,31 @@ class sim:
plt.clf()
plt.close(fig)
+ def plotLoadCurve(self, graphics_format='png'):
+ '''
+ Plot the load curve (log time vs. upper wall movement). The plot is
+ saved in the current folder with the file name
+ '<simulation id>-loadcurve.<graphics_format>'.
+ '''
+ t = numpy.empty(self.status())
+ dh = numpy.empty_like(t)
+ sim = sphere.sim(self.sid, fluid=self.fluid)
+ sim.readfirst(i)
+ h = sim.w_x[0]
+ for i in numpy.arange(1, self.status()):
+ sim.readstep(i)
+ t[i-1] = sim.time_current[0]
+ dh[i-1] = h - sim.w_x[0]
+
+ fig = plt.figure()
+ plt.xlabel('Time [s]')
+ plt.ylabel('Consolidation [m]')
+ plt.semilogx(t, dh)
+ plt.grid()
+ plt.savefig(self.sid + '-loadcurve.' + graphics_format)
+ plt.clf()
+ plt.close(fig)
+
def plotConvergence(self, graphics_format='png'):
'''
Plot the convergence evolution in the CFD solver. The plot is saved