diff --git a/gmsh/analyze_gmsh_output.py b/gmsh/analyze_gmsh_output.py deleted file mode 100644 index 12f6183..0000000 --- a/gmsh/analyze_gmsh_output.py +++ /dev/null @@ -1,24 +0,0 @@ -import sys -import numpy as np -from interp.tools import rms - -ORDER = 0 -EP = 1 -FINAL = 7 -EXACT = 8 - -orders = [2,3,4,5] -extras = [4,6,8,12, 16,20,32,48, 64,96,128,192, 256] - -params = ( - (2,64), - (3,64), - (4,64), - (5,64), - ) - -if __name__ == '__main__': - data = np.loadtxt(sys.argv[1]) - - for order, ep in params: - print rms([np.abs(i[FINAL] - i[EXACT]) for i in data if i[ORDER] == order and i[EP] == ep]), diff --git a/gmsh/resolution_3D.py b/gmsh/resolution_3D.py new file mode 100644 index 0000000..20a309d --- /dev/null +++ b/gmsh/resolution_3D.py @@ -0,0 +1,27 @@ +import sys +import sqlite3 +import numpy as np + +from interp.tools import rms + +con = sqlite3.connect(sys.argv[1]) +cur = con.cursor() + +orders = np.array(cur.execute('select distinct ord from results').fetchall())[:,0] +eps = np.array(cur.execute('select distinct ep from results').fetchall())[:,0] +res = np.array(cur.execute('select distinct res from results').fetchall())[:,0] + +params = ( + (2,64), + (3,64), + (4,64), + (5,64), + ) +for r in res: + for order, ep in params: + # print np.array([np.abs(i[FINAL] - i[EXACT]) for i in data if i[ORDER] == order and i[EP] == ep])), + cur_results = cur.execute('select abs(exact - final) from results where res = ? and ep = ? and ord = ?', + (int(r), int(ep),int(order))) + cur_ = np.array(cur_results.fetchall()) + print rms(np.array(cur_)), + print