added a 3d gmsh test script

This commit is contained in:
Stephen Mardson McQuay 2010-11-01 15:51:40 -06:00
parent 81f1c6557a
commit 17b22c173d

33
bin/parse_gmsh3D.py Executable file
View File

@ -0,0 +1,33 @@
#!/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
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)
print R
R, S = g.get_simplex_and_nearest_points(X, 10)
print "r", R
print "s", S
for i in xrange(10):
X = np.array([0.2,0.5,0.01])#np.random.random((1,3))
a = g.run_baker(X)
print a
e = exact_func_3D(X)
print e
print improved_answer(a, e)