fixed a little bug and getting good results again. still will have problems if you try to simply get a linear interpolation

This commit is contained in:
Stephen Mardson McQuay
2010-01-31 21:10:37 -07:00
parent 2113abb8dc
commit 0f4daa9a9c
3 changed files with 21 additions and 6 deletions
+14 -5
View File
@@ -93,7 +93,7 @@ def qlinear_3D(X, R, q):
qlin = sum([q_i * phi_i for q_i, phi_i in zip(q, phis)])
return qlin
def run_baker(X, R, S, extra_points = 3, verbose = False):
def run_baker(X, R, S, verbose = False):
"""
This is the main function to call to get an interpolation to X from the tree
@@ -107,10 +107,19 @@ def run_baker(X, R, S, extra_points = 3, verbose = False):
"""
# calculate values only for the triangle
phi = get_phis(X, S.points)
qlin = qlinear (X, S.points, S.q)
phi = get_phis(X, R.points)
qlin = qlinear (X, R.points, R.q)
if extra_points == 0: return qlin
if len(S.points) == 0:
answer = {
'a': None,
'b': None,
'c': None,
'qlin': qlin,
'error': None,
'final': None,
}
return answer
B = [] # baker eq 9
w = [] # baker eq 11
@@ -147,6 +156,6 @@ def run_baker(X, R, S, extra_points = 3, verbose = False):
'qlin': qlin,
'error': error_term,
'final': q_final,
}
}
return answer