当前位置: 首页>>代码示例>>Python>>正文


Python ChopIngredient.write_phonon_multiple方法代码示例

本文整理汇总了Python中MAST.ingredients.chopingredient.ChopIngredient.write_phonon_multiple方法的典型用法代码示例。如果您正苦于以下问题:Python ChopIngredient.write_phonon_multiple方法的具体用法?Python ChopIngredient.write_phonon_multiple怎么用?Python ChopIngredient.write_phonon_multiple使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在MAST.ingredients.chopingredient.ChopIngredient的用法示例。


在下文中一共展示了ChopIngredient.write_phonon_multiple方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: test_write_phonon_multiple

# 需要导入模块: from MAST.ingredients.chopingredient import ChopIngredient [as 别名]
# 或者: from MAST.ingredients.chopingredient.ChopIngredient import write_phonon_multiple [as 别名]
 def test_write_phonon_multiple(self):
     ingdir="writedir/single_phonon_label1"
     topmetad = MASTFile("files/top_metadata_single_phonon")
     topmetad.data.append("origin_dir = %s/files\n" % testdir) #give origin directory
     topmetad.to_file("writedir/metadata.txt")
     metad = MASTFile("files/metadata_single_phonon")
     metad.to_file("%s/metadata.txt" % ingdir)
     shutil.copy("files/CHGCAR", ingdir)
     shutil.copy("files/WAVECAR", ingdir)
     kdict=dict()
     kdict['mast_kpoints']=[3,3,3,"G"]
     kdict['mast_xc']='pbe'
     kdict['mast_program']='vasp'
     kdict['mast_phonon_settings']=dict()
     kdict['mast_phonon_settings']['phonon_center_site']="0.33 0.25 0.0"
     kdict['mast_phonon_settings']['phonon_center_radius']="1"
     kdict['mast_phonon_settings']['threshold']="0.075"
     my_structure=pymatgen.io.vaspio.Poscar.from_file("files/perfect_structure").structure
     mywi = ChopIngredient(name=ingdir,program_keys=kdict,structure=my_structure)
     mywi.write_phonon_multiple()
     self.assertTrue(os.path.isdir("%s/phon_01" % ingdir))
     self.assertTrue(os.path.isdir("%s/phon_02" % ingdir))
     self.assertTrue(os.path.isdir("%s/phon_03" % ingdir))
     mywi.checker.keywords['name'] = "%s/phon_01" % ingdir
     self.assertTrue(mywi.checker.is_ready_to_run())
     mywi.checker.keywords['name'] = "%s/phon_02" % ingdir
     self.assertTrue(mywi.checker.is_ready_to_run())
     mywi.checker.keywords['name'] = "%s/phon_03" % ingdir
     self.assertTrue(mywi.checker.is_ready_to_run())
     compare_phon01 = MASTFile("files/phon_01_POSCAR")
     compare_phon02 = MASTFile("files/phon_02_POSCAR")
     compare_phon03 = MASTFile("files/phon_03_POSCAR")
     phon01 = MASTFile("%s/phon_01/POSCAR" % ingdir)
     phon02 = MASTFile("%s/phon_02/POSCAR" % ingdir)
     phon03 = MASTFile("%s/phon_03/POSCAR" % ingdir)
     self.assertEqual(phon01.data, compare_phon01.data)
     self.assertEqual(phon02.data, compare_phon02.data)
     self.assertEqual(phon03.data, compare_phon03.data)
开发者ID:ZhewenSong,项目名称:USIT,代码行数:40,代码来源:test_writeingredient.py


注:本文中的MAST.ingredients.chopingredient.ChopIngredient.write_phonon_multiple方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。