fixed the 3D grid too for resolution study
This commit is contained in:
parent
ab2e6655be
commit
ae9d759788
@ -5,24 +5,24 @@ import numpy as np
|
|||||||
|
|
||||||
class rect_grid(basegrid):
|
class rect_grid(basegrid):
|
||||||
def __init__(self, xres = 5, yres = 5, zres = 5):
|
def __init__(self, xres = 5, yres = 5, zres = 5):
|
||||||
xmin = -1.0
|
xmin = 0.0
|
||||||
xmax = 1.0
|
xmax = 1.0
|
||||||
xspan = xmax - xmin
|
xspan = xmax - xmin
|
||||||
xdel = xspan / float(xres - 1)
|
xdel = xspan / float(xres - 1)
|
||||||
|
|
||||||
ymin = -1.0
|
ymin = 0.0
|
||||||
ymay = 1.0
|
ymay = 1.0
|
||||||
yspan = ymay - ymin
|
yspan = ymay - ymin
|
||||||
ydel = yspan / float(yres - 1)
|
ydel = yspan / float(yres - 1)
|
||||||
|
|
||||||
zmin = -1.0
|
zmin = 0.0
|
||||||
zmaz = 1.0
|
zmaz = 1.0
|
||||||
zspan = zmaz - zmin
|
zspan = zmaz - zmin
|
||||||
zdel = zspan / float(zres - 1)
|
zdel = zspan / float(zres - 1)
|
||||||
|
|
||||||
|
|
||||||
verts = []
|
verts = []
|
||||||
q = []
|
q = np.zeros(xres * yres * zres)
|
||||||
for x in xrange(xres):
|
for x in xrange(xres):
|
||||||
cur_x = xmin + (x * xdel)
|
cur_x = xmin + (x * xdel)
|
||||||
for y in xrange(yres):
|
for y in xrange(yres):
|
||||||
@ -30,7 +30,7 @@ class rect_grid(basegrid):
|
|||||||
for z in xrange(zres):
|
for z in xrange(zres):
|
||||||
cur_z = zmin + (z * zdel)
|
cur_z = zmin + (z * zdel)
|
||||||
verts.append([cur_x, cur_y, cur_z])
|
verts.append([cur_x, cur_y, cur_z])
|
||||||
q.append(baker_exact_3D((cur_x, cur_y, cur_z)))
|
|
||||||
basegrid.__init__(self, verts, q)
|
basegrid.__init__(self, verts, q)
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user