CIF file reader
For loading crystal structures stored in the Crystallographic Information File (CIF) format, the standard text format for crystallographic data defined by the International Union of Crystallography (IUCr). CIF files are distributed by crystal structure databases such as the Crystallography Open Database, the Cambridge Structural Database, the ICSD, and the Materials Project, and can be written by many crystallography and materials modeling programs. OVITO can directly load gzipped CIF files (“.gz” suffix).
The file reader is intended for small-molecule and inorganic crystal structure files, in which the atomic sites of the
asymmetric unit are listed in the _atom_site_ category using fractional coordinates. Macromolecular structures stored in the
PDBx/mmCIF dialect of the CIF syntax are handled by OVITO’s separate mmCIF file reader instead.
Which of the two readers is used is decided automatically based on the file contents: files containing _atom_site_ items
(underscore separator) are loaded by the CIF reader described here, files containing _atom_site. items (dot separator) by the mmCIF reader.
Imported data
The file reader parses the following data items of the (single) data block contained in the CIF file:
- Unit cell
The cell parameters (
_cell_length_a,_cell_length_b,_cell_length_c,_cell_angle_alpha,_cell_angle_beta,_cell_angle_gamma) are converted to a triclinic simulation cell with periodic boundary conditions enabled in all three directions. The cell vector \(\mathbf{a}\) is aligned with the Cartesian x-axis and \(\mathbf{b}\) lies in the x-y plane. If the file contains no cell parameters, an axis-aligned bounding box may be generated instead (see Generate bounding box if needed option below).- Symmetry
The space group of the structure is determined from the list of symmetry operations (
_space_group_symop_operation_xyzor_symmetry_equiv_pos_as_xyz), or, if no explicit list is present, from the Hall symbol (_space_group_name_Hall) or the Hermann–Mauguin symbol (_space_group_name_H-M_altor_symmetry_space_group_name_H-M). The file reader applies the symmetry operations to the atomic sites of the asymmetric unit to generate all atoms of the complete unit cell. Symmetry-equivalent copies of an atom that coincide (atoms on special positions) are generated only once. If the file contains no symmetry information at all, the listed atomic sites are imported as they are.- Atomic sites
Each row of the
_atom_site_loop is read as one atom. The file reader creates the following per-atom properties:Position — computed from the fractional coordinates (
_atom_site_fract_x,_atom_site_fract_y,_atom_site_fract_z) and the cell parameters. All atoms are wrapped into the unit cell during import.Particle Type — the chemical element read from
_atom_site_type_symbol, or derived from the site label if this data item is absent. The atomic number of the element is used as numeric type ID, and OVITO assigns the standard CPK color and display radius of the element.Atom Name — the site label (
_atom_site_label), e.g.C1orO2. Symmetry-equivalent atoms generated from the same site share the same name.Charge — the formal charge stated as part of the type symbol, e.g.
Fe3+orO2-. This property is created only if at least one site in the file carries a non-zero charge.
- Sites with partial occupancy
If the
_atom_site_occupancycolumn is present and contains values other than 1, the file reader merges all partially occupied sites located at identical coordinates into a single atom. Such a multi-element atom is assigned a dedicated particle type, whose name is formed from the element symbols and the corresponding occupancies in percent, e.g.Ca35Sr65for a site that is shared by calcium (35%) and strontium (65%). These particle types get numeric IDs starting at 1000 to distinguish them from the regular element types, and the atoms receive the nameMultiin the Atom Name property. Additionally, the file reader creates the vector particle property Occupancy, which has one component per chemical element occurring in the file and stores the occupancy fractions of every atom. A partially occupied site that does not share its position with any other site is also converted to a multi-element atom (e.g. typeH71for a hydrogen site with occupancy 0.71) and represented by a single-element entry in the Occupancy property.
Limitations
Only CIF files consisting of a single
data_block can be loaded. Files containing several data blocks (e.g. multiple structures) are rejected.Atomic coordinates must be given as fractional coordinates. The Cartesian coordinate data items (
_atom_site_Cartn_x, etc.) are not supported.CIF files store a single structure; the file reader does not support trajectories or animation sequences.
Atomic displacement parameters (
_atom_site_U_iso_or_equiv,_atom_site_B_iso_or_equiv,_atom_site_aniso_), disorder groups (_atom_site_disorder_group), and all other data categories of the CIF file (chemical formula, bibliographic information, diffraction data, geometry tables, etc.) are ignored.The CIF format does not store bonds. OVITO can generate them during import using the Generate bonds option (see below). Note that no bonds are created for multi-element atoms representing sites with partial occupancy, because their particle types do not correspond to a single chemical element.
Options
- Generate bounding box if needed
If this option is enabled and the CIF file does not specify the unit cell parameters, OVITO will generate an axis-aligned bounding box enclosing all atoms. This bounding box has open boundary conditions and serves as an approximate simulation cell.
- Center simulation cell on coordinate origin
If enabled, OVITO shifts the simulation cell and all atom coordinates so that the geometric center of the cell coincides with the coordinate origin. Otherwise, the origin of the unit cell is placed at the coordinate origin.
- Generate bonds
Lets OVITO create bonds between the atoms during import, using one of the parameter-free criteria of the Create bonds modifier. Bonds crossing the periodic cell boundaries are handled correctly.
- Van der Waals radii
Two atoms are connected if their distance is smaller than 0.6 times the sum of their van der Waals radii. No bonds are created between two hydrogen atoms.
- Covalent radii
Bonds are created based on the covalent radii and the maximum coordination numbers of the chemical elements.
- VESTA-like
Bonds are created according to the built-in table of element-pair bond distances adopted from the VESTA program. This mode is typically the most suitable one for inorganic crystal structures.
Alternatively, you can apply the Create bonds modifier to the loaded structure, which provides more control over the generation of bonds.
Python parameters
The file reader accepts the following optional keyword parameters in a call to the import_file() or load() Python functions.
- import_file(location, bounding_box=False, centering=False, generate_bonds='off')
- Parameters:
bounding_box (bool) – Generate an ad-hoc simulation cell as a bounding box around the imported atoms when the file contains no unit cell parameters.
centering (bool) – Translate atom coordinates and simulation cell to center them at the coordinate origin.
generate_bonds (str) – Controls the generation of ad-hoc bonds connecting the atoms loaded from the file. The bond criterion can be based on the van der Waals radii of the chemical elements (
'vdw'), on their covalent radii and maximum coordination numbers ('covalent'), or on the built-in table of element-pair bond distances adopted from the VESTA program ('vesta').'off'disables bond generation. These criteria correspond to the modes of theCreateBondsModifier, which you can alternatively apply to the system after import for more control over the generation of bonds.
Added in version 3.17.0: The generate_bonds option is now supported by the CIF file reader.