本文整理汇总了Python中MAST.ingredients.chopingredient.ChopIngredient.write_neb方法的典型用法代码示例。如果您正苦于以下问题:Python ChopIngredient.write_neb方法的具体用法?Python ChopIngredient.write_neb怎么用?Python ChopIngredient.write_neb使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MAST.ingredients.chopingredient.ChopIngredient
的用法示例。
在下文中一共展示了ChopIngredient.write_neb方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_write_neb_with_parent_image_structures
# 需要导入模块: from MAST.ingredients.chopingredient import ChopIngredient [as 别名]
# 或者: from MAST.ingredients.chopingredient.ChopIngredient import write_neb [as 别名]
def test_write_neb_with_parent_image_structures(self):
ingdir="writedir/neb_labelinit-labelfin"
topmetad = MASTFile("files/top_metadata_neb")
topmetad.data.append("origin_dir = %s/files\n" % testdir) #give origin directory
topmetad.to_file("writedir/metadata.txt")
metad = MASTFile("files/metadata_neb")
metad.to_file("%s/metadata.txt" % ingdir)
peinit = MASTFile("files/parent_energy_labelinit")
peinit.to_file("%s/parent_energy_labelinit" % ingdir)
pefin = MASTFile("files/parent_energy_labelfin")
pefin.to_file("%s/parent_energy_labelfin" % ingdir)
psinit = MASTFile("files/parent_structure_labelinit")
psinit.to_file("%s/parent_structure_labelinit" % ingdir)
psfin = MASTFile("files/parent_structure_labelfin")
psfin.to_file("%s/parent_structure_labelfin" % ingdir)
kdict=dict()
kdict['mast_kpoints']=[3,3,3,"G"]
kdict['mast_xc']='pbe'
kdict['mast_program']='vasp_neb'
kdict['mast_coordinates']=list()
kdict['mast_coordinates'].append('%s/files/POSCAR_coords_01' % testdir)
kdict['mast_coordinates'].append('%s/files/POSCAR_coords_02' % testdir)
kdict['mast_coordinates'].append('%s/files/POSCAR_coords_03' % testdir)
neblines = list()
neblines.append(["Cr","0.0 0.9 0.8","0.0 0.8 0.7"])
neblines.append(["Cr","0.4 0.2 0.1","0.3 0.3 0.2"])
neblines.append(["Cr","0.29 0.05 0.05","0.01 0.01 0.98"])
neblines.append(["Ni","0.61 0.99 0.98","0.25 0.01 0.97"])
kdict['mast_neb_settings']=dict()
kdict['mast_neb_settings']['images']=3
kdict['mast_neb_settings']['lines']=neblines
my_structure=pymatgen.io.vaspio.Poscar.from_file("files/perfect_structure").structure
mywi = ChopIngredient(name=ingdir,program_keys=kdict,structure=my_structure)
mywi.write_neb()
self.assertTrue(mywi.checker.is_ready_to_run())
pos_compare_00 = MASTFile("files/POSCAR_grafted_00")
pos_compare_01 = MASTFile("files/POSCAR_grafted_01")
pos_compare_02 = MASTFile("files/POSCAR_grafted_02")
pos_compare_03 = MASTFile("files/POSCAR_grafted_03")
pos_compare_04 = MASTFile("files/POSCAR_grafted_04")
mypos00 = MASTFile("writedir/neb_labelinit-labelfin/00/POSCAR")
mypos01 = MASTFile("writedir/neb_labelinit-labelfin/01/POSCAR")
mypos02 = MASTFile("writedir/neb_labelinit-labelfin/02/POSCAR")
mypos03 = MASTFile("writedir/neb_labelinit-labelfin/03/POSCAR")
mypos04 = MASTFile("writedir/neb_labelinit-labelfin/04/POSCAR")
self.assertEqual(pos_compare_00.data, mypos00.data)
self.assertEqual(pos_compare_01.data, mypos01.data)
self.assertEqual(pos_compare_02.data, mypos02.data)
self.assertEqual(pos_compare_03.data, mypos03.data)
self.assertEqual(pos_compare_04.data, mypos04.data)