Skip to content

Commit

Permalink
add docstring. Add support for different pseudopotential path (#832)
Browse files Browse the repository at this point in the history
* add docstring. Add support for different pseudopotential path

* update ediff

* fix minor typo
  • Loading branch information
mshuaibii authored Sep 6, 2024
1 parent c4e9822 commit fc99eef
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/fairchem/data/oc/core/slab.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/fairchem/data/oc/utils/vasp.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand All @@ -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)
2 changes: 1 addition & 1 deletion src/fairchem/data/oc/utils/vasp_flags.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
"xc": "PBE",
"ivdw": 11,
"encut": 400.0,
"ediff": 1e-6,
"ediff": 1e-4,
"nelm": 100,
"ismear": 0,
"sigma": 0.1,
Expand Down

0 comments on commit fc99eef

Please sign in to comment.