The short version
- The species come from POTCAR, in the order of the counts line. The species-name line is only a label: keep it, and keep it in the same order as the POTCAR.
- Write coordinates with at least 7 significant digits, or VASP may find a lower symmetry than the crystal has.
- Use
Direct(fractional) coordinates; Cartesian ones are multiplied by the scaling factor. - Selective-dynamics flags act on the fractional (lattice-vector) components, not on x, y and z, except in IBRION = 5 phonon runs.
- Continue a relaxation with
cp CONTCAR POSCAR. A CONTCAR from MD carries velocities and more; strip them before using it elsewhere.
Check a POSCAR
Paste a POSCAR or CONTCAR. The checker reads it the way VASP does and reports the species, the cell, the shortest distance between atoms (periodic images included) and the problems it finds. It runs in your browser.
The format, line by line
| Line | Holds | Rules and traps |
|---|---|---|
| 1 | A comment | Free text. Old VASP 4 files put the element symbols here. |
| 2 | Scaling factor | One number multiplies the lattice vectors and Cartesian positions. A negative number is the cell volume in ų instead. Three positive numbers scale x, y and z separately. |
| 3–5 | Lattice vectors a1, a2, a3 | Cartesian components in Å (before scaling). A left-handed set (negative triple product) is fixed by swapping two vectors, together with the matching columns of the Direct coordinates. |
| 6 | Species names | Optional and only a label: VASP takes the species from POTCAR and keeps just 2 characters of each name, so Fe1 Fe2 both become Fe. If names and POTCAR disagree, VASP warns and uses POTCAR. |
| 7 | Atoms per species | In the order of the POTCAR. The same element may appear in two groups (Fe O Fe) to give them different per-species values, such as the U of DFT+U; MAGMOM is set per atom and needs no extra group. Machine-learned force fields reject two groups with the same name. |
| 8 | Selective dynamics | Optional; only the first letter (S) matters. Adds three T/F flags to each position line. |
| 9 | Direct or Cartesian | C or K as first letter means Cartesian (Å, scaled); anything else is Direct (fractional). |
| 10 … | One position per atom | As many lines as the sum of line 7, in the same species order. At least 7 significant digits. |
| After | Velocities and MD data | Written by VASP into CONTCAR during molecular dynamics: lattice velocities, then ion velocities (Å/fs when Cartesian; not scaled), then predictor–corrector data that cannot be written by hand. |
Examples
Cubic BN
3.615
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.25Al(100) slab, 3 layers, bottom 2 fixed
1.0
2.8637824 0.0000000 0.0000000
0.0000000 2.8637824 0.0000000
0.0000000 0.0000000 24.0500000
Al
3
Selective dynamics
Direct
0.0000000 0.0000000 0.0000000 F F F
0.5000000 0.5000000 0.0841996 F F F
0.0000000 0.0000000 0.1683992 T T TThe first two atoms stay fixed and the third relaxes. A flag constrains a fractional component, so T T F on a tilted cell is not the same as fixing z.
Si, simple cubic test cell, volume fixed by the scale
-40.0
1.0 0.0 0.0
0.0 1.0 0.0
0.0 0.0 1.0
Si
1
Direct
0.0 0.0 0.0Selective dynamics and fixed cells
- In relaxations and MD, the T/F flags refer to the fractional components of each position, whether the positions are written in Direct or Cartesian form.
- In finite-difference phonon runs the flags refer to Cartesian components, and only
IBRION = 5honours them. - Removing the
Selective dynamicsline frees every atom again. - Selective dynamics cannot constrain the cell. To keep the out-of-plane vector of a slab fixed while the in-plane ones relax, use LATTICE_CONSTRAINTS (from VASP 6.5.0 in practice; see the table below), or relax with a fixed cell (
ISIF = 2).
Reusing CONTCAR
- CONTCAR has the POSCAR format, so
cp CONTCAR POSCARcontinues a relaxation. - After molecular dynamics, CONTCAR also holds velocities and predictor–corrector data. Keep them to continue the same run; delete the predictor–corrector block before switching ensemble (NVT to NpT, say), or the run crashes; delete everything after the positions before using the structure for anything else.
- VASP 6.4.2 wrote POTCAR hash codes into the CONTCAR species line, which breaks phonopy and other tools; 6.4.3 copies your POSCAR labels again.
- Positions in CONTCAR after a long relaxation can carry numerical noise that lowers the symmetry: symmetrize with a symmetry tool before a production run if the symmetry matters.
Related INCAR tags
| Tag | What it does | Default | What to use | Watch out |
|---|---|---|---|---|
SYMPREC | Tolerance for finding symmetry from the POSCAR positions. | 1E-5 | Raise it only for imprecise coordinates. | |
LATTICE_CONSTRAINTS | Three logicals that freeze or free the lattice components during a cell relaxation or MD. | no constraints | Slab or 2D sheet: .TRUE. .TRUE. .FALSE. keeps the out-of-plane vector fixed. | With IBRION = 1 or 2 from VASP 6.4.3, with ISIF = 4 or 5 from 6.5.1; it was ignored for IBRION = 1 or 2 before 6.5.0. In non-orthogonal cells the angles are not conserved. |
Check what VASP read
sed -n '6,7p' POSCAR # species names and counts (VASP 5 and later format)
grep TITEL POTCAR # the potentials, one per species, in file order
grep "ions per type" OUTCAR # the counts VASP used
grep -A 4 "position of ions in fractional coordinates" OUTCAR # first positions; raise 4 to the number of atomsThe order of the TITEL lines must match the species line of POSCAR. The POTCAR sheet shows how to build and check a POTCAR without printing it.
Common mistakes
- Species order in POSCAR different from the POTCAR order: VASP only warns, and the run uses the wrong elements on the wrong sites.
- Expecting the species line to choose the element; POTCAR does.
- Long labels such as
Nd1 Nd2: both are truncated toNd, and with VASP's machine-learned force fields two groups with the same name stop the run. - Coordinates with too few digits (0.3333 for 1/3): lost symmetry.
- Cartesian positions with a scale other than 1: they are scaled too.
- Reading selective-dynamics flags as x, y, z in a relaxation.
- An MD CONTCAR, with its velocity blocks, reused for a different kind of run.
- A counts line that does not match the number of position lines.
The physics behind this sheet
- Lecture 13: The reciprocal lattice and the Brillouin zone (in preparation)
- Lecture 21: Forces, stress and structural relaxation (in preparation)
Further reading
- VASP Wiki, “POSCAR” (the full format specification, selective dynamics and velocities). · vasp.at/wiki
- VASP Wiki, “CONTCAR” (what VASP writes back, and restarting molecular dynamics). · vasp.at/wiki
- VASP Wiki, “LATTICE_CONSTRAINTS” (fixing lattice components in relaxations and MD). · vasp.at/wiki