removed old DD and DDD modules
This commit is contained in:
parent
729dac0e90
commit
0ae558f660
@ -1,55 +0,0 @@
|
|||||||
from itertools import product
|
|
||||||
|
|
||||||
import numpy as np
|
|
||||||
|
|
||||||
from interp.grid.delaunay import dgrid as basegrid
|
|
||||||
|
|
||||||
class rect_grid(basegrid):
|
|
||||||
def __init__(self, xres = 5, yres = 5):
|
|
||||||
xmin = 0.0
|
|
||||||
xmax = 1.0
|
|
||||||
xspan = xmax - xmin
|
|
||||||
xdel = xspan / float(xres - 1)
|
|
||||||
|
|
||||||
ymin = 0.0
|
|
||||||
ymay = 1.0
|
|
||||||
yspan = ymay - ymin
|
|
||||||
ydel = yspan / float(yres - 1)
|
|
||||||
|
|
||||||
|
|
||||||
verts = []
|
|
||||||
q = np.zeros( xres * yres )
|
|
||||||
for x in xrange(xres):
|
|
||||||
cur_x = xmin + (x * xdel)
|
|
||||||
for y in xrange(yres):
|
|
||||||
cur_y = ymin + (y * ydel)
|
|
||||||
verts.append([cur_x, cur_y])
|
|
||||||
|
|
||||||
basegrid.__init__(self, verts, q)
|
|
||||||
|
|
||||||
|
|
||||||
class random_grid(rect_grid):
|
|
||||||
def __init__(self, num_verts = 10):
|
|
||||||
|
|
||||||
appx_side_res = int(np.sqrt(num_verts))
|
|
||||||
delta = 1.0 / float(appx_side_res)
|
|
||||||
|
|
||||||
# load up corners:
|
|
||||||
verts = [i for i in product((0,1), repeat = 2)]
|
|
||||||
|
|
||||||
for x in xrange(1,appx_side_res):
|
|
||||||
cur_x = x * delta
|
|
||||||
for cur_y in (0, 1):
|
|
||||||
new_point = [cur_x, cur_y]
|
|
||||||
verts.append(new_point)
|
|
||||||
|
|
||||||
for y in xrange(1,appx_side_res):
|
|
||||||
cur_y = y * delta
|
|
||||||
for cur_x in (0, 1):
|
|
||||||
new_point = [cur_x, cur_y]
|
|
||||||
verts.append(new_point)
|
|
||||||
|
|
||||||
verts.extend(np.random.random((num_verts - 4*appx_side_res, 2)))
|
|
||||||
|
|
||||||
q = np.zeros(len(verts))
|
|
||||||
basegrid.__init__(self, np.array(verts), q)
|
|
@ -1,73 +0,0 @@
|
|||||||
from itertools import product
|
|
||||||
|
|
||||||
import numpy as np
|
|
||||||
|
|
||||||
from interp.grid.delaunay import dgrid as basegrid
|
|
||||||
|
|
||||||
class rect_grid(basegrid):
|
|
||||||
def __init__(self, xres = 5, yres = 5, zres = 5):
|
|
||||||
xmin = 0.0
|
|
||||||
xmax = 1.0
|
|
||||||
xspan = xmax - xmin
|
|
||||||
xdel = xspan / float(xres - 1)
|
|
||||||
|
|
||||||
ymin = 0.0
|
|
||||||
ymay = 1.0
|
|
||||||
yspan = ymay - ymin
|
|
||||||
ydel = yspan / float(yres - 1)
|
|
||||||
|
|
||||||
zmin = 0.0
|
|
||||||
zmaz = 1.0
|
|
||||||
zspan = zmaz - zmin
|
|
||||||
zdel = zspan / float(zres - 1)
|
|
||||||
|
|
||||||
verts = []
|
|
||||||
q = np.zeros(xres * yres * zres)
|
|
||||||
for x in xrange(xres):
|
|
||||||
cur_x = xmin + (x * xdel)
|
|
||||||
for y in xrange(yres):
|
|
||||||
cur_y = ymin + (y * ydel)
|
|
||||||
for z in xrange(zres):
|
|
||||||
cur_z = zmin + (z * zdel)
|
|
||||||
verts.append([cur_x, cur_y, cur_z])
|
|
||||||
|
|
||||||
basegrid.__init__(self, verts, q)
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class random_grid(rect_grid):
|
|
||||||
def __init__(self, num_verts = 100):
|
|
||||||
verts = []
|
|
||||||
|
|
||||||
appx_side_res = int(np.power(num_verts, 1/3.0))
|
|
||||||
delta = 1.0 / float(appx_side_res)
|
|
||||||
|
|
||||||
# populate all corners
|
|
||||||
verts = [i for i in product((0,1), repeat = 3)]
|
|
||||||
|
|
||||||
|
|
||||||
# populate the edges (bottom and top squares)
|
|
||||||
for z in (0,1):
|
|
||||||
for x in xrange(1, appx_side_res):
|
|
||||||
cur_x = x * delta
|
|
||||||
for cur_y in (0, 1):
|
|
||||||
new_point = [cur_x, cur_y, z]
|
|
||||||
verts.append(new_point)
|
|
||||||
|
|
||||||
for y in xrange(1, appx_side_res):
|
|
||||||
cur_y = y * delta
|
|
||||||
for cur_x in (0, 1):
|
|
||||||
new_point = [cur_x, cur_y, z]
|
|
||||||
verts.append(new_point)
|
|
||||||
|
|
||||||
# populate side edges
|
|
||||||
for x in (0,1):
|
|
||||||
for y in (0,1):
|
|
||||||
for z in xrange(1, appx_side_res):
|
|
||||||
cur_z = z * delta
|
|
||||||
verts.append((x,y,cur_z))
|
|
||||||
|
|
||||||
verts.extend(np.random.random((num_verts - 12 * appx_side_res, 3)))
|
|
||||||
|
|
||||||
q = np.zeros(len(verts))
|
|
||||||
basegrid.__init__(self, np.array(verts), q)
|
|
Loading…
Reference in New Issue
Block a user