cell File
This is a basic overview of the cell file. See the full cell file page for more details.
The cell file is one of CASTEP's two main input files. It contains all of the information about the crystal lattice and the atomic positions, as well as additional information such as Brillouin zone sampling ('k-points'), pseudopotentials, and atomic properties.
The file itself is a free-format keyword-driven text file, consisting of keywords and blocks of information. These may be given in any order, with blocks indicated by the special %block
and %endblock
markers. Most of the keywords and blocks are optional, but CASTEP requires two block entries: a block to specify the lattice, and another to specify the atomic elements and positions within the cell.
Lattice
There are two main ways to set the crystal lattice in the cell file. The lattice_abc
block specifies the lattice constants in terms of the lengths of the lattice vectors (\mathbf{a}, \mathbf{b} and \mathbf{c}) and angles (alpha, beta and gamma):
Alternatively, you can specify the lattice vectors \mathbf{a}, \mathbf{b} and \mathbf{c} directly in terms of their Cartesian components, using the lattice_cart block. Note that these are specified as row vectors:
The first line is optional, and specifies a length unit; the default isang
, meaning Angstroms.
Atomic positions
The positions of the atoms within a cell may be specified in either fractional coordinates (i.e. the coordinates in the basis of the lattice vectors) or Cartesian coordinates:
wheresymbol
is the chemical symbol for the atomic element, and u
, v
and w
are the fractional components of the lattice vectors \mathbf{a}, \mathbf{b} and \mathbf{c}, respectively, such that the Cartesian positions vector of the atom, \mathbf{r}, is
To add a second atom, simply add a second line with the new information, and similarly for additional atoms.
An alternative is to specify the atomic coordinates with reference to their absolute Cartesian coordinates:
where[unit]
is an optional length unit (default: ang
, meaning Angstroms), symbol
is the chemical symbol for the atomic element, and x
, y
and z
are the Cartesian coordinates of the atom, such that the position vector, \mathbf{r}=(x,y,z).
Comments
It can be convenient to add comments to a cell file, not only to explain why certain choices were made, but also as a way of disabling input lines without removing them from the file. Both !
and #
are accepted as comment characters, and anything to the right of these will be ignored by CASTEP. For example, the cell section