예제 #1
0
 def __init__(self,
              interaction,
              symmetry,
              sigmas=[0.1],
              asigma_step =1,
              temperatures=None,
              mesh_divisors=None,
              coarse_mesh_shifts=None,
              grid_points=None,
              cutoff_lifetime=1e-4,  # in second
              diff_kappa = 1e-3,  #  W/m-K
              nu=None,  # is Normal or Umklapp
              no_kappa_stars=False,
              gv_delta_q=1e-4,  # finite difference for group velocity
              log_level=0,
              write_tecplot=False,
              kappa_write_step=None,
              is_thm=False,
              filename=None):
     Conductivity.__init__(self,
                           interaction,
                           symmetry,
                           grid_points=grid_points,
                           temperatures=temperatures,
                           sigmas=sigmas,
                           mesh_divisors=mesh_divisors,
                           coarse_mesh_shifts=coarse_mesh_shifts,
                           no_kappa_stars=no_kappa_stars,
                           gv_delta_q=gv_delta_q,
                           log_level=log_level,
                           write_tecplot=write_tecplot)
     self._ise = ImagSelfEnergy(self._pp, nu, is_thm=is_thm, cutoff_lifetime= cutoff_lifetime)
     self._max_sigma_step=asigma_step
     self._is_asigma = False if asigma_step==1 else True
     self._sigma_iteration_step = 0
     self._nu=nu
     self._filename = filename
     if asigma_step > 1:
         if self._filename is not None:
             self._filename ="-adapt" + self._filename
         else:
             self._filename = "-adapt"
     self._cutoff_lifetime = cutoff_lifetime
     self._diff_kappa = diff_kappa
     self._is_converge = None
     if self._no_kappa_stars:
         self._kpoint_operations = np.eye(3,dtype="intc")
     else:
         self._kpoint_operations = get_pointgroup_operations(
             self._pp.get_point_group_operations())
     self._gamma_N = [None] * len(sigmas)
     self._gamma_U = [None]*len(sigmas)
     self._read_f = False
     self._read_gv = False
     self._cv = None
     self._wstep=kappa_write_step
     self._sum_num_kstar = 0
     self._scale_bar = 0
     if temperatures is not None:
         self._allocate_values()
예제 #2
0
    def __init__(self,
                 interaction,
                 symmetry=None,
                 sigmas=[0.2],
                 grid_points=None,
                 temperatures=None,
                 adaptive_sigma_step=1,
                 no_kappa_stars=False,
                 gv_delta_q=None,
                 mass_variances=None,
                 length=None,
                 write_gamma=False,
                 read_gamma=False,
                 read_col=False,
                 write_col=False,
                 log_level=1,
                 is_thm=False,
                 filename="ite",
                 lang="C",
                 write_tecplot=False):
        self._pp = interaction
        self._log_level = log_level
        self._read_gamma = read_gamma
        self._write_gamma = write_gamma
        self._lang = lang
        self._is_adaptive_sigma = False if adaptive_sigma_step == 0 else True
        self._max_asigma_step = adaptive_sigma_step
        Conductivity.__init__(self,
                              interaction,
                              symmetry,
                              grid_points=grid_points,
                              temperatures=temperatures,
                              sigmas=sigmas,
                              no_kappa_stars=no_kappa_stars,
                              gv_delta_q=gv_delta_q,
                              log_level=log_level,
                              write_tecplot=write_tecplot)
        self._scale_bar = 0
        self._itemp = None  # index of temperature
        self._temp = None
        self._collision = Collision(interaction,
                                    sigmas=self._sigmas,
                                    temperatures=self._temperatures,
                                    is_adaptive_sigma=self._is_adaptive_sigma,
                                    mass_variances=mass_variances,
                                    length=length,
                                    write=write_col,
                                    read=read_col,
                                    is_tetrahedron_method=is_thm,
                                    cutoff_frequency=self._cutoff_frequency)

        self._is_write_col = write_col
        self._is_read_col = read_col
        self._allocate_values()
        if filename is not None:
            self._filename = filename
        else:
            self._filename = "dinv"
