31 lines
743 B
Python
31 lines
743 B
Python
|
import sys
|
||
|
import logging
|
||
|
import os.path
|
||
|
from dolfin import *
|
||
|
from dPdirectestim.dPdirectestim import *
|
||
|
|
||
|
|
||
|
logging.getLogger().setLevel(logging.INFO)
|
||
|
#set_log_level(PROGRESS)
|
||
|
|
||
|
parameters['form_compiler']['optimize'] = True
|
||
|
parameters['form_compiler']['cpp_optimize'] = True
|
||
|
parameters['form_compiler']['cpp_optimize_flags'] = \
|
||
|
'-O3 -ffast-math -march=native'
|
||
|
|
||
|
if len(sys.argv) > 1 and os.path.exists(sys.argv[1]):
|
||
|
inpfile = sys.argv[1]
|
||
|
print('Found input file ' + inpfile)
|
||
|
else:
|
||
|
raise Exception('No input file given')
|
||
|
|
||
|
estimator = DPDirectEstim(inpfile)
|
||
|
|
||
|
estimator.estimate()
|
||
|
|
||
|
|
||
|
if '2019' in dolfin.__version__:
|
||
|
list_timings(TimingClear.clear, [TimingType.wall])
|
||
|
else:
|
||
|
list_timings(TimingClear_clear, [TimingType_wall])
|