Introduction
Introduction Statistics Contact Development Disclaimer Help
tadd functions to read convergence evolution, add shearing motion - sphere - GP…
git clone git://src.adamsgaard.dk/sphere
Log
Files
Refs
LICENSE
---
commit de635c6540c846431e3926b35196b4413b7469ac
parent b489f0065339d98252f9dd6788093dc752a45226
Author: Anders Damsgaard <[email protected]>
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(-)
---
diff --git a/python/halfshear-darcy-starter.py b/python/halfshear-darcy-starter…
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
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()
You are viewing proxied material from mx1.adamsgaard.dk. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.