예제 #3
0
    def __init__(self,
                 interaction,
                 symmetry,
                 grid_points=None,
                 temperatures=np.arange(0, 1001, 10, dtype='double'),
                 sigmas=[],
                 is_isotope=False,
                 mass_variances=None,
                 boundary_mfp=None, # in micrometre
                 use_averaged_pp_interaction=False,
                 gamma_unit_conversion=None,
                 mesh_divisors=None,
                 coarse_mesh_shifts=None,
                 no_kappa_stars=False,
                 gv_delta_q=None, # finite difference for group veolocity
                 log_level=0):

        self._pp = None
        self._temperatures = None
        self._sigmas = None
        self._no_kappa_stars = None
        self._gv_delta_q = None
        self._log_level = None
        self._primitive = None
        self._dm = None
        self._frequency_factor_to_THz = None
        self._cutoff_frequency = None
        self._boundary_mfp = None

        self._symmetry = None
        self._point_operations = None
        self._rotations_cartesian = None
        
        self._grid_points = None
        self._grid_weights = None
        self._grid_address = None

        self._read_gamma = False
        self._read_gamma_iso = False

        self._frequencies = None
        self._gv = None
        self._gamma = None
        self._gamma_iso = None
        self._gamma_unit_conversion = gamma_unit_conversion
        self._use_ave_pp = use_averaged_pp_interaction
        self._averaged_pp_interaction = None
        self._num_ignored_phonon_modes = None
        self._num_sampling_grid_points = None
        
        self._mesh = None
        self._mesh_divisors = None
        self._coarse_mesh = None
        self._coarse_mesh_shifts = None
        self._conversion_factor = None

        self._is_isotope = None
        self._isotope = None
        self._mass_variances = None
        self._grid_point_count = None

        Conductivity.__init__(self,
                              interaction,
                              symmetry,
                              grid_points=grid_points,
                              temperatures=temperatures,
                              sigmas=sigmas,
                              is_isotope=is_isotope,
                              mass_variances=mass_variances,
                              mesh_divisors=mesh_divisors,
                              coarse_mesh_shifts=coarse_mesh_shifts,
                              boundary_mfp=boundary_mfp,
                              no_kappa_stars=no_kappa_stars,
                              gv_delta_q=gv_delta_q,
                              log_level=log_level)

        self._cv = None

        if self._temperatures is not None:
            self._allocate_values()
예제 #4
0
    def __init__(self,
                 interaction,
                 symmetry,
                 grid_points=None,
                 temperatures=None,
                 sigmas=None,
                 is_isotope=False,
                 mass_variances=None,
                 boundary_mfp=None, # in micrometre
                 is_reducible_collision_matrix=False,
                 no_kappa_stars=False,
                 gv_delta_q=None, # finite difference for group veolocity
                 pinv_cutoff=1.0e-8,
                 log_level=0):
        if sigmas is None:
            sigmas = []
        self._pp = None
        self._temperatures = None
        self._sigmas = None
        self._no_kappa_stars = None
        self._gv_delta_q = None
        self._log_level = None
        self._primitive = None
        self._dm = None
        self._frequency_factor_to_THz = None
        self._cutoff_frequency = None
        self._boundary_mfp = None

        self._symmetry = None
        self._point_operations = None
        self._rotations_cartesian = None
        
        self._grid_points = None
        self._grid_weights = None
        self._grid_address = None
        self._ir_grid_points = None
        self._ir_grid_weights = None

        self._gamma = None
        self._read_gamma = False
        self._read_gamma_iso = False
        self._frequencies = None
        self._gv = None
        self._gamma_iso = None
        self._averaged_pp_interaction = None
        
        self._mesh = None
        self._coarse_mesh = None
        self._coarse_mesh_shifts = None
        self._conversion_factor = None
        
        self._is_isotope = None
        self._isotope = None
        self._mass_variances = None
        self._grid_point_count = None

        self._collision_eigenvalues = None

        Conductivity.__init__(self,
                              interaction,
                              symmetry,
                              grid_points=grid_points,
                              temperatures=temperatures,
                              sigmas=sigmas,
                              is_isotope=is_isotope,
                              mass_variances=mass_variances,
                              boundary_mfp=boundary_mfp,
                              no_kappa_stars=no_kappa_stars,
                              gv_delta_q=gv_delta_q,
                              log_level=log_level)

        self._is_reducible_collision_matrix = is_reducible_collision_matrix
        if self._no_kappa_stars:
            self._is_reducible_collision_matrix = True
        self._collision_matrix = None
        self._pinv_cutoff = pinv_cutoff
        
        if self._temperatures is not None:
            self._allocate_values()
