working on adding 3D baker. also starting to massage together a good baker method test (2D), and added a stub file for 3D testing

This commit is contained in:
Stephen Mardson McQuay
2010-01-29 11:56:52 -07:00
parent 961b3b7b26
commit f4b2c95cf5
5 changed files with 152 additions and 20 deletions
+14 -1
View File
@@ -35,9 +35,22 @@ if __name__ == '__main__':
print >> sys.stderr, "wrote output to %s" % options.output
errors = []
success = 0
for x in mesh_dest.points:
(final, exact) = baker.run_baker(x, mesh_source, tree, options.extra, options.verbose)
lin, error, final = baker.run_baker(x, mesh_source, tree, options.extra, options.verbose)
exact = exact_func(x[0], x[1])
if np.abs(exact - final) < np.abs(exact - lin):
success += 1
if options.verbose:
print "current point : %s" % x
print "exact : %0.4f" % exact
print "qlin : %0.4f" % lin
print "q_final : %0.4f" % final
print "qlinerr : %0.4f" % (exact - lin,)
print "q_final_err : %0.4f" % (exact - final,)
cur_error = np.abs(final - exact)
errors.append(cur_error)
print rms(errors)
print "%s of %s won" % (success, options.destination_total)