added a bunch of random point checks

This commit is contained in:
Stephen McQuay 2010-11-01 20:19:09 -06:00
parent 8e83439a6d
commit 8c0eb66e0b

View File

@ -6,6 +6,7 @@ import numpy as np
from interp.grid.gmsh import gmsh_grid
from interp.tools import exact_func, improved_answer
from interp import bootstrap
if __name__ == '__main__':
if len(sys.argv) != 2:
@ -63,3 +64,21 @@ if __name__ == '__main__':
e = exact_func(X)
print e
print improved_answer(a, e)
sys.exit(0)
results = {True:0, False:0}
for i in xrange(1000):
X = np.random.random((1,3))[0]
try:
a = g.run_baker(X, order=2, extra_points = 10)
e = exact_func(X)
ia = improved_answer(a, e)
if not ia:
print a['final'] - e, a, e
results[ia] += 1
except Exception,e:
print >>sys.stderr, e
print >>sys.stderr, X
print results