VASP HDF5 file reader
Added in version 3.16.0.
This file reader imports the HDF5-based output files written by recent versions of the
VASP simulation package. The HDF5 format is a more compact and structured
alternative to the legacy text-based files (see the VASP POSCAR / XDATCAR / CHGCAR file reader).
Both vaspout.h5 (ionic trajectories) and vaspwave.h5 (charge densities and wavefunctions) are recognized.
OVITO reads the following data from VASP HDF5 files:
The atomic structure: ion positions, chemical element types, and the number of ions of each type.
The simulation cell (lattice vectors).
The full ion-dynamics trajectory of a molecular-dynamics or relaxation run. Each ionic step is displayed as a separate frame in the animation timeline.
Per-atom velocities (
Velocityparticle property) and forces (Forceparticle property), when present.The per-frame energies (e.g. free energy, total energy), which are exposed as global attributes with a
VASP.name prefix.The electronic charge density field (from
vaspwave.h5), which is imported as a voxel grid with identifiercharge-density. The field values are divided by the simulation cell volume, so theCharge Densityproperty is in units of electrons/ų. For spin-polarized calculations (two spin channels), OVITO computes the total charge density (spin-up + spin-down) asCharge Densityand the magnetization density (spin-up - spin-down) as a second propertyMagnetization Density. When the file is first opened in the OVITO desktop application, a Create isosurface modifier is automatically inserted into the pipeline to visualize the charge density.
Trajectory files
If the file contains an ion-dynamics trajectory (stored under the intermediate/ion_dynamics group),
OVITO loads all ionic steps as a sequence of animation frames. The lattice vectors, positions, velocities,
forces, and energies are read on a per-frame basis, so variable-cell runs (e.g. ISIF=3 relaxations or
NpT molecular dynamics) are handled correctly.
Options
- Center simulation cell on coordinate origin
If enabled, the simulation cell and atomic coordinates are translated to center the box at the coordinate origin. Otherwise, one corner of the simulation cell remains fixed at the coordinate origin.
- Generate bonds
Lets OVITO automatically create bonds connecting the atoms loaded from the file. Three bond criteria are available, which correspond to the modes of the Create bonds modifier:
- 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.
Alternatively, you can apply the Create bonds modifier to the system after import, 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, centering=False, generate_bonds='off')
- Parameters:
centering (bool) – If
True, the simulation cell and atomic coordinates are translated to center the box at the coordinate origin. IfFalse, one corner of the simulation cell remains fixed at the coordinate origin.generate_bonds (str) – Controls the generation of interatomic bonds during the file import process. 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.
Changed in version 3.17.0: The generate_bonds parameter now selects the bond criterion. True is still accepted as an alias for 'vdw'.