tAdded thin-section visualization method - 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 efc573bf0e26854a149080670227281e4480bb72
(DIR) parent 6db1e3d5a77e6c1b2532bb02fd07e77892904145
(HTM) Author: Anders Damsgaard <adc@geo.au.dk>
Date: Thu, 10 Jan 2013 13:01:56 +0100
Added thin-section visualization method
Diffstat:
A gnuplot/scripts/plotts.gp | 19 +++++++++++++++++++
M python/sphere.py | 10 +++++-----
2 files changed, 24 insertions(+), 5 deletions(-)
---
(DIR) diff --git a/gnuplot/scripts/plotts.gp b/gnuplot/scripts/plotts.gp
t@@ -0,0 +1,19 @@
+#!/usr/bin/env gnuplot
+# Call this script with sid and gamma variables, e.g.
+# $ gnuplot -e "sid='testrun'; gamma='4.3" plotts.gp
+
+set title sid.", $\\gamma$ = ".gamma
+
+set term pngcairo size 50 cm,40 cm
+set out "../../img_out/".sid."-ts-x1x3.png"
+
+set palette defined (0 "blue", 0.5 "gray", 1 "red")
+
+set xlabel "$\\x^1$"
+set ylabel "$\\x^3$"
+set cblabel "Pressure [Pa]"
+
+set size ratio -1
+
+plot "../data/".sid."-ts-x1x3.txt" with circles palette fs transparent solid 0.4 noborder t "Particle", "../data/".sid."-ts-x1x3-arrows.txt" using 1:2:3:4 with vectors head filled lt 2 lc rgb "black" t "Rotation", "../data/".sid."-ts-x1x3-slips.txt" using 1:2:3:4 with vectors head filled lt 2 t 'Slip'
+
(DIR) diff --git a/python/sphere.py b/python/sphere.py
t@@ -1118,7 +1118,7 @@ class Spherebin:
print("Value limited to: " + str(cbmax) + " Pa")
# Save circle data
- filename = '../gnuplot/data' + self.sid + '-ts-x1x3.txt'
+ filename = '../gnuplot/data/' + self.sid + '-ts-x1x3.txt'
fh = None
try :
fh = open(filename, 'w')
t@@ -1133,7 +1133,7 @@ class Spherebin:
# Save angular velocity data. The arrow lengths are normalized to max. radius
# Output format: x, y, deltax, deltay
# gnuplot> plot '-' using 1:2:3:4 with vectors head filled lt 2
- filename = '../gnuplot/data' + self.sid + '-ts-x1x3-arrows.txt'
+ filename = '../gnuplot/data/' + self.sid + '-ts-x1x3-arrows.txt'
fh = None
try :
fh = open(filename, 'w')
t@@ -1208,7 +1208,7 @@ class Spherebin:
# Write slip lines to text file
- filename = '../gnuplot/data' + self.sid + '-ts-x1x3-slips.txt'
+ filename = '../gnuplot/data/' + self.sid + '-ts-x1x3-slips.txt'
fh = None
try :
fh = open(filename, 'w')
t@@ -1222,7 +1222,7 @@ class Spherebin:
# Plot thinsection with gnuplot script
gamma = self.shearstrain()
- subprocess.call("""gnuplot -e "sid='{}'; gamma='{:.3}'" ../gnuplot/scripts/plotts.gp""".format(self.sid, self.shearstrain()), shell=True)
+ subprocess.call("""cd ../gnuplot/scripts && gnuplot -e "sid='{}'; gamma='{:.3}'" plotts.gp""".format(self.sid, self.shearstrain()), shell=True)
# Find all particles who have a slip velocity higher than slipvel
slipvellimit = 0.01
t@@ -1243,7 +1243,7 @@ class Spherebin:
fig = plt.figure()
ax = fig.add_subplot(111, polar=True)
ax.bar(center_ang_mirr, hist_ang_mirr, width=30.0/180.0)
- fig.savefig('../gnuplot/data' + self.sid + '-ts-x1x3-slipangles.png')
+ fig.savefig('../img_out/' + self.sid + '-ts-x1x3-slipangles.png')
fig.clf()