Skip to content

Commit

Permalink
Merge branch 'main' into abinit_scf
Browse files Browse the repository at this point in the history
  • Loading branch information
utf authored Aug 22, 2022
2 parents 0009968 + 277817a commit d11fec8
Show file tree
Hide file tree
Showing 25 changed files with 573 additions and 184 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,5 @@ docs/src/reference/atomate2.*
docs/reference/atomate2.*

.vscode/

.DS_Store
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ repos:
- id: rst-directive-colons
- id: rst-inline-touching-normal
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v0.961
rev: v0.971
hooks:
- id: mypy
files: ^src/
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ It is easy to customise and compose any of the above workflows.

## Quick start

Workflows in atomate2 written using the [jobflow] library. Workflows are generated using
`Maker` objects, that have a consistent API for modifying input settings and chaining
workflows together. Below, we demonstrate how to run a band structure workflow
Workflows in atomate2 are written using the [jobflow] library. Workflows are generated using
`Maker` objects which have a consistent API for modifying input settings and chaining
workflows together. Below, we demonstrate how to run a band structure workflow
(see the [documentation][RelaxBandStructure] for more details). In total, 4 VASP
calculations will be performed:

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ classifiers = [
]
requires-python = '>="3.8"'
dependencies = [
'pymatgen>=2022.3.22',
'pymatgen>=2022.7.8',
'custodian>=2019.8.24',
"pydantic",
"monty",
Expand Down Expand Up @@ -57,7 +57,7 @@ tests = [
]
strict = [
"pydantic==1.9.0",
"pymatgen==2022.5.17",
"pymatgen==2022.7.8",
"custodian==2022.2.13",
"monty==2022.4.26",
"jobflow==0.1.8",
Expand Down
2 changes: 2 additions & 0 deletions src/atomate2/vasp/jobs/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
from monty.serialization import dumpfn
from monty.shutil import gzip_dir
from pymatgen.core import Structure
from pymatgen.core.trajectory import Trajectory
from pymatgen.electronic_structure.bandstructure import (
BandStructure,
BandStructureSymmLine,
Expand All @@ -34,6 +35,7 @@
Locpot,
Chgcar,
Wavecar,
Trajectory,
"force_constants",
"normalmode_eigenvecs",
]
Expand Down
67 changes: 67 additions & 0 deletions src/atomate2/vasp/jobs/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,15 @@
from dataclasses import dataclass, field
from pathlib import Path

from custodian.vasp.handlers import (
FrozenJobErrorHandler,
IncorrectSmearingHandler,
LargeSigmaHandler,
MeshSymmetryErrorHandler,
PositiveEnergyErrorHandler,
StdErrHandler,
VaspErrorHandler,
)
from pymatgen.alchemy.materials import TransformedStructure
from pymatgen.alchemy.transmuters import StandardTransmuter
from pymatgen.core.structure import Structure
Expand All @@ -17,6 +26,7 @@
HSERelaxSetGenerator,
HSEStaticSetGenerator,
HSETightRelaxSetGenerator,
MDSetGenerator,
NonSCFSetGenerator,
RelaxSetGenerator,
StaticSetGenerator,
Expand All @@ -36,6 +46,7 @@
"TightRelaxMaker",
"HSETightRelaxMaker",
"TransmuterMaker",
"MDMaker",
]


Expand Down Expand Up @@ -519,6 +530,62 @@ def make(
return super().make.original(self, structure, prev_vasp_dir)


@dataclass
class MDMaker(BaseVaspMaker):
"""
Maker to create VASP molecular dynamics jobs.
Parameters
----------
name : str
The job name.
input_set_generator : .VaspInputSetGenerator
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:`.TaskDocument.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 = "molecular dynamics"

input_set_generator: VaspInputGenerator = field(default_factory=MDSetGenerator)

# Explicitly pass the handlers to not use the default ones. Some default handlers
# such as PotimErrorHandler do not apply to MD runs.
run_vasp_kwargs: dict = field(
default_factory=lambda: {
"handlers": (
VaspErrorHandler(),
MeshSymmetryErrorHandler(),
PositiveEnergyErrorHandler(),
FrozenJobErrorHandler(),
StdErrHandler(),
LargeSigmaHandler(),
IncorrectSmearingHandler(),
)
}
)

# Store ionic steps info in a pymatgen Trajectory object instead of in the output
# document.
task_document_kwargs: dict = field(
default_factory=lambda: {"store_trajectory": True}
)


def _get_transformations(
transformations: tuple[str, ...], params: tuple[dict, ...] | None
):
Expand Down
1 change: 1 addition & 0 deletions src/atomate2/vasp/schemas/calc_types/_generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"Static",
"Structure Optimization",
"Deformation",
"MD",
"Unrecognized",
]

Expand Down
Loading

0 comments on commit d11fec8

Please sign in to comment.