Esempio n. 1
0
    def converged(self):
        """Check if configuration is relaxed.

           This is called when self.rundir[-1] is complete and not a constant volume job.

           Convergence criteria is: at least 2 relaxation jobs are complete, and:
                                    1) the last job completed with <= 3 ionic steps
                                    or 2) the last two jobs had final E0 differ by less than
                                          self.settings["nrg_convergence"]
        """
        if len(self.rundir) >= 2:
            if io.ionic_steps(self.rundir[-1]) <= 3:
                return True
            if self.settings["nrg_convergence"] != None:
                if io.job_complete(self.rundir[-1]) and io.job_complete(
                        self.rundir[-2]):
                    osz_1 = io.Oszicar(os.path.join(self.rundir[-1],
                                                    "OSZICAR"))
                    osz_2 = io.Oszicar(os.path.join(self.rundir[-2],
                                                    "OSZICAR"))
                    if abs(osz_1.E[-1] -
                           osz_2.E[-1]) < self.settings["nrg_convergence"]:
                        return True

        return False
Esempio n. 2
0
    def converged(self):
        """Check if configuration is relaxed.

           This is called when self.rundir[-1] is complete and not a constant volume job.

           Convergence criteria is: at least 2 relaxation jobs are complete, and:
                                    1) the last job completed with <= 3 ionic steps
                                    or 2) the last two jobs had final E0 differ by less than
                                          self.settings["nrg_convergence"]
        """
        if len(self.rundir) >= 2:
            if io.ionic_steps(self.rundir[-1]) <= 3:
                return True
            if self.settings["nrg_convergence"] != None:
                if io.job_complete(self.rundir[-1]) and io.job_complete(self.rundir[-2]):
                    o1 = io.Oszicar(os.path.join(self.rundir[-1],"OSZICAR"))
                    o2 = io.Oszicar(os.path.join(self.rundir[-2],"OSZICAR"))
                    if abs( o1.E[-1] - o2.E[-1]) < self.settings["nrg_convergence"]:
                        return True

        return False