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


Python Structure.rocksalt方法代码示例

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


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

示例1: build_structure

# 需要导入模块: from abipy.core.structure import Structure [as 别名]
# 或者: from abipy.core.structure.Structure import rocksalt [as 别名]
    def build_structure(self, ref="ae"):
        """
        Returns the crystalline structure associated to this entry.
        Use the optimized lattice parameters obtained from reference ref.
        Returns None if no lattice parameter is available.
        """
        # Get structure type and lattice parameters
        stype, a = self.struct_type, getattr(self, ref)

        # Handle missing value.
        if a is None:
            return None

        if stype == "bcc":
            return Structure.bcc(a, species=[self.symbol])

        elif stype == "fcc":
            return Structure.fcc(a, species=[self.symbol])

        elif stype == "rocksalt":
            return Structure.rocksalt(a, self.species)

        elif stype == "ABO3":
            return Structure.ABO3(a, self.species)

        elif stype == "hH":
            raise NotImplementedError()
            #return Structure.hH(a, sites)

        raise ValueError("Don't know how to construct %s structure" % stype)
开发者ID:vormar,项目名称:pseudo_dojo,代码行数:32,代码来源:database.py

示例2: work_for_pseudo

# 需要导入模块: from abipy.core.structure import Structure [as 别名]
# 或者: from abipy.core.structure.Structure import rocksalt [as 别名]
    def work_for_pseudo(self, pseudo, ecut_list, pawecutdg=None, ngkpt=(8, 8, 8),
                        include_soc=False, workdir=None, manager=None):
        """
        Returns a :class:`Work` object from the given pseudopotential.

        Args:
            pseudo: :class:`Pseudo` object.
            ecut_list: List of cutoff energies in Hartree
            pawecutdg: Cutoff energy of the fine grid (PAW only)
            include_soc: True to include SOC.
            workdir: Working directory.
            manager: :class:`TaskManager` object.
        """
        if pseudo.ispaw and pawecutdg is None:
            raise ValueError("pawecutdg must be specified for PAW calculations.")

        if pseudo.xc != self.xc:
            raise ValueError(
                "Pseudo xc differs from the XC used to instantiate the factory\n"
                "Pseudo: %s, Factory: %s" % (pseudo.xc, self.xc))

        if not ecut_list:
            return None

        # Build rocksalt structure.
        db = raren_database(pseudo.xc)
        a = db.table["ref"][pseudo.symbol]
        species = [pseudo.symbol, "N"]
        structure = Structure.rocksalt(a, species)
        n_pseudo = db.get_n_pseudo(pseudo)

        # Build input template.
        template = abilab.AbinitInput(structure, pseudos=[pseudo, n_pseudo])

        # Input for EuN Rocksalt
        template.set_vars(
            occopt=7,
            tsmear=0.001,
            ecutsm=0.5,
            #kptopt=1,
            ngkpt=ngkpt,
            nshiftk=4,
            shiftk=[0.0, 0.0, 0.5,
                    0.0, 0.5, 0.0,
                    0.5, 0.0, 0.0,
                    0.5, 0.5, 0.5],
            fband=2,
            nstep=60,
            ionmov=2,
            optcell=1,
            dilatmx=1.14,
            tolvrs=1.0E-16,
            tolmxf=1.0E-06,
            ntime=50,
            prtden=0,
            prteig=0,
            prtwf=-1,
        )

        work = RocksaltRelaxationWork()
        work._pseudo = pseudo
        for ecut in ecut_list:
            task = RelaxTask(template.new_with_vars(ecut=ecut))
            #print(task.input)
            work.register(task)

        work.include_soc = include_soc
        return work
开发者ID:gmatteo,项目名称:pseudo_dojo,代码行数:70,代码来源:works.py


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