better name

--HG--
rename : gmsh/analyze_gmsh_output.py => gmsh/resolution_3D.py
This commit is contained in:
Stephen McQuay 2011-05-26 21:23:33 -06:00
parent bc976ffc56
commit 3070b9de69
2 changed files with 27 additions and 24 deletions

View File

@ -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]),

27
gmsh/resolution_3D.py Normal file
View File

@ -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