tadd functions to read convergence evolution, add shearing motion - 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 de635c6540c846431e3926b35196b4413b7469ac
(DIR) parent b489f0065339d98252f9dd6788093dc752a45226
(HTM) Author: Anders Damsgaard <anders.damsgaard@geo.au.dk>
Date: Wed, 12 Nov 2014 11:28:14 +0100
add functions to read convergence evolution, add shearing motion
Diffstat:
M python/halfshear-darcy-starter.py | 4 ++--
M python/sphere.py | 16 ++++++++++++++--
2 files changed, 16 insertions(+), 4 deletions(-)
---
(DIR) diff --git a/python/halfshear-darcy-starter.py b/python/halfshear-darcy-starter.py
t@@ -34,8 +34,8 @@ sim.cleanup()
sim.adjustUpperWall()
sim.zeroKinematics()
-sim.shear(0.0/20.0)
-#sim.shear(1.0/20.0)
+#sim.shear(0.0/20.0)
+sim.shear(1.0/20.0)
K_q_real = 36.4e9
K_w_real = 2.2e9
K_q_sim = 1.16e9
(DIR) diff --git a/python/sphere.py b/python/sphere.py
t@@ -5076,6 +5076,16 @@ class sim:
plt.clf()
plt.close(fig)
+ def convergence(self):
+ '''
+ Read the convergence evolution in the CFD solver. The values are stored
+ in `self.conv` with iteration number in the first column and iteration
+ count in the second column.
+
+ See also: :func:`plotConvergence()`
+ '''
+ self.conv = numpy.loadtxt('../output/' + self.sid + '-conv.log')
+
def plotConvergence(self, graphics_format='png'):
'''
Plot the convergence evolution in the CFD solver. The plot is saved
t@@ -5084,14 +5094,16 @@ class sim:
:param graphics_format: Save the plot in this format
:type graphics_format: str
+
+ See also: :func:`convergence()`
'''
fig = plt.figure()
- conv = numpy.loadtxt('../output/' + self.sid + '-conv.log')
+ self.convergence()
plt.title('Convergence evolution in CFD solver in "' + self.sid + '"')
plt.xlabel('Time step')
plt.ylabel('Jacobi iterations')
- plt.plot(conv[:,0], conv[:,1])
+ plt.plot(self.conv[:,0], self.conv[:,1])
plt.grid()
plt.savefig(self.sid + '-conv.' + graphics_format)
plt.clf()