FHI-aims file reader
For loading atomic structures written in the file formats of the ab initio simulation package FHI-aims. OVITO provides two separate readers for this code, which are both described on this page:
The geometry file reader loads the
geometry.ininput files of FHI-aims, which specify the atomic structure of a calculation. It also reads thegeometry.in.next_steprestart files that FHI-aims writes during a structure relaxation.The log file reader loads the standard output (log) written by FHI-aims during a run and extracts the sequence of atomic structures generated during a geometry relaxation as a trajectory.
OVITO can directly load gzipped files of both types (“.gz” suffix). All coordinates are taken as Angstrom units, as in FHI-aims.
Geometry files
The geometry.in format is a simple line-based text format described in the FHI-aims manual. Each line starts with a keyword
followed by its values; everything from a # character to the end of a line is a comment. The file reader recognizes the following keywords:
lattice_vectorThe three Cartesian lattice vectors of a periodic system. If exactly three
lattice_vectorlines are present, they are converted to a simulation cell with periodic boundary conditions enabled in all three directions. The lattice vectors may appear anywhere in the file, also after the atom lines. If the file contains no lattice vectors, the system is treated as non-periodic and OVITO creates no simulation cell unless the Generate bounding box if needed option is enabled (see below). Files with only one or two lattice vectors are handled the same way as files without any. More than three lattice vectors or a zero-length lattice vector result in an error.atomAn atom given by its Cartesian x, y, z coordinates followed by the species name, e.g.
atom 0.0 0.0 0.0 Al.atom_fracAn atom given by its fractional coordinates with respect to the three lattice vectors. The reader converts them to Cartesian coordinates. Both
atomandatom_fraclines may be mixed within the same file. Usingatom_fracin a file that does not define three lattice vectors is an error.
The file reader creates the following per-atom properties:
Position — the Cartesian coordinates of the atom.
Particle Type — the species name from the
atom/atom_fracline, e.g.Al. The species names are stored as named particle types; numeric type IDs are assigned in the order in which the species first appear in the file, and the type list is sorted alphabetically by name. If a species name is the symbol of a chemical element, OVITO assigns the standard color and display radius of the element.
Limitations:
All other keywords of the
geometry.informat are ignored, in particular the per-atom keywordsvelocity,initial_moment,initial_charge, andconstrain_relaxation. No velocities, magnetic moments, charges, or constraints are imported.emptysites,pseudocoresites, andmultipoleentries are not imported.The
hessian_blockdata and other keywords appended togeometry.in.next_steprestart files are skipped.A geometry file contains a single structure. To load a relaxation or MD trajectory, use the log file reader described below or the Load trajectory modifier in combination with a trajectory file in another format.
The FHI-aims formats do not store bonds. You can apply the Create bonds modifier after import to generate them.
Log files
The log file reader processes the text output that FHI-aims writes to standard output (typically redirected to a file such as aims.out).
The reader is only concerned with the atomic structures contained in the log: it scans the file for all blocks introduced by the line
Updated atomic structure:
which FHI-aims writes after every step of a geometry relaxation, and loads each of these blocks as one frame of an animation sequence
in OVITO. Within a block, the reader parses the lattice_vector and atom lines in the same way as for geometry files
(see above) up to the first line that starts with any other keyword, e.g. the Fractional coordinates: section following
the Cartesian coordinates. If the block contains lattice vectors, a periodic simulation cell is created;
otherwise the system is treated as non-periodic.
The following per-atom properties are created for each frame: Position and Particle Type (see the description of the geometry file reader).
Limitations:
Only
Updated atomic structure:blocks are imported. The initial structure echoed at the beginning of the log (Input geometry:), theFinal atomic structure:block, and the structures written during molecular dynamics runs (Atomic structure (and velocities) as used in the preceding time step:) are not read. A log file that does not contain at least oneUpdated atomic structure:block, e.g. the output of a single-point calculation, cannot be loaded.Energies, forces, stresses, and all other quantities reported in the log are not imported. The reader does not create any global attributes apart from the standard
SourceFrameandSourceFileattributes.Velocities printed in the log are ignored.
Format detection
Neither of the two formats has a characteristic filename extension. OVITO recognizes a log file by the message Invoking FHI-aims
within its first 20 lines, and a geometry file by the presence of an atom or atom_frac line within the first 100 lines of the file.
If automatic detection fails, you can select the file format explicitly in the file selection dialog or pass input_format="fhi-aims"
(geometry files) or input_format="fhi-aims/log" (log files) to the import_file() function.
Options
Both readers provide the following option:
- Generate bounding box if needed
If this option is enabled and the file does not specify three lattice vectors, 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. If the option is disabled (the default), non-periodic structures are loaded without a simulation cell.
Python parameters
Both file readers accept the following optional keyword parameter in a call to the import_file() or load() Python functions.
- import_file(location, bounding_box=False)
- Parameters:
bounding_box (bool) – Generate an ad-hoc simulation cell as a bounding box around the imported atoms when the file contains no lattice vectors.