NuMRI/kalman/other/run_roukf.py

32 lines
950 B
Python
Raw Normal View History

2020-11-23 13:41:11 +01:00
from roukf.roukf import *
from navierstokes.fractionalstep import *
from navierstokes import solver
from common import utils
from dolfin import *
import sys,os
import logging
logging.getLogger().setLevel(logging.INFO)
parameters["form_compiler"]["optimize"] = True
parameters["form_compiler"]["cpp_optimize"] = True
parameters["form_compiler"]["cpp_optimize_flags"] = "-O3 -xHost -ip" if \
utils.on_cluster() else "-O3 -ffast-math -march=native"
#inpfile = '/home/yeye/Desktop/PhD/AORTA/CT_David/input/aorta_roukf.yaml'
if len(sys.argv) > 1:
if os.path.exists(sys.argv[1]):
inpfile = sys.argv[1]
print('Found input file ' + inpfile)
else:
raise Exception('Command line arg given but input file does not exist:'
' {}'.format(sys.argv[1]))
else:
print('Using default input file ' + inpfile)
#sol = solver(inpfile)
sol = solver.init(inpfile)
roukf = ROUKF(inpfile, sol)
roukf.solve()