38 lines
806 B
Python
Executable File
38 lines
806 B
Python
Executable File
#!/usr/bin/env python
|
|
|
|
import sys
|
|
|
|
import numpy as np
|
|
|
|
import interp.bootstrap
|
|
from interp.grid.gmsh import gmsh_grid3D
|
|
from interp.tools import exact_func_3D, improved_answer, log
|
|
|
|
|
|
if __name__ == '__main__':
|
|
if len(sys.argv) != 2:
|
|
print >> sys.stderr, "usage: %s <gmsh file>" % sys.argv[0]
|
|
sys.exit(1)
|
|
|
|
g = gmsh_grid3D(sys.argv[1])
|
|
|
|
X = np.array([0.2, 0.5, 0.01])
|
|
R = g.get_containing_simplex(X)
|
|
R, S = g.get_simplex_and_nearest_points(X, 10)
|
|
# print R
|
|
# print "r", R
|
|
# print "s", S
|
|
|
|
# results = {True:0, False:0}
|
|
# for i in xrange(10):
|
|
# X = np.random.random((1,3))[0]
|
|
|
|
# a = g.run_baker(X, order = 5, extra_points = 25)
|
|
# e = exact_func_3D(X)
|
|
# ia = improved_answer(a, e)
|
|
# results[ia] += 1
|
|
|
|
# print results
|
|
# g.normalize_q()
|
|
# print g.toxml()
|