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


Python Poscar.from_dict方法代码示例

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


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

示例1: __init__

# 需要导入模块: from pymatgen.io.vasp.inputs import Poscar [as 别名]
# 或者: from pymatgen.io.vasp.inputs.Poscar import from_dict [as 别名]
 def __init__(self, name, incar, poscar, potcar, kpoints,
              qadapter=None, **kwargs ):
     """
     default INCAR from config_dict
     
     """
     self.name = name
     self.incar = Incar.from_dict(incar.as_dict())
     self.poscar = Poscar.from_dict(poscar.as_dict())
     self.potcar = Potcar.from_dict(potcar.as_dict())
     self.kpoints = Kpoints.from_dict(kpoints.as_dict())
     self.extra = kwargs
     if qadapter is not None:
         self.qadapter = qadapter.from_dict(qadapter.to_dict())
     else:
         self.qadapter = None        
     config_dict = {}
     config_dict['INCAR'] = self.incar.as_dict()
     config_dict['POSCAR'] = self.poscar.as_dict() 
     #caution the key and the value are not always the same        
     config_dict['POTCAR'] = self.potcar.as_dict() 
     #dict(zip(self.potcar.as_dict()['symbols'],
     #self.potcar.as_dict()['symbols']))
     config_dict['KPOINTS'] = self.kpoints.as_dict()
     #self.user_incar_settings = self.incar.as_dict()        
     DictVaspInputSet.__init__(self, name, config_dict,
                                ediff_per_atom=False, **kwargs)
开发者ID:mbkumar,项目名称:MPInterfaces,代码行数:29,代码来源:instrument.py

示例2: from_dict

# 需要导入模块: from pymatgen.io.vasp.inputs import Poscar [as 别名]
# 或者: from pymatgen.io.vasp.inputs.Poscar import from_dict [as 别名]
 def from_dict(cls, d):
     incar = Incar.from_dict(d["incar"])
     poscar = Poscar.from_dict(d["poscar"])
     potcar = Potcar.from_dict(d["potcar"])
     kpoints = Kpoints.from_dict(d["kpoints"])
     qadapter = None
     if d["qadapter"] is not None:
         qadapter = CommonAdapter.from_dict(d["qadapter"])
     return MPINTVaspInputSet(d["name"], incar, poscar, potcar,
                              kpoints, qadapter, **d["kwargs"])
开发者ID:mbkumar,项目名称:MPInterfaces,代码行数:12,代码来源:instrument.py

示例3: update_spec_force_convergence

# 需要导入模块: from pymatgen.io.vasp.inputs import Poscar [as 别名]
# 或者: from pymatgen.io.vasp.inputs.Poscar import from_dict [as 别名]
def update_spec_force_convergence(spec, user_vasp_settings=None):
    fw_spec = spec
    update_set = {"ENCUT": 700, "EDIFF": 0.000001, "ALGO":"N", "NPAR":2}
    if user_vasp_settings and user_vasp_settings.get("incar"):
            update_set.update(user_vasp_settings["incar"])
    fw_spec['vasp']['incar'].update(update_set)
    old_struct=Poscar.from_dict(fw_spec["vasp"]["poscar"]).structure
    if user_vasp_settings and user_vasp_settings.get("kpoints"):
        kpoints_density = user_vasp_settings["kpoints"]["kpoints_density"]
    else:
        kpoints_density = 7000
    k=Kpoints.automatic_density(old_struct, kpoints_density)
    fw_spec['vasp']['kpoints'] = k.as_dict()
    return fw_spec
开发者ID:materialsproject,项目名称:MPWorks,代码行数:16,代码来源:elastic_tasks.py

示例4: from_dict

# 需要导入模块: from pymatgen.io.vasp.inputs import Poscar [as 别名]
# 或者: from pymatgen.io.vasp.inputs.Poscar import from_dict [as 别名]
 def from_dict(cls, d):
     incar = Incar.from_dict(d["incar"])
     poscar = Poscar.from_dict(d["poscar"])
     potcar = Potcar.from_dict(d["potcar"])
     kpoints = Kpoints.from_dict(d["kpoints"])
     qadapter = None
     if d["qadapter"] is not None:
         qadapter = CommonAdapter.from_dict(d["qadapter"])
     script_name = d["script_name"]
     return MPINTVaspInputSet(d["name"], incar, poscar, potcar,
                              kpoints, qadapter,
                              script_name=script_name,
                              vis_logger=logging.getLogger(d["logger"]),
                              **d["kwargs"])
开发者ID:HanmeiTang,项目名称:MPInterfaces,代码行数:16,代码来源:instrument.py

示例5: from_dict

