Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions src/custodian/vasp/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -602,14 +602,13 @@ def correct(self, directory="./"):
# Often coincides with algo_tet, in which the algo_tet error handler will also resolve grad_not_orth.
# When not present alongside algo_tet, the grad_not_orth error is due to how VASP is compiled.
# Depending on the optimization flag and choice of compiler, the ALGO = All and Damped algorithms
# may not work. The only fix is either to change ALGO or to recompile VASP. Since meta-GGAs/hybrids
# are often used with ALGO = All (and hybrids are incompatible with ALGO = VeryFast/Fast and slow with
# ALGO = Normal), we do not adjust ALGO in these cases.
if vi["INCAR"].get("METAGGA", "none") == "none" and not vi["INCAR"].get("LHFCALC", False):
if vi["INCAR"].get("ALGO", "Normal").lower() in {"all", "damped"}:
# may not work. The only fix is either to change ALGO or to recompile VASP.
if vi["INCAR"].get("ALGO", "Normal").lower() in {"all", "conjugate", "damped"}:
if vi["INCAR"].get("METAGGA", "none") == "none" and not vi["INCAR"].get("LHFCALC", False):
actions.append({"dict": "INCAR", "action": {"_set": {"ALGO": "Fast"}}})
elif 53 <= vi["INCAR"].get("IALGO", 38) <= 58:
actions.append({"dict": "INCAR", "action": {"_set": {"ALGO": "Fast"}, "_unset": {"IALGO": 38}}})
else:
# Meta-GGAs and hybrids should not be run with ALGO = Fast
actions.append({"dict": "INCAR", "action": {"_set": {"ALGO": "Normal"}}})
if "algo_tet" not in self.errors:
warnings.warn(
"EDWAV error reported by VASP without a simultaneous algo_tet error. You may wish to consider "
Expand Down
24 changes: 0 additions & 24 deletions tests/files/INCAR.gga_ialgo53

This file was deleted.

12 changes: 2 additions & 10 deletions tests/vasp/test_handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -370,14 +370,6 @@ def test_gradient_not_orthogonal(self) -> None:
incar = Incar.from_file("INCAR")
assert incar["ALGO"] == "Fast"

shutil.copy("INCAR.gga_ialgo53", "INCAR")
handler = VaspErrorHandler("vasp.gradient_not_orthogonal")
assert handler.check() is True
assert "grad_not_orth" in handler.correct()["errors"]
incar = Incar.from_file("INCAR")
assert incar["ALGO"] == "Fast"
assert "IALGO" not in incar

shutil.copy("INCAR.hybrid_normal", "INCAR")
handler = VaspErrorHandler("vasp.gradient_not_orthogonal")
assert handler.check() is True
Expand All @@ -390,14 +382,14 @@ def test_gradient_not_orthogonal(self) -> None:
assert handler.check() is True
assert "grad_not_orth" in handler.correct()["errors"]
incar = Incar.from_file("INCAR")
assert incar["ALGO"] == "All"
assert incar["ALGO"] == "Normal"

shutil.copy("INCAR.metagga_all", "INCAR")
handler = VaspErrorHandler("vasp.gradient_not_orthogonal")
assert handler.check() is True
assert "grad_not_orth" in handler.correct()["errors"]
incar = Incar.from_file("INCAR")
assert incar["ALGO"] == "All"
assert incar["ALGO"] == "Normal"

def test_rhosyg(self) -> None:
handler = VaspErrorHandler("vasp.rhosyg")
Expand Down
Loading