Option to copy CHGCAR or WAVECAR from prev_calc_loc or prev_calc_dir in StaticFW

Hi there,

I am running a couple of relaxations and I am interested in the total energies. So I want to run static calculations with ISMEAR=-5 and low EDIFF afterwards. This can be easily done by chaining a StaticFW after the parent OptimizeFW using prev_calc_loc. However, in some cases the slabs I use are quite large and the electronic convergence is slow. For that reason I would like to start from the already converged WAVECAR and/or CHGCAR. At the moment those files are not copied.

I wanted to ask if it is welcome if I make a pull request that enables this functionality by adding an additional input parameter additional_files_from_prev_calc=[], for StaticFW.

Then the calls to CopyVaspOutputs in StaticFW can be modified to accept this list in additional_files.

I think that this is a nice feature to have, and the empty list in the defaults should ensure that existing workflows are not affected by copying additional stuff. I have already implemented this in my fork, and it works fine, so a pull request would be quick.

Another option would to consider would be to use kwargs to do this without an additional input parameter. Also open to do that if it is preferred.

All the best, Michael

I’m confused why this cannot be done with the existing atomate firetask. CopyVaspOutputs takes the optional argument additional_files, which can be used to specify the WAVECAR or CHGCAR.

Yes, but CopyVaspOutputs is called in StaticFW without specifying any additional_files.
My proposition is exactly to add these additional fields.

the relevant lines are now:

elif prev_calc_dir:
            t.append(CopyVaspOutputs(calc_dir=prev_calc_dir, contcar_to_poscar=True))
            t.append(WriteVaspStaticFromPrev(other_params=vasp_input_set_params))
elif parents:
            if prev_calc_loc:
                t.append(
                    CopyVaspOutputs(calc_loc=prev_calc_loc, contcar_to_poscar=True)
                )
            t.append(WriteVaspStaticFromPrev(other_params=vasp_input_set_params))

and I would change that to:

elif prev_calc_dir:
            t.append(
                CopyVaspOutputs(calc_dir=prev_calc_dir, contcar_to_poscar=True,
                                additional_files=additional_files_from_prev_calc))
            t.append(WriteVaspStaticFromPrev(other_params=vasp_input_set_params))
elif parents:
            if prev_calc_loc:
                t.append(
                    CopyVaspOutputs(calc_loc=prev_calc_loc, contcar_to_poscar=True,
                                    additional_files=additional_files_from_prev_calc)
                )
            t.append(WriteVaspStaticFromPrev(other_params=vasp_input_set_params))

Of course one could also construct a custom firework out of the same firetasks that are used in StaticFW, but that would be unnecessary code duplication I think.