# Path: ffthompy/general/base.py
# def get_base_dir():
#     module_dir = os.path.dirname(os.path.abspath(__file__))
#     base_dir = os.path.normpath(os.path.join(module_dir, '../..'))
#     return base_dir
# 
# class Timer():
#     def __init__(self, name='time', start=True):
#         self.name = name
#         if start:
#             self.start()
# 
#     def start(self):
#         self.vals = []
#         self.ttin = [time.process_time(), time.clock(), time.time()]
# 
#     def measure(self, print_time=True):
#         self.vals.append([time.process_time()-self.ttin[0],
#                           time.clock()-self.ttin[1],
#                           time.time()-self.ttin[2]])
#         if print_time:
#             print(self)
# 
#     def __repr__(self):
#         return 'time (%s): %s' % (self.name, str(self.vals))


import numpy as np
import ffthompy.applications
import os
import sys
            import pickle
from ffthompy.general.base import get_base_dir, Timer
from copy import deepcopy
        """
        Parse material from input file.
        """
        if 'fun' in conf_material:
            material = conf_material
        else:
            material = conf_material
            for incl in material['inclusions']:
                if incl in ['all', 'otherwise']:
                    n_incl = material['inclusions'].count(incl)
                    if n_incl == 0:
                        continue
                    elif n_incl == 1:
                        ind = material['inclusions'].index(incl)
                        if ind == material['inclusions'].__len__() - 1:
                            continue
                        else:
                            msg='inclusion ("all" or "otherwise") has to be at the end of the list'
                            raise ValueError(msg)
                    else:
                        msg = "Maximal one occurrence of inclusion \
                            'otherwise' or 'all' is allowed!"
                        raise ValueError(msg)
        return material

    def calculate(self):
        """
        Calculates the problem according to physical model.
        """
        print('\n==============================')

# Path: ffthompy/general/base.py
# def get_base_dir():
#     module_dir = os.path.dirname(os.path.abspath(__file__))
#     base_dir = os.path.normpath(os.path.join(module_dir, '../..'))
#     return base_dir
# 
# class Timer():
#     def __init__(self, name='time', start=True):
#         self.name = name
#         if start:
#             self.start()
# 
#     def start(self):
#         self.vals = []
#         self.ttin = [time.process_time(), time.clock(), time.time()]
# 
#     def measure(self, print_time=True):
#         self.vals.append([time.process_time()-self.ttin[0],
#                           time.clock()-self.ttin[1],
#                           time.time()-self.ttin[2]])
#         if print_time:
#             print(self)
# 
#     def __repr__(self):
#         return 'time (%s): %s' % (self.name, str(self.vals))


# Path: ffthompy/problem.py
import numpy as np
import ffthompy.applications
import os
import sys
            import pickle
from ffthompy.general.base import get_base_dir, Timer
from copy import deepcopy

        """
        Parse material from input file.
        """
        if 'fun' in conf_material:
            material = conf_material
        else:
            material = conf_material
            for incl in material['inclusions']:
                if incl in ['all', 'otherwise']:
                    n_incl = material['inclusions'].count(incl)
                    if n_incl == 0:
                        continue
                    elif n_incl == 1:
                        ind = material['inclusions'].index(incl)
                        if ind == material['inclusions'].__len__() - 1:
                            continue
                        else:
                            msg='inclusion ("all" or "otherwise") has to be at the end of the list'
                            raise ValueError(msg)
                    else:
                        msg = "Maximal one occurrence of inclusion \
                            'otherwise' or 'all' is allowed!"
                        raise ValueError(msg)
        return material

    def calculate(self):
        """
        Calculates the problem according to physical model.
        """
        print('\n==============================')

        tim = Timer(name='application')