working on the guarantee simplex routine. I have a test case to try it out against, and need to look at visiting neighbors of faces adjacent to points.

This commit is contained in:
Stephen Mardson McQuay
2010-04-23 16:29:31 -06:00
parent 0a388ff1b5
commit cfcd1e15a2
12 changed files with 11081 additions and 19 deletions
+6 -1
View File
@@ -7,7 +7,7 @@ import scipy.spatial
from baker import run_baker
from baker.tools import exact_func, smberror
from simplex import face
from simplex import face, contains
from smcqdelaunay import *
@@ -49,6 +49,9 @@ class grid(object):
q = [self.q[i] for i in indicies]
return grid(p, q)
def get_containing_simplex(self, X):
pass
def get_simplex_and_nearest_points(self, X, extra_points = 3, simplex_size = 3):
"""
@@ -115,6 +118,8 @@ class grid(object):
try:
(R, S) = self.get_simplex_and_nearest_points(X)
if not contains(X, R.points):
raise smberror("run_baker with get_simplex_and_nearest_points returned non-containing simplex")
answer = run_baker(X, R, S)
except smberror, e:
print >> sys.stderr, "caught error: %s, trying with connectivity-based mesh" % e
+15
View File
@@ -0,0 +1,15 @@
def parse_qhull_file(filename, verbose=False):
f = open(filename, 'r')
if verbose:
print 'filename: ', filename
degree = int(f.readline().strip())
print "degree:", degree
print "number of points", f.readline().strip()
verts = []
for p in f:
v = [float(i) for i in p.strip().split()]
verts.append(v)
return verts