partially implemented using new data structure in point lookup
I spoke with Dr. Gorrell about first trying to call the nearest-neighbor routine, releasing the trapped exception where the matrix ends up being singular, and trapping it in the grid object's run_baker, where I could then call the connectivity-based lookup routine. Those are my next steps, as well as starting to think about pushing the 3D front ahead this week.
This commit is contained in:
+18
-11
@@ -10,19 +10,26 @@ qfile = '/tmp/grid_regular.txt'
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
resolution = int(sys.argv[1])
|
||||
if resolution > 200:
|
||||
raise Exception
|
||||
except:
|
||||
resolution = 3
|
||||
|
||||
source_mesh = simple_rect_grid(resolution, resolution)
|
||||
X = [0.4, 0.001]
|
||||
(R, S) = source_mesh.get_points_conn(X)
|
||||
rx = int(sys.argv[1])
|
||||
ry = int(sys.argv[2])
|
||||
except ValueError as e:
|
||||
print e
|
||||
rx = 4
|
||||
ry = 4 * rx
|
||||
|
||||
source_mesh = simple_rect_grid(rx, ry)
|
||||
print source_mesh
|
||||
print R
|
||||
print S
|
||||
|
||||
X = [0.1, 0.1]
|
||||
|
||||
(R, S) = source_mesh.get_simplex_and_nearest_points(X, extra_points=4)
|
||||
print "R for nearest-neighbor:\n", R
|
||||
print "S for nearest-neighbor:\n", S
|
||||
print run_baker(X, R, S)
|
||||
|
||||
(R, S) = source_mesh.get_points_conn(X)
|
||||
print "R for connectivity:\n", R
|
||||
print "S for connectivity:\n", S
|
||||
print run_baker(X, R, S)
|
||||
|
||||
open(qfile, 'w').write(source_mesh.for_qhull())
|
||||
|
||||
Reference in New Issue
Block a user