當前位置: 首頁>>代碼示例>>Python>>正文


Python Phonopy.write_yaml_thermal_properties方法代碼示例

本文整理匯總了Python中phonopy.Phonopy.write_yaml_thermal_properties方法的典型用法代碼示例。如果您正苦於以下問題:Python Phonopy.write_yaml_thermal_properties方法的具體用法?Python Phonopy.write_yaml_thermal_properties怎麽用?Python Phonopy.write_yaml_thermal_properties使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在phonopy.Phonopy的用法示例。


在下文中一共展示了Phonopy.write_yaml_thermal_properties方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: __init__

# 需要導入模塊: from phonopy import Phonopy [as 別名]
# 或者: from phonopy.Phonopy import write_yaml_thermal_properties [as 別名]

#.........這裏部分代碼省略.........
                          distance=0.01, factor=15.633302)
         print fc
         phonon.set_force_constants(fc[0])
         phonon.set_dynamical_matrix()
         #print phonon.get_dynamical_matrix_at_q([0,0,0])
         mesh = [100, 100, 100]
         phonon.set_mesh(mesh)
         qpoints, weights, frequencies, eigvecs = phonon.get_mesh()
         print frequencies
         phonon.set_total_DOS()
         
         phonon.set_thermal_properties(t_step=10,
                                       t_max=2500,
                                       t_min=0)
     
     
     f = open('F_TV','w')
     for t, free_energy, entropy, cv in np.array(phonon.get_thermal_properties()).T:
         #print t, cv
         #print ("%12.3f " + "%15.7f" * 3) % ( t, free_energy, entropy, cv )
         f.write(("%12.3f " + "%15.7f" + "\n") % ( t, free_energy))
     f.close()
     
     fc = open('thermal_properties','w')
     for t, free_energy, entropy, cv in np.array(phonon.get_thermal_properties()).T:
         fc.write(("%12.3f " + "%15.7f" *3 + "\n") % ( t, free_energy, entropy, cv ))
     fc.close()
     
     #phonon.plot_thermal_properties().show()
     
     #phonon.plot_total_DOS().show()
     phonon.write_total_DOS()
     #phonon.write_partial_DOS()
     phonon.write_yaml_thermal_properties()
     
     bands = []
     
     #### PRIMITIVE
     
     q_start  = np.array([0.0, 0.0, 0.0])
     #q_start  = np.array([0.5, 0.5, 0.0])
     q_end    = np.array([-0.5, 0.5, 0.5])
     #q_end    = np.array([0., 0., 0.])
     band = []
     for i in range(101):
         band.append(q_start + (q_end - q_start) / 100 * i)
     bands.append(band)
     
     band = []
     
     
     q_start  = np.array([-0.5, 0.5, 0.5])
     #q_start  = np.array([0., 0., 0.])
     q_end    = np.array([0.25, 0.25, 0.25])
     #q_end    = np.array([1., 0., 0.])
     
     for i in range(101):
         #band.append([-0.5+3*1/400*i, 0.5-1/400*i, 0.5-1/400*i])
         band.append(q_start + (q_end - q_start) / 100 * i)
     bands.append(band)
     #print band
     q_start  = np.array([0.25, 0.25, 0.25])
     q_end    = np.array([0., 0., 0.])
     band = []
     for i in range(101):
         band.append(q_start + (q_end - q_start) / 100 * i)
開發者ID:tdengg,項目名稱:pylastic,代碼行數:70,代碼來源:test.py

示例2: open

# 需要導入模塊: from phonopy import Phonopy [as 別名]
# 或者: from phonopy.Phonopy import write_yaml_thermal_properties [as 別名]
                 [[s,0.,0.],[0.,s,0.],[0.,0.,s]],
                 primitive_matrix=[[-0.5, 0.5, 0.5],[0.5, -0.5, 0.5],[0.5, 0.5, -0.5]],
                 distance=0.01, factor=15.633302)

phonon.set_force_constants(fc[0])
phonon.set_dynamical_matrix()
#print phonon.get_dynamical_matrix_at_q([0,0,0])
mesh = [100, 100, 100]
phonon.set_mesh(mesh)
qpoints, weights, frequencies, eigvecs = phonon.get_mesh()
print frequencies
phonon.set_total_DOS()

phonon.set_thermal_properties(t_step=10,
                              t_max=1000,
                              t_min=0)
f = open('F_TV','w')
for t, free_energy, entropy, cv in np.array(phonon.get_thermal_properties()).T:
    print ("%12.3f " + "%15.7f" * 3) % ( t, free_energy, entropy, cv )
    f.write(("%12.3f " + "%15.7f" + "\n") % ( t, free_energy))
f.close()



#phonon.plot_thermal_properties().show()

phonon.plot_total_DOS().show()
phonon.write_total_DOS()

phonon.write_yaml_thermal_properties()
開發者ID:tdengg,項目名稱:elaston,代碼行數:32,代碼來源:test.py


注:本文中的phonopy.Phonopy.write_yaml_thermal_properties方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。