Skip to content

Commit

Permalink
Merge pull request #13 from arosen93/rosen-docs
Browse files Browse the repository at this point in the history
Add more information to docs about modifying input settings
  • Loading branch information
utf authored Nov 25, 2021
2 parents 43581cf + 9d91968 commit 9c9d863
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 4 deletions.
42 changes: 40 additions & 2 deletions docs/src/user/codes/vasp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ differences are:
.. warning::

The different input sets used in atomate2 mean total energies cannot be compared
against energies taken from the Materials Project.
against energies taken from the Materials Project unless the default settings are
modified accordingly.

Configuration
-------------
Expand Down Expand Up @@ -220,7 +221,7 @@ written:
static_job.maker.input_set_generator.user_incar_settings["LOPTICS"] = True
Finally, sometimes you have workflow containing many VASP jobs. In this case it can be
Finally, sometimes you have a workflow containing many VASP jobs. In this case it can be
tedious to update the input sets for each job individually. Atomate2 provides helper
functions called "powerups" that can apply settings updates to all VASP jobs in a flow.
These powerups also contain filters for the name of the job and the maker used to
Expand All @@ -244,6 +245,43 @@ generate them.
# only update VASP jobs which were generated by an ElasticRelaxMaker
update_user_incar_settings(elastic_flow, {"ENCUT": 200}, class_filter=ElasticRelaxMaker)
In addition to the ability to change INCAR parameters on-the-fly, the :obj:`.VaspInputSetGenerator`,
``Maker`` object, and "powerups" allow for the manual modification of several additional VASP
settings, such as the k-points (``user_kpoints_settings``) and choice of pseudopotentials
(``user_potcar_settings``).

If a greater degree of flexibility is needed, the user can define a default set of input
arguments (``config_dict``) that can be provided to the :obj:`.VaspInputSetGenerator`. By default,
the :obj:`.VaspInputSetGenerator` uses a base set of VASP input parameters from [BaseVaspSet.yaml](/src/atomate2/vasp/sets/BaseVaspSet.yaml),
which each ``Maker`` is built upon. If desired, the user can define a custom ``.yaml`` file
that contains a different base set of VASP settings to use (e.g. ``MPRelaxSet``). An example of how
this can be done is shown below for a reprsentative static calculation.

.. code-block:: python
from atomate2.vasp.sets.core import StaticSetGenerator
from atomate2.vasp.jobs.core import StaticMaker
from atomate2.vasp.jobs.base import VaspInputSetGenerator
from monty.serialization import loadfn
# read in a custom config dictionary
user_config_dict = loadfn("/path/to/my/CustomVaspSet.yaml")
# create a custom input set generator with user-defined defaults
# also change the NELMIN parmaeter to 6 if it wasn't already
# this value in the config_dict (for demonstration purposes)
vis_generator = VaspInputSetGenerator(
user_incar_settings={"NELMIN": 6},
config_dict=user_config_dict,
)
my_custom_set = StaticSetGenerator(vis_generator)
# initialise the static maker to use the custom input set generator
static_maker = StaticMaker(input_set_generator=my_custom_set)
# create a job using the customised maker
static_job = static_maker.make(structure)
.. _connecting_vasp_jobs:

Chaining workflows
Expand Down
2 changes: 1 addition & 1 deletion docs/src/user/fireworks.rst
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ submit an MgO band structure workflow using FireWorks:
)
# make a band structure flow to optimise the structure and obtain the band structure
bandstructure_flow = RelaxBandStructureMaker().make(si_structure)
bandstructure_flow = RelaxBandStructureMaker().make(mgo_structure)
# convert the flow to a fireworks WorkFlow object
wf = flow_to_workflow(bandstructure_flow)
Expand Down
2 changes: 1 addition & 1 deletion src/atomate2/vasp/sets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ class VaspInputSetGenerator(InputSetGenerator):
when generating the input set from a previous VASP directory.
constrain_total_magmom
Whether to constrain the total magmom (NUPDOWN in INCAR) to be the sum of the
expected MAGMOM for all species.
initial MAGMOM guess for all species.
validate_magmom
Ensure that missing magmom values are filled in with the default value of 1.0.
use_structure_charge
Expand Down

0 comments on commit 9c9d863

Please sign in to comment.