Skip to content

Commit

Permalink
Merge pull request #274 from dyllamt/master
Browse files Browse the repository at this point in the history
VASP input set overrides in nscf calculations
  • Loading branch information
computron authored Mar 20, 2019
2 parents a2cfee5 + 3afe75e commit f23bedb
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 14 deletions.
2 changes: 1 addition & 1 deletion atomate/vasp/firetasks/write_inputs.py
Original file line number Diff line number Diff line change
Expand Up @@ -314,7 +314,7 @@ def run_task(self, fw_spec):
sym_prec=self.get("sym_prec", 0.1),
international_monoclinic=self.get("international_monoclinic", True),
mode=self.get("mode", "uniform"),
nedos=self.get("nedos", 601),
nedos=self.get("nedos", 2001),
optics=self.get("optics", False),
**self.get("other_params", {}))
vis.write_input(".")
Expand Down
40 changes: 27 additions & 13 deletions atomate/vasp/fireworks/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -231,14 +231,16 @@ def __init__(self, parents=None, prev_calc_dir=None, structure=None, mode="gap",

class NonSCFFW(Firework):

def __init__(self, parents=None, prev_calc_dir=None, structure=None, name="nscf", mode="uniform", vasp_cmd="vasp",
copy_vasp_outputs=True, db_file=None, **kwargs):
def __init__(self, parents=None, prev_calc_dir=None, structure=None,
name="nscf", mode="uniform", vasp_cmd="vasp",
copy_vasp_outputs=True, db_file=None,
input_set_overrides=None, **kwargs):
"""
Standard NonSCF Calculation Firework supporting both
uniform and line modes.
Standard NonSCF Calculation Firework supporting uniform and line modes.
Args:
structure (Structure): Input structure - used only to set the name of the FW.
structure (Structure): Input structure - used only to set the name
of the FW.
name (str): Name for the Firework.
mode (str): "uniform" or "line" mode.
vasp_cmd (str): Command to run vasp.
Expand All @@ -248,36 +250,48 @@ def __init__(self, parents=None, prev_calc_dir=None, structure=None, name="nscf"
db_file (str): Path to file specifying db credentials.
parents (Firework): Parents of this particular Firework.
FW or list of FWS.
input_set_overrides (dict): Arguments passed to the
"from_prev_calc" method of the MPNonSCFSet. This parameter
allows a user to modify the default values of the input set.
For example, passing the key value pair
{'reciprocal_density': 1000}
will override default k-point meshes for uniform calculations.
\*\*kwargs: Other kwargs that are passed to Firework.__init__.
"""
fw_name = "{}-{} {}".format(structure.composition.reduced_formula if structure else "unknown", name,
mode)
input_set_overrides = input_set_overrides or {}

fw_name = "{}-{} {}".format(structure.composition.reduced_formula if
structure else "unknown", name, mode)
t = []

if prev_calc_dir:
t.append(CopyVaspOutputs(calc_dir=prev_calc_dir, additional_files=["CHGCAR"]))
t.append(CopyVaspOutputs(calc_dir=prev_calc_dir,
additional_files=["CHGCAR"]))
elif parents:
t.append(CopyVaspOutputs(calc_loc=True, additional_files=["CHGCAR"]))
t.append(CopyVaspOutputs(calc_loc=True,
additional_files=["CHGCAR"]))
else:
raise ValueError("Must specify previous calculation for NonSCFFW")

mode = mode.lower()
if mode == "uniform":
t.append(
WriteVaspNSCFFromPrev(prev_calc_dir=".", mode="uniform",
reciprocal_density=1000))
**input_set_overrides))
else:
t.append(WriteVaspNSCFFromPrev(prev_calc_dir=".", mode="line",
reciprocal_density=20))
**input_set_overrides))

t.append(RunVaspCustodian(vasp_cmd=vasp_cmd, auto_npar=">>auto_npar<<"))
t.append(RunVaspCustodian(vasp_cmd=vasp_cmd,
auto_npar=">>auto_npar<<"))
t.append(PassCalcLocs(name=name))
t.append(VaspToDb(db_file=db_file,
additional_fields={"task_label": name + " " + mode},
parse_dos=(mode == "uniform"),
bandstructure_mode=mode))

super(NonSCFFW, self).__init__(t, parents=parents, name=fw_name, **kwargs)
super(NonSCFFW, self).__init__(t, parents=parents, name=fw_name,
**kwargs)


class LepsFW(Firework):
Expand Down

0 comments on commit f23bedb

Please sign in to comment.