diff --git a/pymatgen/io/vasp/sets.py b/pymatgen/io/vasp/sets.py index 88dc7ac0184..a3819d1a4e0 100644 --- a/pymatgen/io/vasp/sets.py +++ b/pymatgen/io/vasp/sets.py @@ -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." diff --git a/tests/io/vasp/test_sets.py b/tests/io/vasp/test_sets.py index d4c5192136d..39622c27e44 100644 --- a/tests/io/vasp/test_sets.py +++ b/tests/io/vasp/test_sets.py @@ -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