Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Molecular dynamics job #134

Merged
merged 45 commits into from Jul 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
bbe9b26
Add MDSetGenerator based on pymatgen MPMDSet
mjwen May 5, 2022
a44480d
Add MDMaker job
mjwen May 5, 2022
4a677f5
Attempt to add test
mjwen May 5, 2022
ff79d52
Allow different ensembles for MDSetGenerator, default to nvt
mjwen May 6, 2022
b4352a4
Add checking user incar setting
mjwen May 6, 2022
b552ca3
Merge branch 'main' into md
mjwen May 6, 2022
37e469c
Set custodian handler for MD run
mjwen May 6, 2022
d5b7a1f
Correct custodian handler for MD run
mjwen May 6, 2022
6edfdaa
Store trajectory as in additional data store
mjwen May 10, 2022
47a2101
Add MD to CalcType
mjwen May 10, 2022
cf6ece7
Add MD to get calc type function
mjwen May 10, 2022
7b02f67
Fix OutputSummary that uses info from ionic steps
mjwen May 10, 2022
6883d97
Remove incomplete test
mjwen May 10, 2022
57e164e
Fix annotation
mjwen May 10, 2022
e9fa8ab
Merge branch 'main' into md
mjwen Jun 29, 2022
e87b1b5
Add flag to store ionic_steps as pymatgen Trajectory
mjwen Jun 30, 2022
62abb2b
Use Trajectory object
mjwen Jun 30, 2022
31ee4df
Fix Trajectory as ionic steps
mjwen Jul 1, 2022
1e5d5ef
Store Trajectory in vasp_objects dict and let ionic_steps if not stor…
mjwen Jul 1, 2022
53da989
Make traj optional
mjwen Jul 1, 2022
675034f
Remove ionic step convergence check for MD run
mjwen Jul 1, 2022
d32fe25
Let MDset to match MPMDset params
mjwen Jul 1, 2022
7538108
Fix example code in test
mjwen Jul 2, 2022
6467e6c
Fix mock_vasp_run to accept kwargs
mjwen Jul 2, 2022
ac2a0dc
Update generating test doc such that the created si structure matches…
mjwen Jul 2, 2022
5bd060c
Add test for MD maker
mjwen Jul 3, 2022
0e0308e
Update test generating doc
mjwen Jul 3, 2022
ff083e8
Linting
mjwen Jul 3, 2022
48686be
Update test for task
mjwen Jul 3, 2022
c42cf11
Add trajectory checking test for MD maker
mjwen Jul 3, 2022
137af78
Merge branch 'main' into md
mjwen Jul 4, 2022
b7f4e89
Remove force POTIM=0.5 for H containing structure
mjwen Jul 4, 2022
84fa505
Minor tweak docs
mjwen Jul 5, 2022
00d7dbd
Change store_ionic_steps to store_trajectory
mjwen Jul 8, 2022
6bc888d
Restore func name to from_vasp_calc_doc
mjwen Jul 8, 2022
b9709c0
Make trajectory arg optional
mjwen Jul 8, 2022
b2a6c5d
Remove redundant docstring
mjwen Jul 8, 2022
0288471
Remove EDIFF_PER_ATOM, which could lead to large EDIFF, especially fo…
mjwen Jul 8, 2022
8adf37c
Fix MDMaker to store trajectory by default
mjwen Jul 8, 2022
02accd2
Regenerate enums.py
mjwen Jul 8, 2022
07df203
Merge branch 'main' into md
mjwen Jul 8, 2022
bde7f1c
Set ENCUT=520 and remove params that's the default in vasp
mjwen Jul 14, 2022
b9b8754
Add more default params for npt and remove support of nph
mjwen Jul 14, 2022
37becfb
Check incar settings
mjwen Jul 14, 2022
5c3d39c
Remove setting LAVE and LPLANE
mjwen Jul 14, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Expand Up @@ -61,3 +61,5 @@ docs/src/reference/atomate2.*
docs/reference/atomate2.*

.vscode/

.DS_Store
2 changes: 2 additions & 0 deletions src/atomate2/vasp/jobs/base.py
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
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
Expand Up @@ -16,6 +16,7 @@
"Static",
"Structure Optimization",
"Deformation",
"MD",
"Unrecognized",
]

Expand Down