Stephen Mardson McQuay
3070b9de69
--HG-- rename : gmsh/analyze_gmsh_output.py => gmsh/resolution_3D.py
28 lines
876 B
Python
28 lines
876 B
Python
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
|