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


Python Kpoints.style方法代码示例

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


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

示例1: run_task

# 需要导入模块: from pymatgen.io.vasp.inputs import Kpoints [as 别名]
# 或者: from pymatgen.io.vasp.inputs.Kpoints import style [as 别名]
    def run_task(self, fw_spec):

        prev_dir = fw_spec.get('PREV_DIR', None)
        self.custom_params = self.get('custom_params', None)   

        if isinstance(self["structure"], Structure):
            s = self["structure"]
        elif isinstance(self["structure"], dict):
            s = Structure.from_dict(self["structure"])
        else:
            s = Structure.from_file(os.path.join(prev_dir, self["structure"]))


        vis = load_class("pymatgen.io.vasp.sets", self["vasp_input_set"])(
                         **self.get("input_set_params", {}))
        vis.write_input(s, ".")


        # Write Custom KPOINTS settings if necessary
        ksettings = self.custom_params.get('user_kpts_settings', None) if isinstance(
                self.custom_params, dict) else None
        if ksettings:
            style = ksettings.get('kpts_style', 'Gamma')
            kpoints = ksettings.get('kpts', [16,16,16])
            shift = ksettings.get('kpts_shift', [0,0,0])
            k = Kpoints(kpts=[kpoints], kpts_shift=shift)
            k.style = style
            k.write_file("KPOINTS")
开发者ID:dcossey014,项目名称:pymatgen,代码行数:30,代码来源:interfaces.py

示例2: write_input_task

# 需要导入模块: from pymatgen.io.vasp.inputs import Kpoints [as 别名]
# 或者: from pymatgen.io.vasp.inputs.Kpoints import style [as 别名]
    def write_input_task(self, dir='.'):
        self.custom_params = self.get('custom_params', None)

        if isinstance(self["structure"], Structure):
            s = self["structure"]
        elif isinstance(self["structure"], dict):
            s = Structure.from_dict(self["structure"])
        else:
            s = Structure.from_file(self["structure"])


        if os.environ.get('VASP_PSP_DIR') == None:
            print "VASP_PSP_DIR not set.  Checking User's HOME directory for VASP potentials."
            if os.path.exists(os.path.join(os.environ.get('HOME'), 'Potentials')):
                os.environ['VASP_PSP_DIR'] = os.path.join(os.environ.get('HOME'), 'Potentials')
            else:
                print "VASP Potentials not found!"
                print "Please copy the Potentials Folder"
                print "from VASP into your HOME directory"
                sys.exit()

        vis = load_class("pymatgen.io.vasp.sets", self["vasp_input_set"])(
                         **self.get("input_set_params", {}))
        vis.write_input(s, dir)

        # Write Custom KPOINTS settings if necessary
        ksettings = self.custom_params.get('user_kpts_settings', None) if isinstance(
                self.custom_params, dict) else None
        if ksettings:
            style = ksettings.get('kpts_style', 'Gamma')
            kpoints = ksettings.get('kpts', [16,16,16])
            shift = ksettings.get('kpts_shift', [0,0,0])
            k = Kpoints(kpts=[kpoints], kpts_shift=shift)
            k.style = style
            filename = os.path.join(dir, 'KPOINTS')
            k.write_file(filename)
        
        print "Wrote VASP input files to '{}'".format(dir)
开发者ID:dcossey014,项目名称:pymatgen,代码行数:40,代码来源:interfaces.py


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