예제 #5
0
 def __init__(self,
              interaction,
              symmetry=None,
              sigmas=[0.2],
              grid_points=None,
              temperatures=None,
              max_ite= None,
              adaptive_sigma_step = 0,
              no_kappa_stars=False,
              diff_kappa = 1e-4, # relative
              gv_delta_q = None,
              mass_variances = None,
              length = None,
              write_gamma=False,
              read_gamma=False,
              read_col = False,
              write_col = False,
              log_level=1,
              is_thm=False,
              filename="ite",
              lang="C",
              is_precondition = True,
              write_tecplot=False):
     self._pp = interaction
     self._log_level = log_level
     self._read_gamma = read_gamma
     self._write_gamma = write_gamma
     self._lang=lang
     self._is_adaptive_sigma = False if adaptive_sigma_step == 0 else True
     self._max_asigma_step = adaptive_sigma_step
     Conductivity.__init__(self,
                           interaction,
                           symmetry,
                           grid_points=grid_points,
                           temperatures=temperatures,
                           sigmas=sigmas,
                           no_kappa_stars=no_kappa_stars,
                           gv_delta_q=gv_delta_q,
                           log_level=log_level,
                           write_tecplot=write_tecplot)
     self._scale_bar = 0
     self._itemp = None # index of temperature
     self._temp  = None
     self._is_precondition = is_precondition
     self._diff_kappa = diff_kappa
     self._collision = Collision(interaction,
                                sigmas=self._sigmas,
                                temperatures=self._temperatures,
                                is_adaptive_sigma=self._is_adaptive_sigma,
                                mass_variances=mass_variances,
                                length=length,
                                write=write_col,
                                read=read_col,
                                is_tetrahedron_method=is_thm,
                                cutoff_frequency=self._cutoff_frequency)
     self._is_write_col = write_col
     self._is_read_col = read_col
     self.ite_init()
     self._ite_num = max_ite
     self._ite_step = 0
     if filename is not None:
         self._filename = filename
     else:
         self._filename = "ite"
