Skip to content

Commit ed69e59

Browse files
abhardwaj73shyuep
andauthored
Updated vasp input sets with MPSurfaceSet from atomate1 (#4287)
* updated vasp input sets with MPSurfaceSet from atomate1 * updated MVLSlabSet according to MPSurfaceSet in atomate1 * pre-commit ruff fixes * fixing mypy precommit issue * removing MVLSurfaceSet and updaing MVLSlabSet tests to match updated parameters * precommit fix --------- Co-authored-by: Shyue Ping Ong <[email protected]>
1 parent 45e8bd4 commit ed69e59

File tree

2 files changed

+37
-4
lines changed

2 files changed

+37
-4
lines changed

src/pymatgen/io/vasp/sets.py

Lines changed: 35 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2409,6 +2409,11 @@ def from_prev_calc(cls, prev_calc_dir: PathLike, mode: str = "DIAG", **kwargs) -
24092409
return input_set.override_from_prev_calc(prev_calc_dir=prev_calc_dir)
24102410

24112411

2412+
"""
2413+
Parameters for MVLSlabSet class set were updated in March 2025 to match the MPSurfaceSet in atomate1
2414+
"""
2415+
2416+
24122417
@dataclass
24132418
class MVLSlabSet(VaspInputSet):
24142419
"""Write a set of slab VASP runs, including both slabs (along the c direction)
@@ -2434,14 +2439,42 @@ class MVLSlabSet(VaspInputSet):
24342439
@property
24352440
def incar_updates(self) -> dict[str, Any]:
24362441
"""Updates to the INCAR config for this calculation type."""
2442+
2443+
"""Determine LDAU based on slab chemistry without adsorbates"""
2444+
2445+
# Define elements that require LDA+U
2446+
ldau_elts = {"O", "F"}
2447+
2448+
# Initialize non_adsorbate_elts as an empty set
2449+
non_adsorbate_elts = set()
2450+
2451+
# Check if self.structure is not None
2452+
if self.structure is not None:
2453+
# Determine non-adsorbate elements
2454+
if self.structure.site_properties and self.structure.site_properties.get("surface_properties"):
2455+
non_adsorbate_elts = {
2456+
s.specie.symbol for s in self.structure if s.properties["surface_properties"] != "adsorbate"
2457+
}
2458+
else:
2459+
non_adsorbate_elts = {s.specie.symbol for s in self.structure}
2460+
2461+
# Determine if LDA+U should be applied
2462+
ldau = bool(non_adsorbate_elts & ldau_elts)
2463+
24372464
updates = {
2438-
"EDIFF": 1e-4,
2439-
"EDIFFG": -0.02,
2465+
"EDIFF": 1e-5,
2466+
"EDIFFG": -0.05,
2467+
"ENAUG": 4000,
2468+
"IBRION": 1,
2469+
"POTIM": 1.0,
2470+
"LDAU": ldau,
24402471
"ENCUT": 400,
24412472
"ISMEAR": 0,
24422473
"SIGMA": 0.05,
24432474
"ISIF": 3,
2475+
"ISYM": 0,
24442476
}
2477+
24452478
if not self.bulk:
24462479
updates |= {"ISIF": 2, "LVTOT": True, "NELMIN": 8}
24472480
if self.set_mix:

tests/io/vasp/test_sets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1459,8 +1459,8 @@ def test_bulk(self):
14591459
poscar_bulk = self.d_bulk["POSCAR"]
14601460

14611461
assert incar_bulk["ISIF"] == 3
1462-
assert incar_bulk["EDIFF"] == approx(1e-4)
1463-
assert incar_bulk["EDIFFG"] == approx(-0.02)
1462+
assert incar_bulk["EDIFF"] == approx(1e-5)
1463+
assert incar_bulk["EDIFFG"] == approx(-0.05)
14641464
assert poscar_bulk.structure.formula == self.bulk.formula
14651465

14661466
def test_slab(self):

0 commit comments

Comments
 (0)