示例#1
0
class PhonopyGruneisen:
    def __init__(self,
                 phonon,
                 phonon_plus,
                 phonon_minus):
        self._phonon = phonon
        self._phonon_plus = phonon_plus
        self._phonon_minus = phonon_minus

        self._mesh = None
        self._band_structure = None
        
    def set_mesh(self,
                 mesh,
                 shift=None,
                 is_gamma_center=False):
        self._mesh = GruneisenMesh(self._phonon,
                                   self._phonon_plus,
                                   self._phonon_minus,
                                   mesh,
                                   shift=shift,
                                   is_gamma_center=is_gamma_center)

    def write_yaml_mesh(self):
        self._mesh.write_yaml()

    def plot_mesh(self,
                  cutoff_frequency=None,
                  color_scheme=None,
                  marker='o',
                  markersize=None):
        return self._mesh.plot(cutoff_frequency=cutoff_frequency,
                               color_scheme=color_scheme,
                               marker=marker,
                               markersize=markersize)

    def set_band_structure(self,
                           paths,
                           num_points):
        self._band_structure = GruneisenBand(self._phonon,
                                             self._phonon_plus,
                                             self._phonon_minus,
                                             paths,
                                             num_points)

    def write_yaml_band_structure(self):
        self._band_structure.write_yaml()

    def plot_band_structure(self,
                            epsilon=1e-4,
                            color_scheme=None):
        return self._band_structure.plot(epsilon=epsilon,
                                         color_scheme=color_scheme)
示例#2
0
 def set_band_structure(self,
                        paths,
                        num_points):
     self._band_structure = GruneisenBand(self._phonon,
                                          self._phonon_plus,
                                          self._phonon_minus,
                                          paths,
                                          num_points)
示例#3
0
class PhonopyGruneisen:
    def __init__(self, phonon, phonon_plus, phonon_minus):
        self._phonon = phonon
        self._phonon_plus = phonon_plus
        self._phonon_minus = phonon_minus

        self._mesh = None
        self._band_structure = None

    def set_mesh(self, mesh, grid_shift=None, is_gamma_center=False):
        self._mesh = GruneisenMesh(self._phonon,
                                   self._phonon_plus,
                                   self._phonon_minus,
                                   mesh,
                                   grid_shift=grid_shift,
                                   is_gamma_center=is_gamma_center)

    def write_yaml_mesh(self):
        self._mesh.write_yaml()

    def plot_mesh(self,
                  cutoff_frequency=None,
                  color_scheme=None,
                  marker='o',
                  markersize=None):
        return self._mesh.plot(cutoff_frequency=cutoff_frequency,
                               color_scheme=color_scheme,
                               marker=marker,
                               markersize=markersize)

    def set_band_structure(self, paths, num_points):
        self._band_structure = GruneisenBand(self._phonon, self._phonon_plus,
                                             self._phonon_minus, paths,
                                             num_points)

    def write_yaml_band_structure(self):
        self._band_structure.write_yaml()

    def plot_band_structure(self, epsilon=1e-4, color_scheme=None):
        return self._band_structure.plot(epsilon=epsilon,
                                         color_scheme=color_scheme)
