Creating new workflow with vdw

Hello all,

I am currently working on implementing a workflow for 2d materials that is essentially the same as the wf_bandstructure contained in atomate with the POSCAR changed to the one below

#Standard VASP Settings
PREC = Fast
ALGO = Accurate
EDIFF = 1e-06   !
ENCUT = 600 !
NELM = 60   !
NSW = 50    !
MAGMOM = 
#Changing how calculations are done
GGA = OR    ?
LREAL = Auto
LASPH = True    ?
LUSE_VDW = True ?
ISIF = 3
IBRION = 2
ISPIN = 2
AGGAC = 0.000   ?
SIGMA = 0.05
ISMEAR = 1  !
#OUTPUTS
LORBIT = 11
LCHARG = False  ?
LVTOT = False   ?
LAECHG = False  ?
LWAVE = False
LVHAR = True    ?
#OPTIONAL DIPOLE CORRECTION
LDIPOL = True
IDIPOL = 3
DIPOL = 0.5 0.5 0.5

Below is my implementation of the new workflow

class MPRelaxSet2D(DictSet):
“”"
Implementation of VaspInputSet utilizing parameters in the public
Materials Project. Typically, the pseudopotentials chosen contain more
electrons than the MIT parameters, and the k-point grid is ~50% more dense.
The LDAUU parameters are also different due to the different psps used,
which result in different fitted values.
“”"

CONFIG = _load_yaml_config("MPRelaxSet")

def __init__(self, structure, **kwargs):
    """
    :param structure: Structure
    :param kwargs: Same as those supported by DictSet.
    """
    incar = _read_user_incar('Relax2D.txt')
    super().__init__(structure, MPRelaxSet2D.CONFIG, user_incar_settings=incar, **kwargs)
    self.kwargs = kwargs

def wf_bandstructure2D(structure, c=None):

c = c or {}
vasp_cmd = c.get("VASP_CMD", VASP_CMD)
db_file = c.get("DB_FILE", DB_FILE)
vdw_kernel = c.get("VDW_KERNEL_DIR", VDW_KERNEL_DIR)

mpr2d = MPRelaxSet2D(structure, force_gamma=True)
'''check bandstructure.yaml'''
wf = get_wf(structure, "bandstructure.yaml", vis=MPRelaxSet2D(structure, force_gamma=True), \
            params=[{'vasp_input_set': mpr2d},{},{},{}], common_params={"vasp_cmd": vasp_cmd, "db_file": db_file,}) #"vdw_kernel_dir": vdw_kernel})

wf = add_common_powerups(wf, c)

if c.get("SMALLGAP_KPOINT_MULTIPLY", SMALLGAP_KPOINT_MULTIPLY):
    wf = add_small_gap_multiply(wf, 0.5, 5, "static")
    wf = add_small_gap_multiply(wf, 0.5, 5, "nscf")

if c.get("STABILITY_CHECK", STABILITY_CHECK):
    wf = add_stability_check(wf, fw_name_constraint="structure optimization")

if c.get("ADD_WF_METADATA", ADD_WF_METADATA):
    wf = add_wf_metadata(wf, structure)

return wf

The issue arises from the (LUSE_VDW = True) tag. I can not seem to get atomate to know to copy the vdw_kernel.bindat to the calculation directory even with vdw_kernel_dir defined in the config files. any suggestions on how to remedy this? Also is the above implementation the proper way to define a new workflow with atomate?

Best,

Jason Gibson

Hi Jason,

I think the issue here is indeed that the vdw_kernel.bindat is not copied. The band structure workflow starts with an atomate.vasp.fireworks.core.OptimizeFW Firework. In ScanOptimizeFW (which is newer than the OptimizeFW I think), we have the lines:

# Copy the pre-compiled VdW kernel for VASP, if required
if orig_input_set.vdw is not None:
    t.append(CopyFiles(from_dir=vdw_kernel_dir))

those are missing in OptimizeFW and also StaticFW, which follows directly after the OptimizeFW in the bandstructure WF. I guess it is quite easy to copy this lines to those Fireworks, which are all in the same module. The only thing to change is the name for the original input set in the class, which is vasp_input_set and not orig_input_set for both the OptimizeFW and StaticFW. If you put them somewhere before

t.append(RunVaspCustodian(...

it should work I think.

Maybe someone on the development team can weigh in here and tell us if we should do a pull request or something to get this working?

Cheers, Michael