Skip to content

Commit

Permalink
Fix MatPES settings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyue Ping Ong committed Aug 31, 2023
1 parent 8951a47 commit 9895455
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pymatgen/io/vasp/sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -1258,10 +1258,11 @@ def __init__(
super().__init__(structure, MatPESStaticSet.CONFIG, **kwargs)

if xc_functional.upper() == "R2SCAN":
self.user_incar_settings["METAGGA"] = "R2SCAN"
self.user_incar_settings["ALGO"] = "ALL"
self._config_dict["INCAR"]["METAGGA"] = "R2SCAN"
self._config_dict["INCAR"]["ALGO"] = "ALL"
del self._config_dict["INCAR"]["GGA"]
elif xc_functional.upper() == "PBE+U":
self.user_incar_settings["LDAU"] = True
self._config_dict["INCAR"]["LDAU"] = True
elif xc_functional.upper() != "PBE":
raise ValueError(
f"{xc_functional} is not supported."
Expand Down
1 change: 1 addition & 0 deletions tests/io/vasp/test_sets.py
Original file line number Diff line number Diff line change
Expand Up @@ -816,6 +816,7 @@ def test_r2scan(self):
scan = MatPESStaticSet(self.struct, xc_functional="R2SCAN")
incar_scan = scan.incar
assert incar_scan["METAGGA"] == "R2scan"
assert incar_scan.get("GGA") is None
assert incar_scan["ALGO"] == "All"
assert incar_scan.get("LDAU") is None
# test POTCAR files are default PBE_54 PSPs and functional
Expand Down

0 comments on commit 9895455

Please sign in to comment.