本文整理汇总了Python中MAST.ingredients.chopingredient.ChopIngredient.give_phonon_single_forces_and_displacements方法的典型用法代码示例。如果您正苦于以下问题:Python ChopIngredient.give_phonon_single_forces_and_displacements方法的具体用法?Python ChopIngredient.give_phonon_single_forces_and_displacements怎么用?Python ChopIngredient.give_phonon_single_forces_and_displacements使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MAST.ingredients.chopingredient.ChopIngredient
的用法示例。
在下文中一共展示了ChopIngredient.give_phonon_single_forces_and_displacements方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_give_phonon_single_forces_and_displacements
# 需要导入模块: from MAST.ingredients.chopingredient import ChopIngredient [as 别名]
# 或者: from MAST.ingredients.chopingredient.ChopIngredient import give_phonon_single_forces_and_displacements [as 别名]
def test_give_phonon_single_forces_and_displacements(self):
ingdir="%s/writedir/single_phonon_label1" % testdir
recipedir="%s/writedir" % testdir
topmetad = MASTFile("files/top_metadata_single")
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)
mypos = MASTFile("files/phonon_initial_POSCAR")
mypos.to_file("%s/POSCAR" % ingdir)
kdict=dict()
kdict['mast_program'] = 'vasp'
my_structure = pymatgen.io.vaspio.Poscar.from_file("files/perfect_structure").structure
myxdat = MASTFile("files/XDATCAR_compare")
myxdat.to_file("%s/XDATCAR" % ingdir)
mydynmat = MASTFile("files/DYNMAT_compare")
mydynmat.to_file("%s/DYNMAT" % ingdir)
myuci = ChopIngredient(name=ingdir,program_keys=kdict, structure=my_structure)
myuci.give_phonon_single_forces_and_displacements("next_ingred")
newpos = MASTFile("%s/writedir/next_ingred/POSCAR_prePHON" % testdir)
newdyn = MASTFile("%s/writedir/next_ingred/DYNMAT" % testdir)
newxdat = MASTFile("%s/writedir/next_ingred/XDATCAR" % testdir)
comparepos = MASTFile("files/phonon_initial_POSCAR")
comparedyn = MASTFile("files/DYNMAT_compare")
comparexdat = MASTFile("%s/XDATCAR" % ingdir)
self.assertEqual(newpos.data, comparepos.data)
self.assertEqual(newdyn.data, comparedyn.data)
self.assertEqual(newxdat.data, comparexdat.data)