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:
@@ -198,14 +198,6 @@ def run_baker(X, R, S, order=2):
|
||||
# calculate values only for the simplex triangle
|
||||
phi, qlin = qlinear(X, R)
|
||||
|
||||
if [i for i in phi if i <= 0.0]:
|
||||
s = "this is not a containing simplex:\n"
|
||||
s += " X: %s\n" % X
|
||||
s += " R: %s\n" % R
|
||||
s += " phi: %s, sum(%0.4e)\n" % (phi, sum(phi))
|
||||
print >> sys.stderr, s
|
||||
raise smberror("simplex does not contain point")
|
||||
|
||||
if len(S.points) == 0:
|
||||
answer = {
|
||||
'a': None,
|
||||
|
||||
+9
-6
@@ -36,12 +36,15 @@ def exact_func_3D(X):
|
||||
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']
|
||||
def improved_answer(answer, exact, verbose=False):
|
||||
if verbose:
|
||||
print 'qlin' , answer['qlin']
|
||||
print 'error', answer['error']
|
||||
print 'final', answer['final']
|
||||
|
||||
if abs(answer['final'] - exact) <= abs(answer['qlin'] - exact):
|
||||
print ":) improved result"
|
||||
if verbose: print ":) improved result"
|
||||
return True
|
||||
else:
|
||||
print ":( damaged result"
|
||||
if verbose: print ":( damaged result"
|
||||
return False
|
||||
|
||||
Reference in New Issue
Block a user