本文整理汇总了Python中MAST.ingredients.chopingredient.ChopIngredient.write_neb_subfolders方法的典型用法代码示例。如果您正苦于以下问题:Python ChopIngredient.write_neb_subfolders方法的具体用法?Python ChopIngredient.write_neb_subfolders怎么用?Python ChopIngredient.write_neb_subfolders使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MAST.ingredients.chopingredient.ChopIngredient
的用法示例。
在下文中一共展示了ChopIngredient.write_neb_subfolders方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: test_write_neb_subfolders
# 需要导入模块: from MAST.ingredients.chopingredient import ChopIngredient [as 别名]
# 或者: from MAST.ingredients.chopingredient.ChopIngredient import write_neb_subfolders [as 别名]
def test_write_neb_subfolders(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)
parent_01 = MASTFile("statfiles/parent_structure_labelinit-labelfin_01")
parent_01.to_file(ingdir + "/parent_structure_labelinit-labelfin_01")
parent_02 = MASTFile("statfiles/parent_structure_labelinit-labelfin_02")
parent_02.to_file(ingdir + "/parent_structure_labelinit-labelfin_02")
parent_03 = MASTFile("statfiles/parent_structure_labelinit-labelfin_03")
parent_03.to_file(ingdir + "/parent_structure_labelinit-labelfin_03")
parent_init = MASTFile("statfiles/parent_structure_labelinit")
parent_init.to_file(ingdir + "/parent_structure_labelinit")
parent_fin = MASTFile("statfiles/parent_structure_labelfin")
parent_fin.to_file(ingdir + "/parent_structure_labelfin")
peinit = MASTFile("statfiles/parent_energy_labelinit")
peinit.to_file("%s/parent_energy_labelinit" % ingdir)
pefin = MASTFile("statfiles/parent_energy_labelfin")
pefin.to_file("%s/parent_energy_labelfin" % ingdir)
kdict=dict()
kdict['mast_kpoints']=[3,3,3,"G"]
kdict['mast_xc']='pbe'
kdict['mast_program']='vasp'
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_subfolders()
self.assertFalse(os.path.isfile("%s/00/submit.sh" % ingdir))
self.assertTrue(os.path.isfile("%s/01/submit.sh" % ingdir))
self.assertTrue(os.path.isfile("%s/02/submit.sh" % ingdir))
self.assertTrue(os.path.isfile("%s/03/submit.sh" % ingdir))
self.assertFalse(os.path.isfile("%s/04/submit.sh" % ingdir))
oszinit = MASTFile("%s/00/OSZICAR" % ingdir)
oszfin = MASTFile("%s/04/OSZICAR" % ingdir)
pos00 = MASTFile("%s/00/POSCAR" % ingdir)
pos01 = MASTFile("%s/01/POSCAR" % ingdir)
pos02 = MASTFile("%s/02/POSCAR" % ingdir)
pos03 = MASTFile("%s/03/POSCAR" % ingdir)
pos04 = MASTFile("%s/04/POSCAR" % ingdir)
self.assertEqual(oszinit.data, peinit.data)
self.assertEqual(oszfin.data, pefin.data)
self.assertEqual(pos01.data, parent_01.data)
self.assertEqual(pos02.data, parent_02.data)
self.assertEqual(pos03.data, parent_03.data)
self.assertEqual(pos00.data, parent_init.data)
self.assertEqual(pos04.data, parent_fin.data)
示例2: test_run_neb_subfolders
# 需要导入模块: from MAST.ingredients.chopingredient import ChopIngredient [as 别名]
# 或者: from MAST.ingredients.chopingredient.ChopIngredient import write_neb_subfolders [as 别名]
def test_run_neb_subfolders(self):
#raise SkipTest
ingdir="%s/writedir/neb_labelinit-labelfin_stat" % testdir
recipedir="%s/writedir" % testdir
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)
kdict=dict()
kdict['mast_program'] = 'vasp'
kdict['mast_kpoints'] = [2,2,2,"M"]
kdict['mast_xc'] = 'pw91'
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']['lines']=neblines
kdict['mast_neb_settings']['images']=3
str_00 = MASTFile("files/POSCAR_00")
str_00.to_file("%s/parent_structure_labelinit" % ingdir)
str_04 = MASTFile("files/POSCAR_04")
str_04.to_file("%s/parent_structure_labelfin" % ingdir)
str_01 = MASTFile("files/POSCAR_01")
str_01.to_file("%s/parent_structure_labelinit-labelfin_01" % ingdir)
str_02 = MASTFile("files/POSCAR_02")
str_02.to_file("%s/parent_structure_labelinit-labelfin_02" % ingdir)
str_03 = MASTFile("files/POSCAR_03")
str_03.to_file("%s/parent_structure_labelinit-labelfin_03" % ingdir)
en_00 = MASTFile("files/OSZICAR_00")
en_00.to_file("%s/parent_energy_labelinit" % ingdir)
en_04 = MASTFile("files/OSZICAR_04")
en_04.to_file("%s/parent_energy_labelfin" % ingdir)
my_structure = Poscar.from_file("files/perfect_structure").structure
mywr = ChopIngredient(name=ingdir, program_keys = kdict, structure=my_structure)
mywr.write_neb_subfolders()
myri = ChopIngredient(name=ingdir,program_keys=kdict, structure=my_structure)
myri.run_neb_subfolders()
mysubmit = MASTFile("%s/submitlist" % self.test_control)
myri.checker.keywords['name'] = "%s/00" % ingdir
self.assertFalse(myri.checker.is_ready_to_run()) #do not run endpoints again
myri.checker.keywords['name'] = "%s/01" % ingdir
self.assertTrue(myri.checker.is_ready_to_run())
myri.checker.keywords['name'] = "%s/02" % ingdir
self.assertTrue(myri.checker.is_ready_to_run())
myri.checker.keywords['name'] = "%s/03" % ingdir
self.assertTrue(myri.checker.is_ready_to_run())
myri.checker.keywords['name'] = "%s/04" % ingdir
self.assertFalse(myri.checker.is_ready_to_run()) #do not run endpoints again
self.assertEquals(mysubmit.data[0], "%s/01\n" % ingdir)
self.assertEquals(mysubmit.data[1], "%s/02\n" % ingdir)
self.assertEquals(mysubmit.data[2], "%s/03\n" % ingdir)