예제 #6
0
    def __init__(
            self,
            interaction,
            symmetry,
            grid_points=None,
            temperatures=np.arange(0, 1001, 10, dtype='double'),
            sigmas=None,
            is_isotope=False,
            mass_variances=None,
            boundary_mfp=None,  # in micrometre
            use_ave_pp=False,
            gamma_unit_conversion=None,
            mesh_divisors=None,
            coarse_mesh_shifts=None,
            is_kappa_star=True,
            gv_delta_q=None,
            run_with_g=True,
            is_full_pp=False,
            log_level=0):
        self._pp = None
        self._temperatures = None
        self._sigmas = None
        self._is_kappa_star = None
        self._gv_delta_q = None
        self._run_with_g = run_with_g
        self._is_full_pp = is_full_pp
        self._log_level = None
        self._primitive = None
        self._dm = None
        self._frequency_factor_to_THz = None
        self._cutoff_frequency = None
        self._boundary_mfp = None

        self._symmetry = None
        self._point_operations = None
        self._rotations_cartesian = None

        self._grid_points = None
        self._grid_weights = None
        self._grid_address = None

        self._read_gamma = False
        self._read_gamma_iso = False

        self._frequencies = None
        self._gv = None
        self._gamma = None
        self._gamma_iso = None
        self._gamma_unit_conversion = gamma_unit_conversion
        self._use_ave_pp = use_ave_pp
        self._averaged_pp_interaction = None
        self._num_ignored_phonon_modes = None
        self._num_sampling_grid_points = None

        self._mesh = None
        self._mesh_divisors = None
        self._coarse_mesh = None
        self._coarse_mesh_shifts = None
        self._conversion_factor = None

        self._is_isotope = None
        self._isotope = None
        self._mass_variances = None
        self._grid_point_count = None

        Conductivity.__init__(self,
                              interaction,
                              symmetry,
                              grid_points=grid_points,
                              temperatures=temperatures,
                              sigmas=sigmas,
                              is_isotope=is_isotope,
                              mass_variances=mass_variances,
                              mesh_divisors=mesh_divisors,
                              coarse_mesh_shifts=coarse_mesh_shifts,
                              boundary_mfp=boundary_mfp,
                              is_kappa_star=is_kappa_star,
                              gv_delta_q=gv_delta_q,
                              log_level=log_level)

        self._cv = None

        if self._temperatures is not None:
            self._allocate_values()
예제 #7
0
    def __init__(self,
                 interaction,
                 symmetry,
                 grid_points=None,
                 temperatures=None,
                 sigmas=None,
                 is_isotope=False,
                 mass_variances=None,
                 boundary_mfp=None, # in micrometre
                 is_reducible_collision_matrix=False,
                 is_kappa_star=True,
                 gv_delta_q=None, # finite difference for group veolocity
                 is_full_pp=False,
                 pinv_cutoff=1.0e-8,
                 log_level=0):
        if sigmas is None:
            sigmas = []
        self._pp = None
        self._temperatures = None
        self._sigmas = None
        self._is_kappa_star = None
        self._gv_delta_q = None
        self._is_full_pp = is_full_pp
        self._log_level = None
        self._primitive = None
        self._dm = None
        self._frequency_factor_to_THz = None
        self._cutoff_frequency = None
        self._boundary_mfp = None

        self._symmetry = None
        self._point_operations = None
        self._rotations_cartesian = None
        
        self._grid_points = None
        self._grid_weights = None
        self._grid_address = None
        self._ir_grid_points = None
        self._ir_grid_weights = None

        self._gamma = None
        self._read_gamma = False
        self._read_gamma_iso = False
        self._frequencies = None
        self._gv = None
        self._gamma_iso = None
        self._averaged_pp_interaction = None
        
        self._mesh = None
        self._coarse_mesh = None
        self._coarse_mesh_shifts = None
        self._conversion_factor = None
        
        self._is_isotope = None
        self._isotope = None
        self._mass_variances = None
        self._grid_point_count = None

        self._collision_eigenvalues = None

        Conductivity.__init__(self,
                              interaction,
                              symmetry,
                              grid_points=grid_points,
                              temperatures=temperatures,
                              sigmas=sigmas,
                              is_isotope=is_isotope,
                              mass_variances=mass_variances,
                              boundary_mfp=boundary_mfp,
                              is_kappa_star=is_kappa_star,
                              gv_delta_q=gv_delta_q,
                              log_level=log_level)

        self._is_reducible_collision_matrix = is_reducible_collision_matrix
        if not self._is_kappa_star:
            self._is_reducible_collision_matrix = True
        self._collision_matrix = None
        self._pinv_cutoff = pinv_cutoff
        
        if self._temperatures is not None:
            self._allocate_values()
