aiida_cusp.workflows.vasp_multi_relax module

Multi-Relaxation Workchain for VASP Relaxations

class aiida_cusp.workflows.vasp_multi_relax.MultiRelaxWorkChain(*args: Any, **kwargs: Any)

Bases: WorkChain

Multi-Relaxation Workflow for VASP calculations.

Beside the usually required inputs for VASP calculations, i.e. POSCAR, KPOINTS and POTCAR, this workchain, instead of a single one, introduces a dynamical input namespace incars which accepts an arbitrary amount of INCAR entries of the form

incars = {
    'incar_1': VaspIncarData,
    'incar_2': VaspIncarData,

       ...

    'incar_N': VaspIncarData,
}

In the initial relaxation run the provided POSCAR, KPOINTS and POTCAR are used together with the INCAR provided at the first index, i.e. incar_1 to start the calculation. The workchain then proceeds to iterate over the given INCAR namespace and starts subsequent calculations from the given incar_2 up to the last incar_N. Note that for every restarted calculation the outputs of the previous calculation are used, with CONTCAR copied over to POSCAR, and only INCAR being overwritten with the data provided by the corresponding incar-namespace entry.

A flow chart illustrating which and how the provided resources are used within this workflow is show in the following:

{
    'incar_1': INCAR_DATA, ------.  POSCAR, KPOINTS, POTCAR
    'incar_2': INCAR_DATA, ----. |    |        |        |
                               | |    `--------+--------´
     ...                       | |             |
                               | |             |
    'incar_N': INCAR_DATA, --. | |             |
}                            | | |             V
                             | | '---> RELAXATION RUN 1
                             | |               |
                             | |            OUTPUTS
                             | |               |
                             | |               V
                             | '-----> RELAXATION RUN 2
                             |                 |
                             |              OUTPUTS
                             |                 |
                             |                 V
                             |                ...
                             |                 |
                             |                 V
                             '-------> RELAXATION RUN N
                                               |
                                               V
                                         FINAL OUTPUTS
assert_run_successful()

Make sure the previous run was successful

classmethod define(spec)

Define the specification of the process, including its inputs, outputs and known exit codes.

A metadata input namespace is defined, with optional ports that are not stored in the database.

get_current_step_name()

Creates the name of the current calculation step

get_next_incar_data()

Return INCAR data for next step

incar_not_exhausted()

Check the list of available INCARs before each run.

Returns True as long as there are INCARs stored in the internal list. Once the internal list is exhausted this function returns False effectively ending the relaxation loop and stopping the workchain

initialize_multi_relaxation()
register_workflow_outputs()

Simply register the outputs of the last calculation as workflow outputs

run_vasp_relaxation()

Run the VASP calculation

setup_calculation_inputs()

This function sets up the required inputs for the VASP calculation

verify_workflow_inputs()

Check and verify the given workchain inputs