Introduction
Introduction Statistics Contact Development Disclaimer Help
tnon-menber render function now includes method - sphere - GPU-based 3D discret…
git clone git://src.adamsgaard.dk/sphere
Log
Files
Refs
LICENSE
---
commit 899a4b3ab67eb7a7176c4c6f924fbd912d6f06f6
parent 8bf2eda369d9fd13867a232cfdc0abf28f92bb08
Author: Anders Damsgaard <[email protected]>
Date: Thu, 29 Nov 2012 10:42:13 +0100
non-menber render function now includes method
Diffstat:
M python/sphere.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
---
diff --git a/python/sphere.py b/python/sphere.py
t@@ -1019,6 +1019,8 @@ def convert(graphicsformat = "png",
def render(binary,
+ method = "pres",
+ max_val = 1e3,
graphicsformat = 'png',
verbose=True):
'Render target binary using the sphere raytracer.'
t@@ -1028,7 +1030,9 @@ def render(binary,
quiet = "-q"
# Render images using sphere raytracer
- subprocess.call("cd ..; ./sphere_* " + quiet + " -r " + binary, shell=True)
+ subprocess.call("cd ..; ./sphere_* " + quiet + \
+ " --method " + method + " {}".format(max_val) \
+ " --render " + binary, shell=True)
# Convert images to compressed format
t@@ -1174,11 +1178,13 @@ def visualize(project, method = 'energy', savefig = Tr…
wvel = numpy.zeros((lastfile+1)*sb.nw[0], dtype=numpy.fl…
wpos = numpy.zeros((lastfile+1)*sb.nw[0], dtype=numpy.fl…
wdevs = numpy.zeros((lastfile+1)*sb.nw[0], dtype=numpy.fl…
+ maxpos = numpy.zeros((lastfile+1), dtype=numpy.float64)
wforce[i] = sb.w_force[0]
wvel[i] = sb.w_vel[0]
wpos[i] = sb.w_x[0]
wdevs[i] = sb.w_devs[0]
+ maxpos[i] = numpy.max(sb.x[:,2]+sb.radius)
t = numpy.linspace(0.0, sb.time_current, lastfile+1)
t@@ -1187,7 +1193,9 @@ def visualize(project, method = 'energy', savefig = True…
ax1 = plt.subplot2grid((2,2),(0,0))
ax1.set_xlabel('Time [s]')
ax1.set_ylabel('Position [m]')
- ax1.plot(t, wpos, '+-')
+ ax1.plot(t, wpos, '+-', label="upper wall")
+ ax1.plot(t, maxpos, '+-', label="heighest particle")
+ ax1.legend()
ax2 = plt.subplot2grid((2,2),(0,1))
ax2.set_xlabel('Time [s]')
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.