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


Python ChopIngredient.write_singlerun方法代码示例

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


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

示例1: test_complete_neb_subfolders

# 需要导入模块: from MAST.ingredients.chopingredient import ChopIngredient [as 别名]
# 或者: from MAST.ingredients.chopingredient.ChopIngredient import write_singlerun [as 别名]
 def test_complete_neb_subfolders(self):
     #raise SkipTest
     ingdir="%s/writedir/single_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")
     metad.to_file("%s/metadata.txt" % ingdir)
     kdict=dict()
     kdict['mast_program'] = 'vasp'
     kdict['mast_kpoints'] = [2,2,2,"M"]
     kdict['mast_xc'] = 'pw91'
     kdict['mast_neb_settings']=dict()
     kdict['mast_neb_settings']['images'] = 3
     my_structure = pymatgen.io.vaspio.Poscar.from_file("files/perfect_structure").structure
     mywr = ChopIngredient(name=ingdir, program_keys = kdict, structure=my_structure)
     myoutcar = MASTFile("files/OUTCAR_completed")
     myoszicar = MASTFile("files/OSZICAR_completed")
     for subdir in ['00','01','02','03','04']:
         subname = "%s/%s" % (ingdir, subdir)
         os.mkdir(subname)
         mywr.keywords['name'] = subname
         mywr.checker.keywords['name'] = subname
         if not subdir in ['00','04']:
             mywr.write_singlerun()
             mywr.write_submit_script()
             myoutcar.to_file("%s/OUTCAR" % subname)
             myoszicar.to_file("%s/OSZICAR" % subname)
     myci = ChopIngredient(name=ingdir,program_keys=kdict, structure=my_structure)
     self.assertTrue(myci.complete_neb_subfolders())
     os.remove("%s/03/OUTCAR" % ingdir)
     self.assertFalse(myci.complete_neb_subfolders())
开发者ID:ZhewenSong,项目名称:USIT,代码行数:35,代码来源:test_completeingredient.py

示例2: test_run_subfolders

# 需要导入模块: from MAST.ingredients.chopingredient import ChopIngredient [as 别名]
# 或者: from MAST.ingredients.chopingredient.ChopIngredient import write_singlerun [as 别名]
 def test_run_subfolders(self):
     #raise SkipTest
     ingdir="%s/writedir/single_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")
     metad.to_file("%s/metadata.txt" % ingdir)
     kdict=dict()
     kdict['mast_program'] = 'vasp'
     kdict['mast_kpoints'] = [2,2,2,"M"]
     kdict['mast_xc'] = 'pw91'
     my_structure = Poscar.from_file("files/perfect_structure").structure
     for subfolder in ['sub1','sub2','sub3','sub4']:
         subname = "%s/%s" % (ingdir, subfolder)
         os.mkdir(subname)
         shutil.copy("files/metadata_single","%s/metadata.txt" % subname)
         mywr = ChopIngredient(name=subname, program_keys = kdict, structure=my_structure)
         mywr.write_singlerun()
     myri = ChopIngredient(name=ingdir,program_keys=kdict, structure=my_structure)
     myri.run_subfolders()
     self.assertFalse(myri.checker.is_ready_to_run())
     for subfolder in ['sub1','sub2','sub3','sub4']:
         subname = "%s/%s" % (ingdir, subfolder)
         myri.checker.keywords['name'] = subname
         self.assertTrue(myri.checker.is_ready_to_run())
     mysubmit = MASTFile("%s/submitlist" % self.test_control)
     self.assertEquals(mysubmit.data[0], "%s/sub1\n" % ingdir)
     self.assertEquals(mysubmit.data[1], "%s/sub2\n" % ingdir)
     self.assertEquals(mysubmit.data[2], "%s/sub3\n" % ingdir)
     self.assertEquals(mysubmit.data[3], "%s/sub4\n" % ingdir)
开发者ID:uw-cmg,项目名称:MAST,代码行数:34,代码来源:test_runingredient.py

示例3: test_write_singlerun

# 需要导入模块: from MAST.ingredients.chopingredient import ChopIngredient [as 别名]
# 或者: from MAST.ingredients.chopingredient.ChopIngredient import write_singlerun [as 别名]
 def test_write_singlerun(self):
     ingdir="writedir/single_label1"
     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")
     metad.to_file("%s/metadata.txt" % ingdir)
     kdict=dict()
     kdict['mast_kpoints']=[3,3,3,"G"]
     kdict['mast_xc']='pbe'
     kdict['mast_program']='vasp'
     my_structure=pymatgen.io.vaspio.Poscar.from_file("files/perfect_structure").structure
     mywi = ChopIngredient(name=ingdir,program_keys=kdict,structure=my_structure)
     mywi.write_singlerun()
     self.assertTrue(mywi.checker.is_ready_to_run())
开发者ID:ZhewenSong,项目名称:USIT,代码行数:17,代码来源:test_writeingredient.py

示例4: test_ready_singlerun

# 需要导入模块: from MAST.ingredients.chopingredient import ChopIngredient [as 别名]
# 或者: from MAST.ingredients.chopingredient.ChopIngredient import write_singlerun [as 别名]
 def test_ready_singlerun(self):
     ingdir="%s/writedir/single_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")
     metad.to_file("%s/metadata.txt" % ingdir)
     kdict=dict()
     kdict['mast_program'] = 'vasp'
     kdict['mast_kpoints'] = [2,2,2,"M"]
     kdict['mast_xc'] = 'pw91'
     my_structure = pymatgen.io.vaspio.Poscar.from_file("files/perfect_structure").structure
     mywr = ChopIngredient(name=ingdir, program_keys = kdict, structure=my_structure)
     mywr.write_singlerun()
     myrdi = ChopIngredient(name=ingdir,program_keys=kdict, structure=my_structure)
     self.assertTrue(myrdi.ready_singlerun())
     os.remove("%s/POSCAR" % ingdir)
     self.assertFalse(myrdi.ready_singlerun())
开发者ID:ZhewenSong,项目名称:USIT,代码行数:21,代码来源:test_readyingredient.py

示例5: test_run_singlerun

# 需要导入模块: from MAST.ingredients.chopingredient import ChopIngredient [as 别名]
# 或者: from MAST.ingredients.chopingredient.ChopIngredient import write_singlerun [as 别名]
 def test_run_singlerun(self):
     #raise SkipTest
     ingdir="%s/writedir/single_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")
     metad.to_file("%s/metadata.txt" % ingdir)
     kdict=dict()
     kdict['mast_program'] = 'vasp'
     kdict['mast_kpoints'] = [2,2,2,"M"]
     kdict['mast_xc'] = 'pw91'
     my_structure = Poscar.from_file("files/perfect_structure").structure
     mywr = ChopIngredient(name=ingdir, program_keys = kdict, structure=my_structure)
     mywr.write_singlerun()
     myri = ChopIngredient(name=ingdir,program_keys=kdict, structure=my_structure)
     myri.run_singlerun()
     self.assertTrue(myri.checker.is_ready_to_run())
     mysubmit = MASTFile("%s/submitlist" % self.test_control)
     self.assertEquals(mysubmit.data[0], "%s\n" % ingdir)
开发者ID:uw-cmg,项目名称:MAST,代码行数:23,代码来源:test_runingredient.py


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