Skip to content

Commit

Permalink
tweak bravais error handling in VaspErrorHandler
Browse files Browse the repository at this point in the history
decrease default symprec 1e-5->1e-6, then try 10xing twice, then set ISYM=0 to not impose potentially artificial symmetry from too loose symprec on charge density
  • Loading branch information
janosh committed Aug 10, 2023
1 parent 608530b commit c11ab49
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions custodian/vasp/handlers.py
Original file line number Diff line number Diff line change
Expand Up @@ -578,13 +578,19 @@ def correct(self):

if "bravais" in self.errors:
# VASP recommends refining the lattice parameters or changing SYMPREC.
# Appears to occurs when SYMPREC is very low, so we will change it to
# the default if it's not already. If it's the default, we will x 10.
symprec = vi["INCAR"].get("SYMPREC", 1e-5)
if symprec < 1e-5:
actions.append({"dict": "INCAR", "action": {"_set": {"SYMPREC": 1e-5}}})
else:
# Appears to occur when SYMPREC is very low, so we change it to
# the default if it's not already. If it's the default, we x10.
vasp_recommended_symprec = 1e-6 # https://www.vasp.at/forum/viewtopic.php?f=3&t=19109
symprec = vi["INCAR"].get("SYMPREC", vasp_recommended_symprec)
if symprec < vasp_recommended_symprec:
actions.append({"dict": "INCAR", "action": {"_set": {"SYMPREC": vasp_recommended_symprec}}})
elif symprec < 1e-4:
# try 10xing symprec twice, then set ISYM=0 to not impose potentially artificial symmetry from
# too loose symprec on charge density
actions.append({"dict": "INCAR", "action": {"_set": {"SYMPREC": symprec * 10}}})
else:
actions.append({"dict": "INCAR", "action": {"_set": {"ISYM": 0}}})
self.error_count["bravais"] += 1

if "nbands_not_sufficient" in self.errors:
# There is something very wrong about the value of NBANDS. We don't make
Expand Down

0 comments on commit c11ab49

Please sign in to comment.