Skip to content

Commit

Permalink
add adapted makers
Browse files Browse the repository at this point in the history
  • Loading branch information
naik-aakash committed Jan 26, 2024
1 parent 7bd29b9 commit 27560d1
Showing 1 changed file with 96 additions and 0 deletions.
96 changes: 96 additions & 0 deletions autoplex/data/flows.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

if TYPE_CHECKING:
from atomate2.vasp.jobs.base import BaseVaspMaker
from atomate2.vasp.sets.base import VaspInputGenerator
from emmet.core.math import Matrix3D
from pymatgen.core.structure import Species, Structure
from atomate2.common.jobs.phonons import (
Expand All @@ -28,6 +29,100 @@
__all__ = ["RandomStructuresDataGenerator", "IsoAtomMaker"]


@dataclass
class APPhononDisplacementMaker(PhononDisplacementMaker):
"""Adapted phonon displacement maker for static calculation.
The input set is for a static run same as PhononDisplacementMaker.
Only difference is Spin polarization is switched off and Gaussian smearing is used
Parameters
----------
name : str
The job name.
input_set_generator : .VaspInputGenerator
A generator used to make the input set.
write_input_set_kwargs : dict
Keyword arguments that will get passed to :obj:`.write_vasp_input_set`.
copy_vasp_kwargs : dict
Keyword arguments that will get passed to :obj:`.copy_vasp_outputs`.
run_vasp_kwargs : dict
Keyword arguments that will get passed to :obj:`.run_vasp`.
task_document_kwargs : dict
Keyword arguments that will get passed to :obj:`.TaskDoc.from_directory`.
stop_children_kwargs : dict
Keyword arguments that will get passed to :obj:`.should_stop_children`.
write_additional_data : dict
Additional data to write to the current directory. Given as a dict of
{filename: data}. Note that if using FireWorks, dictionary keys cannot contain
the "." character which is typically used to denote file extensions. To avoid
this, use the ":" character, which will automatically be converted to ".". E.g.
``{"my_file:txt": "contents of the file"}``.
"""

input_set_generator: VaspInputGenerator = field(
default_factory=lambda: StaticSetGenerator(
user_kpoints_settings={"reciprocal_density": 100},
user_incar_settings={
"IBRION": 2,
"ISPIN": 1,
"ISMEAR": 0,
"ISIF": 3,
"ENCUT": 700,
"EDIFF": 1e-7,
"LAECHG": False,
"LREAL": False,
"ALGO": "Normal",
"NSW": 0,
"LCHARG": False,
},
auto_ispin=False,
)
)


@dataclass
class IsoAtomStaticMaker(StaticMaker):
"""
Maker to create Isolated atoms static jobs.
Parameters
----------
name : str
The job name.
input_set_generator : .VaspInputGenerator
A generator used to make the input set.
write_input_set_kwargs : dict
Keyword arguments that will get passed to :obj:`.write_vasp_input_set`.
copy_vasp_kwargs : dict
Keyword arguments that will get passed to :obj:`.copy_vasp_outputs`.
run_vasp_kwargs : dict
Keyword arguments that will get passed to :obj:`.run_vasp`.
task_document_kwargs : dict
Keyword arguments that will get passed to :obj:`.TaskDoc.from_directory`.
stop_children_kwargs : dict
Keyword arguments that will get passed to :obj:`.should_stop_children`.
write_additional_data : dict
Additional data to write to the current directory. Given as a dict of
{filename: data}. Note that if using FireWorks, dictionary keys cannot contain
the "." character which is typically used to denote file extensions. To avoid
this, use the ":" character, which will automatically be converted to ".". E.g.
``{"my_file:txt": "contents of the file"}``.
"""

name: str = "static"
input_set_generator: VaspInputGenerator = field(
default_factory=lambda: StaticSetGenerator(
user_kpoints_settings={"reciprocal_density": 1},
user_incar_settings={
"ISPIN": 1,
"LAECHG": False,
"ISMEAR": 0,
},
)
)


@dataclass
class RandomStructuresDataGenerator(Maker):
"""
Expand Down Expand Up @@ -163,6 +258,7 @@ def make(self, all_species: list[Species]):
user_kpoints_settings={"grid_density": 1},
),
).make(iso_atom)

isoatom_calcs = update_user_incar_settings(
isoatom_calcs,
{"NPAR": 4, "ISPIN": 1, "LAECHG": False, "ISMEAR": 0},
Expand Down

0 comments on commit 27560d1

Please sign in to comment.