From fc99eefe3aa884630fabfd0aca0682fb6443bd4b Mon Sep 17 00:00:00 2001 From: Muhammed Shuaibi <45150244+mshuaibii@users.noreply.github.com> Date: Thu, 5 Sep 2024 20:07:00 -0500 Subject: [PATCH] add docstring. Add support for different pseudopotential path (#832) * add docstring. Add support for different pseudopotential path * update ediff * fix minor typo --- src/fairchem/data/oc/core/slab.py | 2 +- src/fairchem/data/oc/utils/vasp.py | 7 ++++++- src/fairchem/data/oc/utils/vasp_flags.py | 2 +- 3 files changed, 8 insertions(+), 3 deletions(-) diff --git a/src/fairchem/data/oc/core/slab.py b/src/fairchem/data/oc/core/slab.py index f3f7685c7..2d122e799 100644 --- a/src/fairchem/data/oc/core/slab.py +++ b/src/fairchem/data/oc/core/slab.py @@ -54,7 +54,7 @@ def __init__( shift: float | None = None, top: bool | None = None, oriented_bulk: Structure = None, - min_ab: float = 0.8, + min_ab: float = 8.0, ): assert bulk is not None self.bulk = bulk diff --git a/src/fairchem/data/oc/utils/vasp.py b/src/fairchem/data/oc/utils/vasp.py index c7f3f1d53..08ef59eb9 100644 --- a/src/fairchem/data/oc/utils/vasp.py +++ b/src/fairchem/data/oc/utils/vasp.py @@ -67,7 +67,9 @@ def calculate_surface_k_points(atoms): ) -def write_vasp_input_files(atoms, outdir=".", vasp_flags=None, pp_setups="minimal"): +def write_vasp_input_files( + atoms, outdir=".", vasp_flags=None, pp_setups="minimal", pp_env="VASP_PP_PATH" +): """ Effectively goes through the same motions as the `run_vasp` function, except it only writes the input files instead of running. @@ -78,11 +80,14 @@ def write_vasp_input_files(atoms, outdir=".", vasp_flags=None, pp_setups="minima Defaults to '.' vasp_flags A dictionary of settings we want to pass to the `Vasp` calculator. Defaults to a standerd set of values if `None` + pp_setups Pseudopotential setups to use - https://gitlab.com/ase/ase/-/blob/master/ase/calculators/vasp/setups.py + pp_env Environment variable to read for pseudopotentials. """ if vasp_flags is None: # Immutable default vasp_flags = VASP_FLAGS atoms, vasp_flags = _clean_up_inputs(atoms, vasp_flags.copy()) calc = Vasp(directory=outdir, **vasp_flags) + calc.VASP_PP_PATH = pp_env calc.input_params["setups"] = pp_setups calc.write_input(atoms) diff --git a/src/fairchem/data/oc/utils/vasp_flags.py b/src/fairchem/data/oc/utils/vasp_flags.py index 6a66ad28c..ea0c46681 100644 --- a/src/fairchem/data/oc/utils/vasp_flags.py +++ b/src/fairchem/data/oc/utils/vasp_flags.py @@ -42,7 +42,7 @@ "xc": "PBE", "ivdw": 11, "encut": 400.0, - "ediff": 1e-6, + "ediff": 1e-4, "nelm": 100, "ismear": 0, "sigma": 0.1,