@@ -231,14 +231,16 @@ def __init__(self, parents=None, prev_calc_dir=None, structure=None, mode="gap",
231
231
232
232
class NonSCFFW (Firework ):
233
233
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 ):
236
238
"""
237
- Standard NonSCF Calculation Firework supporting both
238
- uniform and line modes.
239
+ Standard NonSCF Calculation Firework supporting uniform and line modes.
239
240
240
241
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.
242
244
name (str): Name for the Firework.
243
245
mode (str): "uniform" or "line" mode.
244
246
vasp_cmd (str): Command to run vasp.
@@ -248,36 +250,48 @@ def __init__(self, parents=None, prev_calc_dir=None, structure=None, name="nscf"
248
250
db_file (str): Path to file specifying db credentials.
249
251
parents (Firework): Parents of this particular Firework.
250
252
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.
251
259
\*\*kwargs: Other kwargs that are passed to Firework.__init__.
252
260
"""
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 )
255
265
t = []
256
266
257
267
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" ]))
259
270
elif parents :
260
- t .append (CopyVaspOutputs (calc_loc = True , additional_files = ["CHGCAR" ]))
271
+ t .append (CopyVaspOutputs (calc_loc = True ,
272
+ additional_files = ["CHGCAR" ]))
261
273
else :
262
274
raise ValueError ("Must specify previous calculation for NonSCFFW" )
263
275
264
276
mode = mode .lower ()
265
277
if mode == "uniform" :
266
278
t .append (
267
279
WriteVaspNSCFFromPrev (prev_calc_dir = "." , mode = "uniform" ,
268
- reciprocal_density = 1000 ))
280
+ ** input_set_overrides ))
269
281
else :
270
282
t .append (WriteVaspNSCFFromPrev (prev_calc_dir = "." , mode = "line" ,
271
- reciprocal_density = 20 ))
283
+ ** input_set_overrides ))
272
284
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<<" ))
274
287
t .append (PassCalcLocs (name = name ))
275
288
t .append (VaspToDb (db_file = db_file ,
276
289
additional_fields = {"task_label" : name + " " + mode },
277
290
parse_dos = (mode == "uniform" ),
278
291
bandstructure_mode = mode ))
279
292
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 )
281
295
282
296
283
297
class LepsFW (Firework ):
0 commit comments