예제 #8
0
    def __init__(
            self,
            interaction,
            symmetry,
            grid_points=None,
            temperatures=np.arange(0, 1001, 10, dtype='double'),
            sigmas=[],
            is_isotope=False,
            mass_variances=None,
            mesh_divisors=None,
            coarse_mesh_shifts=None,
            cutoff_mfp=None,  # in micrometre
            no_kappa_stars=False,
            gv_delta_q=None,  # finite difference for group veolocity
            log_level=0):

        self._pp = None
        self._temperatures = None
        self._sigmas = None
        self._no_kappa_stars = None
        self._gv_delta_q = None
        self._log_level = None
        self._primitive = None
        self._dm = None
        self._frequency_factor_to_THz = None
        self._cutoff_frequency = None
        self._cutoff_mfp = None

        self._symmetry = None
        self._point_operations = None
        self._rotations_cartesian = None

        self._grid_points = None
        self._grid_weights = None
        self._grid_address = None

        self._gamma = None
        self._read_gamma = False
        self._read_gamma_iso = False
        self._frequencies = None
        self._gv = None
        self._gamma_iso = None
        self._mean_square_pp_strength = None

        self._mesh = None
        self._mesh_divisors = None
        self._coarse_mesh = None
        self._coarse_mesh_shifts = None
        self._conversion_factor = None

        self._is_isotope = None
        self._isotope = None
        self._mass_variances = None
        self._grid_point_count = None

        Conductivity.__init__(self,
                              interaction,
                              symmetry,
                              grid_points=grid_points,
                              temperatures=temperatures,
                              sigmas=sigmas,
                              is_isotope=is_isotope,
                              mass_variances=mass_variances,
                              mesh_divisors=mesh_divisors,
                              coarse_mesh_shifts=coarse_mesh_shifts,
                              cutoff_mfp=cutoff_mfp,
                              no_kappa_stars=no_kappa_stars,
                              gv_delta_q=gv_delta_q,
                              log_level=log_level)

        self._cv = None

        if self._temperatures is not None:
            self._allocate_values()
예제 #9
0
    def __init__(self,
                 interaction,
                 symmetry,
                 grid_points=None,
                 temperatures=np.arange(0, 1001, 10, dtype='double'),
                 sigmas=[],
                 mass_variances=None,
                 mesh_divisors=None,
                 coarse_mesh_shifts=None,
                 cutoff_lifetime=1e-4, # in second
                 no_kappa_stars=False,
                 gv_delta_q=None, # finite difference for group veolocity
                 log_level=0):

        self._pp = None
        self._temperatures = None
        self._sigmas = None
        self._no_kappa_stars = None
        self._gv_delta_q = None
        self._log_level = None
        self._primitive = None
        self._dm = None
        self._frequency_factor_to_THz = None
        self._cutoff_frequency = None
        self._cutoff_lifetime = None

        self._symmetry = None
        self._point_operations = None
        self._rotations_cartesian = None
        
        self._grid_points = None
        self._grid_weights = None
        self._grid_address = None

        self._gamma = None
        self._read_gamma = False
        self._read_gamma_iso = False
        self._frequencies = None
        self._gv = None
        self._gamma_iso = None

        self._mesh = None
        self._mesh_divisors = None
        self._coarse_mesh = None
        self._coarse_mesh_shifts = None
        self._conversion_factor = None
        self._sum_num_kstar = None

        self._isotope = None
        self._mass_variances = None
        self._grid_point_count = None

        Conductivity.__init__(self,
                              interaction,
                              symmetry,
                              grid_points=grid_points,
                              temperatures=temperatures,
                              sigmas=sigmas,
                              mass_variances=mass_variances,
                              mesh_divisors=mesh_divisors,
                              coarse_mesh_shifts=coarse_mesh_shifts,
                              cutoff_lifetime=cutoff_lifetime,
                              no_kappa_stars=no_kappa_stars,
                              gv_delta_q=gv_delta_q,
                              log_level=log_level)

        self._cv = None

        if self._temperatures is not None:
            self._allocate_values()