@@ -88,7 +88,7 @@ def __init__(self, structure, name="structure optimization",
88
88
class StaticFW (Firework ):
89
89
90
90
def __init__ (self , structure = None , name = "static" , vasp_input_set = None , vasp_input_set_params = None ,
91
- vasp_cmd = "vasp" , prev_calc_loc = True , prev_calc_dir = None , db_file = None , vasptodb_kwargs = {} , parents = None , ** kwargs ):
91
+ vasp_cmd = "vasp" , prev_calc_loc = True , prev_calc_dir = None , db_file = None , vasptodb_kwargs = None , parents = None , ** kwargs ):
92
92
"""
93
93
Standard static calculation Firework - either from a previous location or from a structure.
94
94
@@ -107,11 +107,16 @@ def __init__(self, structure=None, name="static", vasp_input_set=None, vasp_inpu
107
107
prev_calc_dir (str): Path to a previous calculation to copy from
108
108
db_file (str): Path to file specifying db credentials.
109
109
parents (Firework): Parents of this particular Firework. FW or list of FWS.
110
+ vasptodb_kwargs (dict): kwargs to pass to VaspToDb
110
111
\*\*kwargs: Other kwargs that are passed to Firework.__init__.
111
112
"""
112
113
t = []
113
114
114
115
vasp_input_set_params = vasp_input_set_params or {}
116
+ vasptodb_kwargs = vasptodb_kwargs or {}
117
+ if "additional_fields" not in vasptodb_kwargs :
118
+ vasptodb_kwargs ["additional_fields" ] = {}
119
+ vasptodb_kwargs ["additional_fields" ]["task_label" ] = name
115
120
116
121
fw_name = "{}-{}" .format (structure .composition .reduced_formula if structure else "unknown" , name )
117
122
@@ -134,7 +139,7 @@ def __init__(self, structure=None, name="static", vasp_input_set=None, vasp_inpu
134
139
t .append (RunVaspCustodian (vasp_cmd = vasp_cmd , auto_npar = ">>auto_npar<<" ))
135
140
t .append (PassCalcLocs (name = name ))
136
141
t .append (
137
- VaspToDb (db_file = db_file , additional_fields = { "task_label" : name }, ** vasptodb_kwargs ))
142
+ VaspToDb (db_file = db_file , ** vasptodb_kwargs ))
138
143
super (StaticFW , self ).__init__ (t , parents = parents , name = fw_name , ** kwargs )
139
144
140
145
@@ -231,14 +236,16 @@ def __init__(self, parents=None, prev_calc_dir=None, structure=None, mode="gap",
231
236
232
237
class NonSCFFW (Firework ):
233
238
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 ):
239
+ def __init__ (self , parents = None , prev_calc_dir = None , structure = None ,
240
+ name = "nscf" , mode = "uniform" , vasp_cmd = "vasp" ,
241
+ copy_vasp_outputs = True , db_file = None ,
242
+ input_set_overrides = None , ** kwargs ):
236
243
"""
237
- Standard NonSCF Calculation Firework supporting both
238
- uniform and line modes.
244
+ Standard NonSCF Calculation Firework supporting uniform and line modes.
239
245
240
246
Args:
241
- structure (Structure): Input structure - used only to set the name of the FW.
247
+ structure (Structure): Input structure - used only to set the name
248
+ of the FW.
242
249
name (str): Name for the Firework.
243
250
mode (str): "uniform" or "line" mode.
244
251
vasp_cmd (str): Command to run vasp.
@@ -248,36 +255,48 @@ def __init__(self, parents=None, prev_calc_dir=None, structure=None, name="nscf"
248
255
db_file (str): Path to file specifying db credentials.
249
256
parents (Firework): Parents of this particular Firework.
250
257
FW or list of FWS.
258
+ input_set_overrides (dict): Arguments passed to the
259
+ "from_prev_calc" method of the MPNonSCFSet. This parameter
260
+ allows a user to modify the default values of the input set.
261
+ For example, passing the key value pair
262
+ {'reciprocal_density': 1000}
263
+ will override default k-point meshes for uniform calculations.
251
264
\*\*kwargs: Other kwargs that are passed to Firework.__init__.
252
265
"""
253
- fw_name = "{}-{} {}" .format (structure .composition .reduced_formula if structure else "unknown" , name ,
254
- mode )
266
+ input_set_overrides = input_set_overrides or {}
267
+
268
+ fw_name = "{}-{} {}" .format (structure .composition .reduced_formula if
269
+ structure else "unknown" , name , mode )
255
270
t = []
256
271
257
272
if prev_calc_dir :
258
- t .append (CopyVaspOutputs (calc_dir = prev_calc_dir , additional_files = ["CHGCAR" ]))
273
+ t .append (CopyVaspOutputs (calc_dir = prev_calc_dir ,
274
+ additional_files = ["CHGCAR" ]))
259
275
elif parents :
260
- t .append (CopyVaspOutputs (calc_loc = True , additional_files = ["CHGCAR" ]))
276
+ t .append (CopyVaspOutputs (calc_loc = True ,
277
+ additional_files = ["CHGCAR" ]))
261
278
else :
262
279
raise ValueError ("Must specify previous calculation for NonSCFFW" )
263
280
264
281
mode = mode .lower ()
265
282
if mode == "uniform" :
266
283
t .append (
267
284
WriteVaspNSCFFromPrev (prev_calc_dir = "." , mode = "uniform" ,
268
- reciprocal_density = 1000 ))
285
+ ** input_set_overrides ))
269
286
else :
270
287
t .append (WriteVaspNSCFFromPrev (prev_calc_dir = "." , mode = "line" ,
271
- reciprocal_density = 20 ))
288
+ ** input_set_overrides ))
272
289
273
- t .append (RunVaspCustodian (vasp_cmd = vasp_cmd , auto_npar = ">>auto_npar<<" ))
290
+ t .append (RunVaspCustodian (vasp_cmd = vasp_cmd ,
291
+ auto_npar = ">>auto_npar<<" ))
274
292
t .append (PassCalcLocs (name = name ))
275
293
t .append (VaspToDb (db_file = db_file ,
276
294
additional_fields = {"task_label" : name + " " + mode },
277
295
parse_dos = (mode == "uniform" ),
278
296
bandstructure_mode = mode ))
279
297
280
- super (NonSCFFW , self ).__init__ (t , parents = parents , name = fw_name , ** kwargs )
298
+ super (NonSCFFW , self ).__init__ (t , parents = parents , name = fw_name ,
299
+ ** kwargs )
281
300
282
301
283
302
class LepsFW (Firework ):
@@ -538,9 +557,7 @@ def __init__(self, structure, transformations, transformation_params=None,
538
557
vasp_input_set = None , prev_calc_dir = None ,
539
558
name = "structure transmuter" , vasp_cmd = "vasp" ,
540
559
copy_vasp_outputs = True , db_file = None ,
541
- parents = None , bandstructure_mode = None ,
542
- override_default_vasp_params = None ,
543
- defect_wf_parsing = None , ** kwargs ):
560
+ parents = None , override_default_vasp_params = None , ** kwargs ):
544
561
"""
545
562
Apply the transformations to the input structure, write the input set corresponding
546
563
to the transformed structure, and run vasp on them. Note that if a transformation yields
@@ -561,14 +578,7 @@ def __init__(self, structure, transformations, transformation_params=None,
561
578
prev_calc_dir (str): Path to a previous calculation to copy from
562
579
db_file (string): Path to file specifying db credentials.
563
580
parents (Firework): Parents of this particular Firework. FW or list of FWS.
564
- bandstructure_mode (str): Set to "uniform" for uniform band structure.
565
- Set to "line" for line mode. If not set, band structure will not
566
- be parsed.
567
581
override_default_vasp_params (dict): additional user input settings for vasp_input_set.
568
- defect_wf_parsing (Site): If Site is provided, drone considers Procar and
569
- Wavecar localization parsing relative to the position of Site.
570
- Useful for consideration of defect localization
571
- Defaults to None (no extra procar or wavecar parsing occurs for VaspToDb)
572
582
\*\*kwargs: Other kwargs that are passed to Firework.__init__.
573
583
"""
574
584
fw_name = "{}-{}" .format (structure .composition .reduced_formula , name )
@@ -612,9 +622,7 @@ def __init__(self, structure, transformations, transformation_params=None,
612
622
"task_label" : name ,
613
623
"transmuter" : {"transformations" : transformations ,
614
624
"transformation_params" : transformation_params }
615
- },
616
- bandstructure_mode = bandstructure_mode ,
617
- defect_wf_parsing = defect_wf_parsing ))
625
+ }))
618
626
619
627
super (TransmuterFW , self ).__init__ (t , parents = parents ,
620
628
name = fw_name , ** kwargs )
0 commit comments