Skip to content

Commit 4509acc

Browse files
authored
Merge pull request #652 from janosh/main
Replace deprecated LepsFW with equivalent DFPTFW
2 parents 34bafc1 + 31e9487 commit 4509acc

File tree

6 files changed

+5
-121
lines changed

6 files changed

+5
-121
lines changed

atomate/vasp/fireworks/core.py

Lines changed: 0 additions & 116 deletions
Original file line numberDiff line numberDiff line change
@@ -591,122 +591,6 @@ def __init__(
591591
super().__init__(t, parents=parents, name=fw_name, **kwargs)
592592

593593

594-
class LepsFW(Firework):
595-
def __init__(
596-
self,
597-
structure,
598-
name="static dielectric",
599-
vasp_cmd=VASP_CMD,
600-
copy_vasp_outputs=True,
601-
db_file=DB_FILE,
602-
parents=None,
603-
phonon=False,
604-
mode=None,
605-
displacement=None,
606-
user_incar_settings=None,
607-
**kwargs,
608-
):
609-
"""
610-
Standard static calculation Firework for dielectric constants using DFPT.
611-
612-
Args:
613-
structure (Structure): Input structure. If copy_vasp_outputs, used only to set the
614-
name of the FW.
615-
name (str): Name for the Firework.
616-
vasp_cmd (str): Command to run vasp.
617-
copy_vasp_outputs (bool): Whether to copy outputs from previous
618-
run. Defaults to True.
619-
db_file (str): Path to file specifying db credentials.
620-
parents (Firework): Parents of this particular Firework.
621-
FW or list of FWS.
622-
phonon (bool): Whether or not to extract normal modes and pass it. This argument along
623-
with the mode and displacement arguments must be set for the calculation of
624-
dielectric constant in the Raman tensor workflow.
625-
mode (int): normal mode index.
626-
displacement (float): displacement along the normal mode in Angstroms.
627-
user_incar_settings (dict): Parameters in INCAR to override
628-
**kwargs: Other kwargs that are passed to Firework.__init__.
629-
"""
630-
warnings.warn(
631-
"This firework will be removed soon. Use DFPTFW and/or RamanFW fireworks."
632-
)
633-
user_incar_settings = user_incar_settings or {}
634-
t = []
635-
636-
if copy_vasp_outputs:
637-
t.append(
638-
CopyVaspOutputs(
639-
calc_loc=True, additional_files=["CHGCAR"], contcar_to_poscar=True
640-
)
641-
)
642-
t.append(
643-
WriteVaspStaticFromPrev(
644-
lepsilon=True,
645-
other_params={"user_incar_settings": user_incar_settings},
646-
)
647-
)
648-
else:
649-
vasp_input_set = MPStaticSet(
650-
structure, lepsilon=True, user_incar_settings=user_incar_settings
651-
)
652-
t.append(
653-
WriteVaspFromIOSet(structure=structure, vasp_input_set=vasp_input_set)
654-
)
655-
656-
if phonon:
657-
if mode is None and displacement is None:
658-
name = "{} {}".format("phonon", name)
659-
t.append(RunVaspCustodian(vasp_cmd=vasp_cmd))
660-
t.append(
661-
pass_vasp_result(
662-
{
663-
"structure": "a>>final_structure",
664-
"eigenvals": "a>>normalmode_eigenvals",
665-
"eigenvecs": "a>>normalmode_eigenvecs",
666-
},
667-
parse_eigen=True,
668-
mod_spec_key="normalmodes",
669-
)
670-
)
671-
else:
672-
name = "raman_{}_{} {}".format(str(mode), str(displacement), name)
673-
key = f"{mode}_{displacement}".replace("-", "m").replace(".", "d")
674-
pass_fw = pass_vasp_result(
675-
pass_dict={
676-
"mode": mode,
677-
"displacement": displacement,
678-
"epsilon": "a>>epsilon_static",
679-
},
680-
mod_spec_key="raman_epsilon->" + key,
681-
parse_eigen=True,
682-
)
683-
t.extend(
684-
[
685-
WriteNormalmodeDisplacedPoscar(
686-
mode=mode, displacement=displacement
687-
),
688-
RunVaspCustodian(vasp_cmd=vasp_cmd),
689-
pass_fw,
690-
]
691-
)
692-
else:
693-
t.append(RunVaspCustodian(vasp_cmd=vasp_cmd))
694-
695-
t.extend(
696-
[
697-
PassCalcLocs(name=name),
698-
VaspToDb(db_file=db_file, additional_fields={"task_label": name}),
699-
]
700-
)
701-
702-
super().__init__(
703-
t,
704-
parents=parents,
705-
name=f"{structure.composition.reduced_formula}-{name}",
706-
**kwargs,
707-
)
708-
709-
710594
class DFPTFW(Firework):
711595
def __init__(
712596
self,

atomate/vasp/workflows/base/library/dielectric_constant.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ fireworks:
44
- fw: atomate.vasp.fireworks.core.OptimizeFW
55
params:
66
ediffg: -0.05
7-
- fw: atomate.vasp.fireworks.core.LepsFW
7+
- fw: atomate.vasp.fireworks.core.DFPTFW
88
params:
99
parents: 0
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# static dielectric constant
22
# Author: Anubhav Jain ([email protected])
33
fireworks:
4-
- fw: atomate.vasp.fireworks.core.LepsFW
4+
- fw: atomate.vasp.fireworks.core.DFPTFW
55
params:
66
copy_vasp_outputs: False

atomate/vasp/workflows/base/library/piezoelectric_constant.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ fireworks:
55
params:
66
ediffg: -0.05
77
force_gamma: False
8-
- fw: atomate.vasp.fireworks.core.LepsFW
8+
- fw: atomate.vasp.fireworks.core.DFPTFW
99
params:
1010
name: "static piezoelectric"
1111
user_incar_settings:

docs/_sources/creating_workflows.rst.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Once you have identified each calculation or analysis step as a Firework in our
8989
* TransmuterFW
9090
* HSEBSFW
9191
* NonSCFFW
92-
* LepsFW
92+
* DFPTFW
9393
* SOCFW
9494
* MDFW
9595
* BoltztrapFW

docs_rst/creating_workflows.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ Once you have identified each calculation or analysis step as a Firework in our
8989
* TransmuterFW
9090
* HSEBSFW
9191
* NonSCFFW
92-
* LepsFW
92+
* DFPTFW
9393
* SOCFW
9494
* MDFW
9595
* BoltztrapFW

0 commit comments

Comments
 (0)