# 需要导入模块: from pymatgen.io.vasp.inputs import Poscar [as 别名]
# 或者: from pymatgen.io.vasp.inputs.Poscar import from_dict [as 别名]
 def from_dict(cls, d):
     incar = Incar.from_dict(d["incar"])
     poscar = Poscar.from_dict(d["poscar"])
     potcar = Potcar.from_dict(d["potcar"])
     kpoints = Kpoints.from_dict(d["kpoints"])
     cal =  Calibrate(incar, poscar, potcar, kpoints, 
                      system=d["system"], is_matrix = d["is_matrix"], 
                      Grid_type = d["Grid_type"], 
                      parent_job_dir=d["parent_job_dir"], 
                      job_dir=d["job_dir"], qadapter=d.get("qadapter"), 
                      job_cmd=d["job_cmd"], wait=d["wait"],
                      turn_knobs=d["turn_knobs"])
     cal.job_dir_list = d["job_dir_list"]
     cal.job_ids = d["job_ids"]
     return cal
开发者ID:zhuyizhou,项目名称:MPInterfaces,代码行数:17,代码来源:calibrate.py

示例6: __init__

# 需要导入模块: from pymatgen.io.vasp.inputs import Poscar [as 别名]
# 或者: from pymatgen.io.vasp.inputs.Poscar import from_dict [as 别名]
    def __init__(self, name, incar, poscar, kpoints, potcar=None,
                 qadapter=None, script_name='submit_script',
                 vis_logger=None, reuse_path=None, test=False,
                 **kwargs):
        """
        default INCAR from config_dict

        """
        self.name = name
        self.test = test
        self.incar_init = Incar.from_dict(incar.as_dict())
        self.poscar_init = Poscar.from_dict(poscar.as_dict())
        if not self.test:
            self.potcar_init = Potcar.from_dict(potcar.as_dict())
        if not isinstance(kpoints, str):
            self.kpoints_init = Kpoints.from_dict(kpoints.as_dict())
        else:
            self.kpoints_init = kpoints
        self.reuse_path = reuse_path  # complete reuse paths
        self.extra = kwargs
        if qadapter is not None:
            self.qadapter = qadapter.from_dict(qadapter.to_dict())
        else:
            self.qadapter = None
        self.script_name = script_name
        config_dict = {}
        config_dict['INCAR'] = self.incar_init.as_dict()
        config_dict['POSCAR'] = self.poscar_init.as_dict()
        # caution the key and the value are not always the same
        if not self.test:
            config_dict['POTCAR'] = self.potcar_init.as_dict()
        # dict(zip(self.potcar.as_dict()['symbols'],
        # self.potcar.as_dict()['symbols']))
        if not isinstance(kpoints, str):
            config_dict['KPOINTS'] = self.kpoints_init.as_dict()
        else:
            # need to find a way to dictify this kpoints string more
            # appropriately
            config_dict['KPOINTS'] = {'kpts_hse':self.kpoints_init}
        # self.user_incar_settings = self.incar.as_dict()
        DictSet.__init__(self, poscar.structure, config_dict)
                         #**kwargs)
        if vis_logger:
            self.logger = vis_logger
        else:
            self.logger = logger
开发者ID:henniggroup,项目名称:MPInterfaces,代码行数:48,代码来源:instrument.py

示例7: test_to_from_dict

# 需要导入模块: from pymatgen.io.vasp.inputs import Poscar [as 别名]
# 或者: from pymatgen.io.vasp.inputs.Poscar import from_dict [as 别名]
    def test_to_from_dict(self):
        poscar_string = """Test3
1.0
3.840198 0.000000 0.000000
1.920099 3.325710 0.000000
0.000000 -2.217138 3.135509
1 1
Selective dynamics
direct
0.000000 0.000000 0.000000 T T T Si
0.750000 0.500000 0.750000 F F F O
"""
        poscar = Poscar.from_string(poscar_string)
        d = poscar.as_dict()
        poscar2 = Poscar.from_dict(d)
        self.assertEqual(poscar2.comment, "Test3")
        self.assertTrue(all(poscar2.selective_dynamics[0]))
        self.assertFalse(all(poscar2.selective_dynamics[1]))
开发者ID:ExpHP,项目名称:pymatgen,代码行数:20,代码来源:test_inputs.py

示例8: set_poscar

# 需要导入模块: from pymatgen.io.vasp.inputs import Poscar [as 别名]
# 或者: from pymatgen.io.vasp.inputs.Poscar import from_dict [as 别名]
    def set_poscar(self, scale=None, poscar=None):
        """
        perturbs given structure by volume scaling factor 
	or takes user defined variants of Poscar 
	
	Args:
	   scale : Volume Scaling parameter

	   poscar : Poscar object of user defined structure

	   set the poscar: volume scaled by the scale factor
        """
        if scale is not None:
            structure = Poscar.from_dict(self.poscar_orig).structure
            volume = structure.volume
            structure.scale_lattice(scale *volume)
            self.poscar = Poscar(structure)
        elif poscar is not None:
            self.poscar = poscar
开发者ID:zhuyizhou,项目名称:MPInterfaces,代码行数:21,代码来源:calibrate.py


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