added an extra option
This commit is contained in:
parent
854545a92b
commit
0edc8c192e
@ -27,12 +27,13 @@ def get_mesh(source, destination, use_structured_grid = False):
|
||||
|
||||
if __name__ == '__main__':
|
||||
parser = OptionParser()
|
||||
|
||||
parser.add_option("-o",
|
||||
"--output-file",
|
||||
dest="output",
|
||||
type='str',
|
||||
default = '/tmp/for_qhull.txt',
|
||||
help = "qhull output file")
|
||||
"--order",
|
||||
dest="order",
|
||||
type='int',
|
||||
default = 3,
|
||||
help = "how many extra verts (%default)")
|
||||
|
||||
parser.add_option("-e",
|
||||
"--extra-verts",
|
||||
@ -72,19 +73,16 @@ if __name__ == '__main__':
|
||||
|
||||
(mesh_source, mesh_dest) = get_mesh(options.source_total, options.destination_total, options.structured)
|
||||
|
||||
open(options.output, 'w').write(mesh_source.for_qhull())
|
||||
if options.verbose:
|
||||
print >> sys.stderr, "options: %s, args: %s" % (options, args)
|
||||
print >> sys.stderr, "wrote source mesh output to %s" % options.output
|
||||
|
||||
errors = []
|
||||
success = 0
|
||||
|
||||
for X in mesh_dest.verts:
|
||||
|
||||
answer = mesh_source.run_baker(X)
|
||||
answer = mesh_source.run_baker(X, order = options.order, extra_points = options.extra)
|
||||
|
||||
if answer['abc'] == None:
|
||||
print "None"
|
||||
errors.append(0)
|
||||
continue
|
||||
|
||||
@ -97,8 +95,9 @@ if __name__ == '__main__':
|
||||
print "exact : %0.4f" % exact
|
||||
print "qlin : %0.4f" % answer['qlin']
|
||||
print "q_final : %0.4f" % answer['final']
|
||||
print "qlinerr : %1.4f" % (exact - answer['qlin'],)
|
||||
print "q_final_err : %0.4f" % (exact - answer['final'],)
|
||||
print "error w/o : %1.4f" % (exact - answer['qlin'],)
|
||||
print "error w/ : %0.4f" % (exact - answer['final'],)
|
||||
print
|
||||
cur_error = np.abs(answer['final'] - exact)
|
||||
errors.append(cur_error)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user