aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdrian Kummerlaender2019-06-25 20:19:20 +0200
committerAdrian Kummerlaender2019-06-25 20:19:20 +0200
commit8a229d3f21e8393e5bea30e25e7579410caa9037 (patch)
tree1fa31c187f322258d5ea232b2c01bb5932145163
parentb248d1f42dce8c294cb7056b19ad8f6b2acfc58f (diff)
downloadsymlbm_playground-8a229d3f21e8393e5bea30e25e7579410caa9037.tar
symlbm_playground-8a229d3f21e8393e5bea30e25e7579410caa9037.tar.gz
symlbm_playground-8a229d3f21e8393e5bea30e25e7579410caa9037.tar.bz2
symlbm_playground-8a229d3f21e8393e5bea30e25e7579410caa9037.tar.lz
symlbm_playground-8a229d3f21e8393e5bea30e25e7579410caa9037.tar.xz
symlbm_playground-8a229d3f21e8393e5bea30e25e7579410caa9037.tar.zst
symlbm_playground-8a229d3f21e8393e5bea30e25e7579410caa9037.zip
Fix LDC 3D x-z-plane plot
-rw-r--r--ldc_3d.py16
1 files changed, 8 insertions, 8 deletions
diff --git a/ldc_3d.py b/ldc_3d.py
index 34b5136..9149cbc 100644
--- a/ldc_3d.py
+++ b/ldc_3d.py
@@ -32,26 +32,26 @@ def generate_moment_plots(lattice, moments):
velocity = numpy.ndarray(shape=tuple(reversed(lattice.geometry.inner_size())))
# extract x-z-plane
- y = lattice.geometry.size_y//2
+ y_slice = lattice.geometry.size_y//2
for z, x in numpy.ndindex(lattice.geometry.size_z-2, lattice.geometry.size_x-2):
- gid = lattice.gid(x+1,y,z+1)
- velocity[z,y,x] = numpy.sqrt(m[1,gid]**2 + m[2,gid]**2 + m[3,gid]**2)
+ gid = lattice.gid(x+1,y_slice,z+1)
+ velocity[z,y_slice,x] = numpy.sqrt(m[1,gid]**2 + m[2,gid]**2 + m[3,gid]**2)
# extract y-z-plane
- x = lattice.geometry.size_x//2
+ x_slice = lattice.geometry.size_x//2
for z, y in numpy.ndindex(lattice.geometry.size_z-2, lattice.geometry.size_y-2):
- gid = lattice.gid(x,y+1,z+1)
- velocity[z,y,x] = numpy.sqrt(m[1,gid]**2 + m[2,gid]**2 + m[3,gid]**2)
+ gid = lattice.gid(x_slice,y+1,z+1)
+ velocity[z,y,x_slice] = numpy.sqrt(m[1,gid]**2 + m[2,gid]**2 + m[3,gid]**2)
plt.figure(figsize=(20, 10))
# plot x-z-plane
plt.subplot(1, 2, 1)
- plt.imshow(velocity[:,y,:], origin='lower', vmin=0.0, vmax=0.15, cmap=plt.get_cmap('seismic'))
+ plt.imshow(velocity[:,y_slice,:], origin='lower', vmin=0.0, vmax=0.15, cmap=plt.get_cmap('seismic'))
# plot y-z-plane
plt.subplot(1, 2, 2)
- plt.imshow(velocity[:,:,x], origin='lower', vmin=0.0, vmax=0.15, cmap=plt.get_cmap('seismic'))
+ plt.imshow(velocity[:,:,x_slice], origin='lower', vmin=0.0, vmax=0.15, cmap=plt.get_cmap('seismic'))
plt.savefig("result/ldc_3d_%02d.png" % i, bbox_inches='tight', pad_inches=0)