tParticles spinning in pos. y direction are now marked with a black border - sp… | |
git clone git://src.adamsgaard.dk/sphere | |
Log | |
Files | |
Refs | |
LICENSE | |
--- | |
commit 0ae0f4649f84b60f1d8f195594629b346ca4f7af | |
parent ecfc70812628f9ac56ab817087ad15778ac88c88 | |
Author: Anders Damsgaard <[email protected]> | |
Date: Tue, 12 Mar 2013 22:07:22 +0100 | |
Particles spinning in pos. y direction are now marked with a black border | |
Diffstat: | |
M gnuplot/scripts/plotts.gp | 11 +++++++++-- | |
M python/sphere.py | 23 +++++++++++++++++++++++ | |
2 files changed, 32 insertions(+), 2 deletions(-) | |
--- | |
diff --git a/gnuplot/scripts/plotts.gp b/gnuplot/scripts/plotts.gp | |
t@@ -1,6 +1,6 @@ | |
#!/usr/bin/env gnuplot | |
# Call this script with sid and gamma variables, e.g. | |
-# $ gnuplot -e "sid='testrun'; gamma='4.3" plotts.gp | |
+# $ gnuplot -e "sid='testrun'; gamma='4.3'; xmin='0.0'; xmax='1.0'; ymin='0.0… | |
set title sid.", $\\gamma$ = ".gamma | |
t@@ -13,7 +13,14 @@ set xlabel "$\\x^1$" | |
set ylabel "$\\x^3$" | |
set cblabel "Pressure [Pa]" | |
+set xrange [xmin:xmax] | |
+set yrange [ymin:ymax] | |
+ | |
set size ratio -1 | |
-plot "../data/".sid."-ts-x1x3.txt" with circles palette fs transparent solid 0… | |
+plot "../data/".sid."-ts-x1x3.txt" with circles palette fs transparent solid 0… | |
+ "../data/".sid."-ts-x1x3-circ.txt" with circles lw 1 rgb "black" t "Pa… | |
+ "../data/".sid."-ts-x1x3-arrows.txt" using 1:2:3:4 with vectors head … | |
+ "../data/".sid."-ts-x1x3-velarrows.txt" using 1:2:3:4 with vectors he… | |
+ "../data/".sid."-ts-x1x3-slips.txt" using 1:2:3:4 with vectors head f… | |
diff --git a/python/sphere.py b/python/sphere.py | |
t@@ -1392,6 +1392,10 @@ class Spherebin: | |
daylist = [] | |
dvxlist = [] | |
dvylist = [] | |
+ # Black circle at periphery of particles with angvel[:,1] > 0.0 | |
+ cxlist = [] | |
+ cylist = [] | |
+ crlist = [] | |
# Loop over all particles, find intersections | |
for i in range(self.np): | |
t@@ -1413,6 +1417,12 @@ class Spherebin: | |
rmax = r_circ | |
rlist.append(r_circ) | |
+ # Store pos. and radius if it is spinning around pos. y | |
+ if (self.angvel[i,1] > 0.0): | |
+ cxlist.append(self.x[i,0]) | |
+ cylist.append(self.x[i,1]) | |
+ crlist.append(r_circ) | |
+ | |
# Store pressure | |
pval = self.p[i] | |
if (cbmax != None): | |
t@@ -1458,6 +1468,19 @@ class Spherebin: | |
if fh is not None: | |
fh.close() | |
+ # Save circle data for articles spinning with pos. y | |
+ filename = '../gnuplot/data/' + self.sid + '-ts-x1x3-circ.txt' | |
+ fh = None | |
+ try : | |
+ fh = open(filename, 'w') | |
+ | |
+ for (x, y, r) in zip(cxlist, cylist, crlist): | |
+ fh.write("{}\t{}\t{}\t{}\n".format(x, y, r)) | |
+ | |
+ finally : | |
+ if fh is not None: | |
+ fh.close() | |
+ | |
# Save angular velocity data. The arrow lengths are normalized to max.… | |
# Output format: x, y, deltax, deltay | |
# gnuplot> plot '-' using 1:2:3:4 with vectors head filled lt 2 |