trying to guarantee a containing simplex

This commit is contained in:
Stephen Mardson McQuay
2010-04-23 09:58:30 -06:00
parent 79880acad4
commit 0a388ff1b5
4 changed files with 24 additions and 13 deletions
+10
View File
@@ -35,3 +35,13 @@ def exact_func_3D(X):
y = X[1]
z = X[2]
return np.power((np.sin(x * np.pi / 2.0) * np.sin(y * np.pi / 2.0) * np.sin(z * np.pi / 2.0)), 2)
def evaluate_answer(answer, exact):
print 'qlin' , answer['qlin']
print 'error', answer['error']
print 'final', answer['final']
if abs(answer['final'] - exact) <= abs(answer['qlin'] - exact):
print ":) improved result"
else:
print ":( damaged result"
+5 -1
View File
@@ -54,7 +54,9 @@ class grid(object):
"""
this returns two grid objects: R and S.
R is a grid object that is the (a) containing simplex around point X
R is a grid object that is supposedly a containing simplex
around point X (it tends not to be)
S is S_j from baker's paper : some points from all point that are not the simplex
"""
(dist, indicies) = self.tree.query(X, simplex_size + extra_points)
@@ -78,6 +80,8 @@ class grid(object):
points near a short edge in a boundary layer cell where the
nearest points would all be colinear
also, it guarantees that we find a containing simplex
R is a grid object that is the (a) containing simplex around point X
S is a connectivity-based nearest-neighbor lookup, limited to 3 extra points
"""