Skip to content

Commit

Permalink
refactor neb module 🎷 (#386)
Browse files Browse the repository at this point in the history
  • Loading branch information
jacksund authored Mar 6, 2023
1 parent a8fcba5 commit ed7d874
Show file tree
Hide file tree
Showing 16 changed files with 411 additions and 29 deletions.
2 changes: 2 additions & 0 deletions src/simmate/apps/vasp/workflows/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from .diffusion import (
Diffusion__Vasp__NebAllPathsMit,
Diffusion__Vasp__NebAllPathsWarrenLab,
Diffusion__Vasp__NebAllPathsWarrenLabQuick,
Diffusion__Vasp__NebFromEndpointsMit,
Diffusion__Vasp__NebFromImagesMit,
Diffusion__Vasp__NebFromImagesMvlCi,
Expand Down
15 changes: 10 additions & 5 deletions src/simmate/apps/vasp/workflows/diffusion/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,13 @@
# circular imports errors, so we prevent isort from changing this file.
# isort: skip_file

from .neb_all_paths_mit import Diffusion__Vasp__NebAllPathsMit
from .neb_from_endpoints_mit import Diffusion__Vasp__NebFromEndpointsMit
from .neb_from_images_mit import Diffusion__Vasp__NebFromImagesMit
from .neb_from_images_mvl_ci import Diffusion__Vasp__NebFromImagesMvlCi
from .neb_single_path_mit import Diffusion__Vasp__NebSinglePathMit
from .mit import (
Diffusion__Vasp__NebAllPathsMit,
Diffusion__Vasp__NebFromEndpointsMit,
Diffusion__Vasp__NebFromImagesMit,
Diffusion__Vasp__NebFromImagesMvlCi,
Diffusion__Vasp__NebSinglePathMit,
)

from .warren_lab import Diffusion__Vasp__NebAllPathsWarrenLab
from .warren_lab_quick import Diffusion__Vasp__NebAllPathsWarrenLabQuick
11 changes: 11 additions & 0 deletions src/simmate/apps/vasp/workflows/diffusion/mit/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# -*- coding: utf-8 -*-

# The order that we import these different modules is important to prevent
# circular imports errors, so we prevent isort from changing this file.
# isort: skip_file

from .from_images import Diffusion__Vasp__NebFromImagesMit
from .from_images_mvl_ci import Diffusion__Vasp__NebFromImagesMvlCi
from .from_endpoints import Diffusion__Vasp__NebFromEndpointsMit
from .single_path import Diffusion__Vasp__NebSinglePathMit
from .all_paths import Diffusion__Vasp__NebAllPathsMit
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# -*- coding: utf-8 -*-

from simmate.apps.vasp.workflows.diffusion.neb_all_paths_base import NebAllPathsWorkflow
from simmate.apps.vasp.workflows.diffusion.neb_single_path_mit import (
Diffusion__Vasp__NebSinglePathMit,
)
from simmate.apps.vasp.workflows.diffusion.mit import Diffusion__Vasp__NebSinglePathMit
from simmate.apps.vasp.workflows.diffusion.neb_base import NebAllPathsWorkflow
from simmate.apps.vasp.workflows.relaxation.mit import Relaxation__Vasp__Mit
from simmate.apps.vasp.workflows.static_energy.mit import StaticEnergy__Vasp__Mit

Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# -*- coding: utf-8 -*-

from simmate.apps.vasp.workflows.diffusion.neb_from_endpoints_base import (
NebFromEndpointWorkflow,
)
from simmate.apps.vasp.workflows.diffusion.neb_from_images_mit import (
Diffusion__Vasp__NebFromImagesMit,
)
from simmate.apps.vasp.workflows.diffusion.mit import Diffusion__Vasp__NebFromImagesMit
from simmate.apps.vasp.workflows.diffusion.neb_base import NebFromEndpointWorkflow
from simmate.apps.vasp.workflows.relaxation.mvl_neb_endpoint import (
Relaxation__Vasp__MvlNebEndpoint,
)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
# -*- coding: utf-8 -*-

from simmate.apps.vasp.error_handlers import Walltime
from simmate.apps.vasp.workflows.diffusion.neb_from_images_base import (
VaspNebFromImagesWorkflow,
)
from simmate.apps.vasp.error_handlers import Frozen, Unconverged, Walltime
from simmate.apps.vasp.workflows.diffusion.neb_base import VaspNebFromImagesWorkflow
from simmate.apps.vasp.workflows.relaxation.mit import Relaxation__Vasp__Mit


Expand Down Expand Up @@ -39,5 +37,5 @@ class Diffusion__Vasp__NebFromImagesMit(
error_handlers = [
handler
for handler in Relaxation__Vasp__Mit.error_handlers
if type(handler) not in [Walltime]
if type(handler) not in [Walltime, Unconverged, Frozen]
]
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
# -*- coding: utf-8 -*-

from simmate.apps.vasp.workflows.diffusion.neb_from_images_mit import (
Diffusion__Vasp__NebFromImagesMit,
)
from simmate.apps.vasp.workflows.diffusion.mit import Diffusion__Vasp__NebFromImagesMit


class Diffusion__Vasp__NebFromImagesMvlCi(Diffusion__Vasp__NebFromImagesMit):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
# -*- coding: utf-8 -*-

from simmate.apps.vasp.workflows.diffusion.neb_from_images_mit import (
Diffusion__Vasp__NebFromImagesMit,
)
from simmate.apps.vasp.workflows.diffusion.neb_single_path_base import (
SinglePathWorkflow,
)
from simmate.apps.vasp.workflows.diffusion.mit import Diffusion__Vasp__NebFromImagesMit
from simmate.apps.vasp.workflows.diffusion.neb_base import SinglePathWorkflow
from simmate.apps.vasp.workflows.relaxation.mvl_neb_endpoint import (
Relaxation__Vasp__MvlNebEndpoint,
)
Expand Down
10 changes: 10 additions & 0 deletions src/simmate/apps/vasp/workflows/diffusion/neb_base/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# -*- coding: utf-8 -*-

# The order that we import these different modules is important to prevent
# circular imports errors, so we prevent isort from changing this file.
# isort: skip_file

from .all_paths import NebAllPathsWorkflow
from .from_endpoints import NebFromEndpointWorkflow
from .from_images import VaspNebFromImagesWorkflow
from .single_path import SinglePathWorkflow
211 changes: 211 additions & 0 deletions src/simmate/apps/vasp/workflows/diffusion/warren_lab.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,211 @@
# -*- coding: utf-8 -*-

from simmate.apps.vasp.inputs.potcar_mappings import PBE_ELEMENT_MAPPINGS
from simmate.apps.vasp.workflows.base import VaspWorkflow
from simmate.apps.vasp.workflows.diffusion.neb_base import (
NebAllPathsWorkflow,
SinglePathWorkflow,
VaspNebFromImagesWorkflow,
)

# -----------------------------------------------------------------------------

# BULK UNITCELL RELAXATION


class Relaxation__Vasp__WarrenLab(VaspWorkflow):
functional = "PBE"
potcar_mappings = PBE_ELEMENT_MAPPINGS
incar = dict(
ALGO="Fast",
EDIFF=1e-06,
ENCUT=520, # TODO: set dynamically to be 1.3x highest elemental ENMAX
IBRION=2,
ICHARG=1,
ISIF=3,
ISPIN=2,
ISYM=0,
IVDW=12,
LORBIT=11,
LREAL="Auto",
LWAVE=False,
# MAGMOM = # TODO: set dynamically
NELM=200,
NELMIN=4,
NSW=99,
PREC="Accurate",
ISMEAR=0,
SIGMA=0.05,
KSPACING=0.35,
LMAXMIX=4,
)
error_handlers = []


# -----------------------------------------------------------------------------

# BULK UNITCELL STATIC ENERGY


class StaticEnergy__Vasp__WarrenLab(VaspWorkflow):
functional = "PBE"
potcar_mappings = PBE_ELEMENT_MAPPINGS
incar = dict(
ALGO="Fast",
EDIFF=1e-06,
ENCUT=520, # TODO: set dynamically to be 1.3x highest elemental ENMAX
IBRION=-1,
ICHARG=1,
ISIF=3,
ISPIN=2,
ISYM=0,
IVDW=12,
LORBIT=11,
LREAL="Auto",
LWAVE=False,
# MAGMOM = # TODO: set dynamically
NELM=200,
NELMIN=4,
NSW=0,
PREC="Accurate",
ISMEAR=0,
SIGMA=0.05,
KSPACING=0.35,
LMAXMIX=4,
)
error_handlers = []


# -----------------------------------------------------------------------------

# ENDPOINT SUPERCELL RELAXATIONS


class Relaxation__Vasp__WarrenLabNebEndpoint(VaspWorkflow):
functional = "PBE"
potcar_mappings = PBE_ELEMENT_MAPPINGS
incar = dict(
ALGO="Fast",
EDIFF=5e-05,
EDIFFG=-0.01,
ENCUT=520, # TODO: set dynamically to be 1.3x highest elemental ENMAX
IBRION=2,
ICHARG=1,
ISIF=2,
ISPIN=2,
ISYM=0,
IVDW=12,
LORBIT=11,
LREAL="Auto",
LWAVE=False,
LCHARG=False,
# MAGMOM = # TODO: set dynamically
NELM=200,
NSW=99,
PREC="Accurate",
ISMEAR=0,
SIGMA=0.05,
KSPACING=0.4,
LMAXMIX=4,
)
error_handlers = []


# -----------------------------------------------------------------------------

# ENDPOINT SUPERCELL STATIC ENERGY


class StaticEnergy__Vasp__WarrenLabNebEndpoint(VaspWorkflow):
functional = "PBE"
potcar_mappings = PBE_ELEMENT_MAPPINGS
incar = dict(
ALGO="Fast",
EDIFF=5e-05,
EDIFFG=-0.01,
ENCUT=520, # TODO: set dynamically to be 1.3x highest elemental ENMAX
IBRION=-1,
ICHARG=1,
ISIF=2,
ISPIN=2,
ISYM=0,
IVDW=12,
LORBIT=11,
LREAL="Auto",
LWAVE=False,
LCHARG=False,
# MAGMOM = # TODO: set dynamically
NELM=200,
NSW=0,
PREC="Accurate",
ISMEAR=0,
SIGMA=0.05,
KSPACING=0.4,
LMAXMIX=4,
)
error_handlers = []


# -----------------------------------------------------------------------------

# NEB FROM IMAGES


class Diffusion__Vasp__WarrenLabCiNebFromImages(VaspNebFromImagesWorkflow):
functional = "PBE"
potcar_mappings = PBE_ELEMENT_MAPPINGS
incar = dict(
ALGO="Fast",
EDIFF=5e-05,
EDIFFG=-0.01,
ENCUT=520, # TODO: set dynamically to be 1.3x highest elemental ENMAX
IBRION=3,
ICHARG=1,
ISIF=2,
ISPIN=2,
ISYM=0,
IVDW=12,
LORBIT=11,
LREAL="Auto",
LWAVE=False,
LCHARG=False,
# MAGMOM = # TODO: set dynamically
NELM=200,
NSW=99,
PREC="Accurate",
ISMEAR=0,
SIGMA=0.05,
KSPACING=0.4,
LMAXMIX=4,
NIMAGES=5,
LCLIMB=True,
SPRING=-5,
POTIM=0,
IOPT=1,
)
error_handlers = []


# -----------------------------------------------------------------------------

# SINGLE PATH NEB


class Diffusion__Vasp__WarrenLabNebSinglePath(SinglePathWorkflow):
endpoint_relaxation_workflow = Relaxation__Vasp__WarrenLabNebEndpoint
endpoint_energy_workflow = StaticEnergy__Vasp__WarrenLabNebEndpoint
from_images_workflow = Diffusion__Vasp__WarrenLabCiNebFromImages


# -----------------------------------------------------------------------------

# ALL PATHS NEB


class Diffusion__Vasp__NebAllPathsWarrenLab(NebAllPathsWorkflow):
bulk_relaxation_workflow = Relaxation__Vasp__WarrenLab
bulk_static_energy_workflow = StaticEnergy__Vasp__WarrenLab
single_path_workflow = Diffusion__Vasp__WarrenLabNebSinglePath


# -----------------------------------------------------------------------------
Loading

0 comments on commit ed7d874

Please sign in to comment.