def run_task(self, fw_spec): # To resolve input_set recoginized as str from dfttk.input_sets import ATATIDSet input_set = ATATIDSet(self['input_set']) input_set.write_input('.') return FWAction()
def __init__(self, structure, name="infdet", input_set=None, metadata=None, prev_calc_loc=True, db_file=None, parents=None, continuation=False, run_isif2=False, pass_isif4=False, **kwargs): metadata = metadata or {} input_set = input_set or ATATIDSet(structure) t = [] if not continuation: # Copy the volume relax CONTCAR to POSCAR and the full relax CONTCAR as CONTCAR. Get the CHGCAR and WAVECAR from the fully relaxed structure # There are other ways to do this, but it's important to pay attention # to the order so that work is not destoryed because CopyVaspOutputs # will always give back a POSCAR (or CONTCAR as POSCAR), KPOINTS, INCAR, POTCAR, OUTCAR, and # vasprun.xml. # What we do here ensures that # 1. We get the the WAVECAR and CHGCAR from the full relax # 2. We do not overwrite the structure that we took from the full relax when we copy the volume relax t.append(CopyVaspOutputs(calc_loc='Full relax', contcar_to_poscar=False, additional_files=["CONTCAR"])) t.append(CopyVaspOutputs(calc_loc='Volume relax', contcar_to_poscar=True)) # Move the volume relaxed POSCAR to str_beg.out t.append(TransmuteStructureFile(input_fname='POSCAR', output_fname='str_beg.out')) # Move the fully relaxed CONTCAR to str_end.out t.append(TransmuteStructureFile(input_fname='CONTCAR', output_fname='str_end.out')) # write the vaspid.wrap file t.append(WriteATATFromIOSet(input_set=input_set)) else: # Copy all the files from the previous run. files_needed = ['CONTCAR', 'str_beg.out', 'str_end.out', 'str_relax.out', 'epipos.out', 'epidir.out', 'epipos.out', 'infdet.log', 'str_current.out'] t.append(CopyVaspOutputs(calc_loc=prev_calc_loc, contcar_to_poscar=False, additional_files=files_needed)) # Unfortunately, it seems that PassCalcLocs must happen before # running ATAT because it can return a FW action that is dynamic and will # skip the remaining Firetasks. We don't really want to do this (I think) # because if this fizzles, the calc_locs will still be changed if this is rerun. t.append(PassCalcLocs(name=name)) # Run ATAT's inflection detection t.append(RunATATCustodian(continuation=continuation, name=name)) t.append(Record_relax_running_path(db_file = ">>db_file<<", metadata = metadata, run_isif2=run_isif2, pass_isif4=pass_isif4)) super(InflectionDetectionFW, self).__init__(t, parents=parents, name="{}-{}".format(structure.composition.reduced_formula, name), **kwargs)