Jump to content

Requests for technical support from the VASP team should be posted in the VASP Forum.

PLUGINS/OCCUPANCIES: Difference between revisions

From VASP Wiki
Schlipf (talk | contribs)
Schlipf (talk | contribs)
No edit summary
 
Line 12: Line 12:
<syntaxhighlight lang="python" line>
<syntaxhighlight lang="python" line>
def occupancies(constants, additions):
def occupancies(constants, additions):
    ...
</syntaxhighlight>
</syntaxhighlight>
where <code>constants</code> and <code>additions</code> and [https://docs.python.org/3/library/dataclasses.html Python dataclasses].
where <code>constants</code> and <code>additions</code> and [https://docs.python.org/3/library/dataclasses.html Python dataclasses].

Latest revision as of 10:07, 16 March 2026

PLUGINS/OCCUPANCIES = .True. | .False.
Default: PLUGINS/OCCUPANCIES = .False. 

Description: PLUGINS/OCCUPANCIES calls the Python plugin for the occupancies interface for each ionic relaxation step


When PLUGINS/OCCUPANCIES=.TRUE., VASP calls the occupancies Python function at the end of each ionic relaxation step. The primary use-case of this tag to recompute the occupancies after performing modifications through other plugins such as PLUGINS/LOCAL_POTENTIAL. It also allows changing NELECT, EFERMI, NUPDOWN, ISMEAR, SIGMA, EMIN and EMAX at the end of each SCF step, to be reflected in the next step.

Expected inputs

The occupancies Python function expects the following inputs,

def occupancies(constants, additions):
    ...

where constants and additions and Python dataclasses. The constants dataclass consists of the following inputs, listed here with their associated datatypes

@dataclass(frozen=True)
class ConstantsOccupancies:
    NELECT: float
    EFERMI: float
    NUPDOWN: float
    ISMEAR: int
    SIGMA: float
    EMIN: float
    EMAX: float

The additions dataclass consists of the same quantities as the constants tag.

Modifying quantities

Modify the quantities listed in additions by adding to them.

import numpy as np
def structure(constants, additions)
    additions.NELECT += 1

Related tags and articles

Plugins, PLUGINS/FORCE_AND_STRESS, PLUGINS/LOCAL_POTENTIAL, PLUGINS/STRUCTURE

Examples that use this tag