diff --git a/.gitignore b/.gitignore index f0876989b..85507d4c5 100644 --- a/.gitignore +++ b/.gitignore @@ -11,3 +11,4 @@ apidoc/ .ipynb_checkpoints/ test_times.dat core.* +.vscode/settings.json diff --git a/pyiron_atomistics/sphinx/base.py b/pyiron_atomistics/sphinx/base.py index 768425892..83a59e031 100644 --- a/pyiron_atomistics/sphinx/base.py +++ b/pyiron_atomistics/sphinx/base.py @@ -1235,7 +1235,7 @@ def load_default_groups(self): if self._spin_enabled: self.input["EmptyStates"] = int(1.5 * len(self.structure) + 3) else: - self.input["EmptyStates"] = int(len(self.structure) + 3) + self.input["EmptyStates"] = int(0.5 * len(self.structure) + 3) if not self.input.sphinx.basis.read_only: self.load_basis_group() @@ -1486,7 +1486,22 @@ def convergence_check(self): """ # Checks if sufficient empty states are present if not self.nbands_convergence_check(): + print( + """ + The highest orbital is not empty (has a finite occupation). + Number of empty states might be too few. + Try changing to a higher number of empty states or use default values. + """ + ) return False + if not self.output.generic.dft.scf_convergence[-1]: + print( + """ + scf convergence not reached. Check residue and number of steps. + If residue goes down systematically, but slowly, try increasing number of steps. + If residue is high, decreasing rho mixing might help. + """ + ) return self.output.generic.dft.scf_convergence[-1] def collect_logfiles(self): @@ -1592,7 +1607,12 @@ def check_setup(self): else: warnings.warn( "Number of empty states was not specified. Default: " - + "3+NIONS for non-magnetic systems" + + "3+NIONS*0.5 for non-magnetic systems" + ) + else: + if self.input["EmptyStates"] < 0.5 * int(len(self.structure) + 3): + warnings.warn( + "Number of empty states seem to be too low. Hopefully you know what you are doing." ) return len(w) == 0 diff --git a/pyiron_atomistics/sphinx/output_parser.py b/pyiron_atomistics/sphinx/output_parser.py index 603149adb..ea4ddcd18 100644 --- a/pyiron_atomistics/sphinx/output_parser.py +++ b/pyiron_atomistics/sphinx/output_parser.py @@ -243,7 +243,7 @@ def index_permutation(self): @property def spin_enabled(self): - return len(re.findall("The spin for the label", self.log_file)) > 0 + return len(re.findall("Spin moment:", self.log_file)) > 0 @property def log_main(self): @@ -405,7 +405,7 @@ def get_convergence(self): return convergence def get_fermi(self): - pattern = r"Fermi energy:\s+(\d+\.\d+)\s+eV" + pattern = r"Fermi energy:\s+(-?\d+\.\d+)\s+eV" return np.array(re.findall(pattern, self.log_main)).astype(float) @property