timprove plot title - sphere - GPU-based 3D discrete element method algorithm w… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit dad3ebdd69aadb6b7b69421f02dd11a1c573d0e3 | |
parent 14c2ecf26eaf02a9d5d96de31afef8a6ff0a1b3a | |
Author: Anders Damsgaard <[email protected]> | |
Date: Thu, 9 Apr 2015 15:47:35 +0200 | |
improve plot title | |
Diffstat: | |
M python/halfshear-darcy-combined.py | 2 +- | |
M python/sphere.py | 18 +++++++++++++----- | |
2 files changed, 14 insertions(+), 6 deletions(-) | |
--- | |
diff --git a/python/halfshear-darcy-combined.py b/python/halfshear-darcy-combin… | |
t@@ -276,7 +276,7 @@ ax7.set_ylim([1.0e1, 2.0e4]) | |
ax8 = ax7.twinx() | |
ax8color='green' | |
ax8.plot(t[:n.size], coordinationnumber, color=ax8color, linewidth=linewidth) | |
-ax8.set_ylabel('Contacts per particle [-]') | |
+ax8.set_ylabel('Contacts per grain [-]') | |
ax8.yaxis.label.set_color(ax8color) | |
for tl in ax8.get_yticklabels(): | |
tl.set_color(ax8color) | |
diff --git a/python/sphere.py b/python/sphere.py | |
t@@ -5308,12 +5308,12 @@ class sim: | |
numpy.degrees(numpy.arctan( | |
self.shearStress('defined')/ | |
self.currentNormalStress('defined'))), | |
- marker='o', c='none', s=300) | |
+ marker='o', c='none', edgecolor='blue', s=300) | |
ax.scatter(0., # actual stress | |
numpy.degrees(numpy.arctan( | |
self.shearStress('effective')/ | |
self.currentNormalStress('effective'))), | |
- marker='+', color='k', s=300) | |
+ marker='+', color='blue', s=300) | |
ax.set_rmax(90) | |
ax.set_rticks([]) | |
t@@ -6867,14 +6867,22 @@ class sim: | |
if f_min and f_max: | |
sb.plotContacts(lower_limit=0.25, upper_limit=0.75, | |
outfolder = '../img_out/', | |
- f_min = f_min, f_max = f_max) | |
+ f_min = f_min, f_max = f_max, | |
+ title = "t = {:.2f} s, $N$ = {:.0f} kPa".format( | |
+ sb.currentTime(), | |
+ sb.currentNormalStress('defined')/1000.) | |
+ ) | |
else: | |
sb.plotContacts(lower_limit=0.25, upper_limit=0.75, | |
+ title = "t = {:.2f} s, $N$ = {:.0f} kPa".format( | |
+ sb.currentTime(), | |
+ sb.currentNormalStress('defined')/1000.), | |
outfolder = '../img_out/') | |
subprocess.call('cd ../img_out/ && ' + | |
- 'convert -quality 100 {}.*.png {}-contacts.avi'.format( | |
- self.sid, self.sid), | |
+ 'ffmpeg -sameq -i {}.%05d-contacts.png'.format(self.sid), | |
+ #'convert -quality 100 {}.*.png {}-contacts.avi'.format( | |
+ #self.sid, self.sid), | |
shell=True) | |
else: |