示例#4
0
class PhonopyGruneisen:
    def __init__(self,
                 phonon,
                 phonon_plus,
                 phonon_minus):
        self._phonon = phonon
        self._phonon_plus = phonon_plus
        self._phonon_minus = phonon_minus

        self._mesh = None
        self._band_structure = None
        self._thermal_properties = None

    def get_phonon(self):
        return self._phonon

    def set_mesh(self,
                 mesh,
                 shift=None,
                 is_time_reversal=True,
                 is_gamma_center=False,
                 is_mesh_symmetry=True):
        for phonon in (self._phonon, self._phonon_plus, self._phonon_minus):
            if phonon.get_dynamical_matrix() is None:
                print "Warning: Dynamical matrix has not yet built."
                return False

        self._mesh = GruneisenMesh(self._phonon,
                                   self._phonon_plus,
                                   self._phonon_minus,
                                   mesh,
                                   shift=shift,
                                   is_time_reversal=is_time_reversal,
                                   is_gamma_center=is_gamma_center,
                                   is_mesh_symmetry=is_mesh_symmetry)
        return True

    def get_mesh(self):
        return self._mesh

    def write_yaml_mesh(self):
        self._mesh.write_yaml()

    def write_hdf5_mesh(self):
        self._mesh.write_hdf5()

    def plot_mesh(self,
                  cutoff_frequency=None,
                  color_scheme=None,
                  marker='o',
                  markersize=None):
        return self._mesh.plot(cutoff_frequency=cutoff_frequency,
                               color_scheme=color_scheme,
                               marker=marker,
                               markersize=markersize)

    def set_band_structure(self,
                           paths,
                           num_points):
        self._band_structure = GruneisenBand(self._phonon,
                                             self._phonon_plus,
                                             self._phonon_minus,
                                             paths,
                                             num_points)

    def get_band_structure(self):
        return self._band_structure

    def write_yaml_band_structure(self):
        self._band_structure.write_yaml()

    def plot_band_structure(self,
                            epsilon=1e-4,
                            color_scheme=None):
        return self._band_structure.plot(epsilon=epsilon,
                                         color_scheme=color_scheme)

    def set_thermal_properties(self,
                               volumes,
                               t_step=2,
                               t_max=2004,
                               t_min=0,
                               cutoff_frequency=None):
        self._thermal_properties  = GruneisenThermalProperties(
            self._mesh,
            volumes,
            t_step=t_step,
            t_max=t_max,
            t_min=t_min,
            cutoff_frequency=cutoff_frequency)

    def get_thermal_properties(self):
        return self._thermal_properties
        
    def write_yaml_thermal_properties(self, filename='thermal_properties'):
        self._thermal_properties.write_yaml(filename=filename)
示例#5
0
 def set_band_structure(self, paths, num_points):
     self._band_structure = GruneisenBand(self._phonon, self._phonon_plus,
                                          self._phonon_minus, paths,
                                          num_points)
示例#6
0
class PhonopyGruneisen:
    def __init__(self, phonon, phonon_plus, phonon_minus):
        self._phonon = phonon
        self._phonon_plus = phonon_plus
        self._phonon_minus = phonon_minus

        self._mesh = None
        self._band_structure = None
        self._thermal_properties = None

    def get_phonon(self):
        return self._phonon

    def set_mesh(self,
                 mesh,
                 shift=None,
                 is_time_reversal=True,
                 is_gamma_center=False,
                 is_mesh_symmetry=True):
        for phonon in (self._phonon, self._phonon_plus, self._phonon_minus):
            if phonon.get_dynamical_matrix() is None:
                print("Warning: Dynamical matrix has not yet built.")
                return False

        self._mesh = GruneisenMesh(self._phonon,
                                   self._phonon_plus,
                                   self._phonon_minus,
                                   mesh,
                                   shift=shift,
                                   is_time_reversal=is_time_reversal,
                                   is_gamma_center=is_gamma_center,
                                   is_mesh_symmetry=is_mesh_symmetry)
        return True

    def get_mesh(self):
        return self._mesh

    def write_yaml_mesh(self):
        self._mesh.write_yaml()

    def write_hdf5_mesh(self):
        self._mesh.write_hdf5()

    def plot_mesh(self,
                  cutoff_frequency=None,
                  color_scheme=None,
                  marker='o',
                  markersize=None):
        return self._mesh.plot(cutoff_frequency=cutoff_frequency,
                               color_scheme=color_scheme,
                               marker=marker,
                               markersize=markersize)

    def set_band_structure(self, paths, num_points):
        self._band_structure = GruneisenBand(self._phonon, self._phonon_plus,
                                             self._phonon_minus, paths,
                                             num_points)

    def get_band_structure(self):
        return self._band_structure

    def write_yaml_band_structure(self):
        self._band_structure.write_yaml()

    def plot_band_structure(self, epsilon=1e-4, color_scheme=None):
        return self._band_structure.plot(epsilon=epsilon,
                                         color_scheme=color_scheme)

    def set_thermal_properties(self,
                               volumes,
                               t_step=2,
                               t_max=2004,
                               t_min=0,
                               cutoff_frequency=None):
        self._thermal_properties = GruneisenThermalProperties(
            self._mesh,
            volumes,
            t_step=t_step,
            t_max=t_max,
            t_min=t_min,
            cutoff_frequency=cutoff_frequency)

    def get_thermal_properties(self):
        return self._thermal_properties

    def write_yaml_thermal_properties(self, filename='thermal_properties'):
        self._thermal_properties.write_yaml(filename=filename)