smbinterp/gmsh/analyze_gmsh_output.py

25 lines
458 B
Python
Raw Normal View History

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