# Gaussian Cube file reader

User interface of the Gaussian Cube file reader, which appears as part of a pipeline’s file source.

This file format is used by the Gaussian simulation package and other ab initio simulation codes. It stores the simulation cell geometry, the atomic structure, and volumetric grid data.

Specifications of the format can be found here and here, for example.

If the imported file uses Bohr units, OVITO converts them to Angstroms automatically.

## Volumetric grid type

The user interface of the file reader provides an option that controls how the volumetric data should be intepreted by OVITO. The field values may either be attributed to the grid line intersections (the default) or the cell centers:

The selected grid type affects operations subsequently performed in OVITO, e.g. constructing an iso-surface from the volumetric data. In all cases, the file reader assumes 3d periodic boundary conditions for the volumetric grid and the atomic simulation cell.

See also

`VoxelGrid.grid_type`

## 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, grid_type=VoxelGrid.GridType.PointData, generate_bonds=False)
  Parameters:

    - grid_type – Selects how OVITO should interprete the volumetric data loaded from the Cube file. See `VoxelGrid.grid_type` for further information.

    - generate_bonds (bool) – Activates the generation of ad-hoc bonds connecting the atoms loaded from the file. Ad-hoc bond generation is based on the van der Waals radii of the chemical elements. Alternatively, you can apply the `CreateBondsModifier` to the system after import, which provides more control over the generation of pair-wise bonds.