POSCAR
The POSCAR file is a mandatory VASP input file. It is a plain text file and contains at least the lattice geometry and the ionic positions. Optionally, also starting velocities for a molecular-dynamics simulation can be provided here. This file shares its format with VASP output file CONTCAR. That may contain an additional section with predictor-corrector coordinates necessary for restarting molecular-dynamics runs.
Creating a POSCAR file is often the starting point of VASP-supported research. It can be written manually or obtained from various online materials and crystallographic databases providing a download in the POSCAR file format.
File format
Minimal example
In its simplest form the POSCAR file contains basic information about the lattice, per-element number of ions and their positions. This is sufficient in most situation where a VASP calculation is started from scratch. Have a look at this example for cubic boron nitride:
Cubic BN 3.57 0.0 0.5 0.5 0.5 0.0 0.5 0.5 0.5 0.0 B N 1 1 Direct 0.00 0.00 0.00 0.25 0.25 0.25
As indicated by the text coloring there are four blocks corresponding to the following file contents:
Comment line
The first line is reserved for a free user comment, e.g. a system description.
Scaling factor and lattice
In this block the first line specifies a universal lattice scaling factor . The next three lines define the lattice vectors. Each line holds the unscaled Cartesian components of one lattice vector. The actual lattice vectors and are the product of the given numbers with the lattice scaling factor. Set the universal scaling factor to 1 if you want to enter the lattice vectors directly and avoid any additional scaling.
Ion elements and numbers:
This section defines how many ions of each element are present. The first line lists the element names, the second specifies the number of ions for each element. The given order should match the order of elements appearing in the POTCAR file.
Ion positions:
Finally, the ion positions are listed in this section. The first line selects one of the two possible modes how the coordinates and given in the following lines are interpreted:
- "Direct" means the positions are provided in direct (fractional) coordinates:
where is the position vector of an ion.
- "Cartesian" specifies that positions are provided in a Cartesian coordinate system. However, the actual ion positions are also multiplied with the universal scaling factor, i.e.
The total number of lines with positions must match the total number of ions given in the previous section. The ion elements are also derived from there, i.e. in the example above it is implied that the list of positions contains one boron ion, followed by one nitrogen nuclei.
Full format specification
The POSCAR file format is constructed from multiple sections arranged in a predefined order. Some sections contain only a single line, others span over many lines, some may even be omitted. The following list defines the section order and their contents:
Section | Number of lines |
Required section? |
Content | |
---|---|---|---|---|
Comment | 1 |
mandatory | The first line is reserved for a free user comment, e.g. a system description. The maximum line length is 40 characters, extra characters are truncated. | |
Scaling factor(s) | 1 |
mandatory | This line may contain one or three numbers. If one number is provided it specifies a universal lattice scaling factor . It is multiplied with the three vectors in the following section to obtain the lattice vectors of the unit cell. Also, the ion positions are scaled with this factor if the "Cartesian" mode is selected (see section "Ion positions"). If the number is negative, it is interpreted as the desired cell volume. Then, the scaling factor is computed automatically to obtain the desired volume. If three numbers are provided in this line they act as individual scaling factors for the x-,y- and z-Cartesian components for the lattice vectors (and "Cartesian" mode ion positions). In this case all three numbers must be positive. | |
Lattice | 3 | mandatory | This sections contains three lines defining the lattice vectors. Each line holds the unscaled Cartesian components of one lattice vector. The actual lattice vectors and are the product of the given numbers with the lattice scaling factor s . Set the universal scaling factor to 1 if you want to enter the lattice vectors directly and avoid any additional scaling.
| |
Element names | 1 | optional | This line lists the elements of the present ions. The given order should match the order of elements appearing in the POTCAR file. This line is optional, if omitted the element names are taken from the POTCAR file. | |
Ions per element | 1 | mandatory | This mandatory line lists how many ions of each element are present. The given order should match the order of elements appearing in the POTCAR file. | |
Selective dynamics | 1 | optional | If the line after the "Ions per element" section contains Selective dynamics it enables the "selective dynamics" feature (actually only the first character is relevant and must be S or s). This allows to provide extra flags for each atom signaling whether the respective coordinate(s) of this atom will be allowed to change during the ionic relaxation. This setting is useful if only certain shells around a defect or layers near a surface should relax. See also the IBRION tag.
| |
Ion positions |
1 + #atoms | mandatory | Here, the ion positions are listed. The first line selects one of the two possible modes how the coordinates and given in the following lines are interpreted:
Actually, only the first character on the line is significant and the only key characters recognized are The total number of lines with positions must match the total number of ions given in the "Ions per element" section. The ion elements are also derived from there, e.g. if the "Ions per element" section lists If the selective dynamics feature is enabled on each coordinate triplet is followed by three additional logical flags, i.e. each is either
... Selective dynamics Cartesian 0.00 0.00 0.00 T F T 1.27 0.98 0.32 F T F ... Here, the first atom is allowed to move into the direction of the first and third direct lattice vector. The second atom may only move in the second lattice vector direction. If no initial velocities are provided, the file may end here. | |
Lattice velocities |
8 | from CONTCAR only | This section is usually not entered or edited by the user. It is written to the CONTCARcontains the lattice vectors and and their velocities. | |
Velocities | 1 + #atoms | optional | Entering velocities by hand is rarely done (one important case is e.g. using the tags IBRION=0 and SMASS=-2), but if done the velocities are provided at the end of the POSCAR file very similalry to the positions. As previously the first line supplies a switch between cartesian coordinates and direct coordinates. On the next lines the initial velocities are provided. They are given in units /fs (no multiplication with the scaling factor in this case) or (direct lattice vector/timestep).
When the initial velocities are supplied in the POSCAR and the tags IBRION=0 and SMASS=-2) are set, the velocities are kept constant during the MD allowing to calculate the energy for a set of different linear dependent positions (for instance frozen phonons and dimers with varying bond-length). Mind: For IBRION=0 and SMASS=-2 the actual steps taken are POTIM times read velocities. To avoid ambiguities, set POTIM to 1. In this case the velocities are simply interpreted as vectors, along which the ions are moved. For the cartesian switch, the vector is given in cartesian coordinates (, no multiplication with the scaling factor in this case) for the direct switch the vector is given in direct coordinates. | |
MD extra | variable | from CONTCAR only | The predictor-corrector coordinates are only provided to continue a molecular dynamic run from a CONTCAR file of a previous run, they can not be entered by hand. |
Examples
Cubic BN 3.57 0.0 0.5 0.5 0.5 0.0 0.5 0.5 0.5 0.0 B N 1 1 Selective dynamics Cartesian 0.00 0.00 0.00 T T F 0.25 0.25 0.25 F F F Cartesian 0.01 0.01 0.01 0.00 0.00 0.00 optionally predictor-corrector coordinates given on file CONTCAR of MD-run .... ....