-
Notifications
You must be signed in to change notification settings - Fork 887
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Updated vasp input sets with MPSurfaceSet from atomate1 #4287
base: master
Are you sure you want to change the base?
Conversation
I would rather not have two surface sets with only slgihtly different parameters and confusing names. The changes to the inputs are small enough that you can go ahead and modify MVLSlabSet directly and atomate should use MVLSlabSet. |
@abhardwaj73 it looks like the adsorption workflows in |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me @abhardwaj73 , thanks. See a few small comments.
Also, please update the tests here if needed so they pass with the new parameters.
src/pymatgen/io/vasp/sets.py
Outdated
class MPSurfaceSet(MVLSlabSet): | ||
""" | ||
Input class for MP slab calcs, mostly to change parameters | ||
and defaults slightly | ||
""" | ||
|
||
def __init__(self, structure, bulk=False, auto_dipole=None, **kwargs): | ||
# If not a bulk calc, turn get_locpot/auto_dipole on by default | ||
auto_dipole = auto_dipole or not bulk | ||
super().__init__(structure, bulk=bulk, auto_dipole=False, **kwargs) | ||
# This is a hack, but should be fixed when this is ported over to | ||
# pymatgen to account for vasp native dipole fix | ||
if auto_dipole: | ||
self._config_dict["INCAR"].update({"LDIPOL": True, "IDIPOL": 3}) | ||
self.auto_dipole = True | ||
|
||
@property | ||
def incar(self): | ||
incar = super().incar | ||
|
||
# Determine LDAU based on slab chemistry without adsorbates | ||
ldau_elts = {"O", "F"} | ||
if self.structure.site_properties.get("surface_properties"): | ||
non_adsorbate_elts = { | ||
s.specie.symbol for s in self.structure if s.properties["surface_properties"] != "adsorbate" | ||
} | ||
else: | ||
non_adsorbate_elts = {s.specie.symbol for s in self.structure} | ||
ldau = bool(non_adsorbate_elts & ldau_elts) | ||
|
||
# Should give better forces for optimization | ||
incar_config = { | ||
"EDIFFG": -0.05, | ||
"ENAUG": 4000, | ||
"IBRION": 1, | ||
"POTIM": 1.0, | ||
"LDAU": ldau, | ||
"EDIFF": 1e-5, | ||
"ISYM": 0, | ||
} | ||
incar.update(incar_config) | ||
incar.update(self.user_incar_settings) | ||
return incar | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @abhardwaj73 . Since we were asked only to update MVLSlabSet
to match the MPSurfaceSet
parameters, this class can now be removed.
|
||
"""Determine LDAU based on slab chemistry without adsorbates""" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For historical provenance purposes, please add some comment lines either here or at the top of the MVLSlabSet
class explaining that the parameters were updated in March 2025 to match the MPSurfaceSet
in atomate1.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks @abhardwaj73 ! @shyuep I think this should be ready to merge, pending tests all passing.
Summary
Major changes:
Todos
Mentioned in this issue #4247 @rkingsbury