Skip to content

Commit f23bedb

Browse files
authored
Merge pull request #274 from dyllamt/master
VASP input set overrides in nscf calculations
2 parents a2cfee5 + 3afe75e commit f23bedb

File tree

2 files changed

+28
-14
lines changed

2 files changed

+28
-14
lines changed

atomate/vasp/firetasks/write_inputs.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ def run_task(self, fw_spec):
314314
sym_prec=self.get("sym_prec", 0.1),
315315
international_monoclinic=self.get("international_monoclinic", True),
316316
mode=self.get("mode", "uniform"),
317-
nedos=self.get("nedos", 601),
317+
nedos=self.get("nedos", 2001),
318318
optics=self.get("optics", False),
319319
**self.get("other_params", {}))
320320
vis.write_input(".")

atomate/vasp/fireworks/core.py

+27-13
Original file line numberDiff line numberDiff line change
@@ -231,14 +231,16 @@ def __init__(self, parents=None, prev_calc_dir=None, structure=None, mode="gap",
231231

232232
class NonSCFFW(Firework):
233233

234-
def __init__(self, parents=None, prev_calc_dir=None, structure=None, name="nscf", mode="uniform", vasp_cmd="vasp",
235-
copy_vasp_outputs=True, db_file=None, **kwargs):
234+
def __init__(self, parents=None, prev_calc_dir=None, structure=None,
235+
name="nscf", mode="uniform", vasp_cmd="vasp",
236+
copy_vasp_outputs=True, db_file=None,
237+
input_set_overrides=None, **kwargs):
236238
"""
237-
Standard NonSCF Calculation Firework supporting both
238-
uniform and line modes.
239+
Standard NonSCF Calculation Firework supporting uniform and line modes.
239240
240241
Args:
241-
structure (Structure): Input structure - used only to set the name of the FW.
242+
structure (Structure): Input structure - used only to set the name
243+
of the FW.
242244
name (str): Name for the Firework.
243245
mode (str): "uniform" or "line" mode.
244246
vasp_cmd (str): Command to run vasp.
@@ -248,36 +250,48 @@ def __init__(self, parents=None, prev_calc_dir=None, structure=None, name="nscf"
248250
db_file (str): Path to file specifying db credentials.
249251
parents (Firework): Parents of this particular Firework.
250252
FW or list of FWS.
253+
input_set_overrides (dict): Arguments passed to the
254+
"from_prev_calc" method of the MPNonSCFSet. This parameter
255+
allows a user to modify the default values of the input set.
256+
For example, passing the key value pair
257+
{'reciprocal_density': 1000}
258+
will override default k-point meshes for uniform calculations.
251259
\*\*kwargs: Other kwargs that are passed to Firework.__init__.
252260
"""
253-
fw_name = "{}-{} {}".format(structure.composition.reduced_formula if structure else "unknown", name,
254-
mode)
261+
input_set_overrides = input_set_overrides or {}
262+
263+
fw_name = "{}-{} {}".format(structure.composition.reduced_formula if
264+
structure else "unknown", name, mode)
255265
t = []
256266

257267
if prev_calc_dir:
258-
t.append(CopyVaspOutputs(calc_dir=prev_calc_dir, additional_files=["CHGCAR"]))
268+
t.append(CopyVaspOutputs(calc_dir=prev_calc_dir,
269+
additional_files=["CHGCAR"]))
259270
elif parents:
260-
t.append(CopyVaspOutputs(calc_loc=True, additional_files=["CHGCAR"]))
271+
t.append(CopyVaspOutputs(calc_loc=True,
272+
additional_files=["CHGCAR"]))
261273
else:
262274
raise ValueError("Must specify previous calculation for NonSCFFW")
263275

264276
mode = mode.lower()
265277
if mode == "uniform":
266278
t.append(
267279
WriteVaspNSCFFromPrev(prev_calc_dir=".", mode="uniform",
268-
reciprocal_density=1000))
280+
**input_set_overrides))
269281
else:
270282
t.append(WriteVaspNSCFFromPrev(prev_calc_dir=".", mode="line",
271-
reciprocal_density=20))
283+
**input_set_overrides))
272284

273-
t.append(RunVaspCustodian(vasp_cmd=vasp_cmd, auto_npar=">>auto_npar<<"))
285+
t.append(RunVaspCustodian(vasp_cmd=vasp_cmd,
286+
auto_npar=">>auto_npar<<"))
274287
t.append(PassCalcLocs(name=name))
275288
t.append(VaspToDb(db_file=db_file,
276289
additional_fields={"task_label": name + " " + mode},
277290
parse_dos=(mode == "uniform"),
278291
bandstructure_mode=mode))
279292

280-
super(NonSCFFW, self).__init__(t, parents=parents, name=fw_name, **kwargs)
293+
super(NonSCFFW, self).__init__(t, parents=parents, name=fw_name,
294+
**kwargs)
281295

282296

283297
class LepsFW(Firework):

0 commit comments

Comments
 (0)