當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。