Example #1
0
    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":
            return half_heusler(a, self.species)

        raise ValueError("Don't know how to construct %s structure" % stype)
Example #2
0
    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)
Example #3
0
    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