OVITO Python file reader for the h5 data containers written by pyiron.
Python file reader for OVITO that reads structural data from the hdf5 containers written by pyiron. After installation, OVITO will auto-detect pyiron files and open them for analysis and visualization. Note that the "status" of the pyiron job needs to be "finished" before its file can be read. The following table gives an overview over all particle properties and attributes currently understood by this parser. Optional properties will be skipped if they are not included in the file and the parser is not in strict mode.
Particle properties
pyiron name | OVITO name | Components | Optional |
---|---|---|---|
generic/indices |
Particle Type |
1 | |
generic/unwrapped_positions |
Position |
3 | x* |
generic/positions |
Position |
3 | x* |
generic/forces |
Force |
3 | x |
generic/velocities |
Velocity |
3 | x |
*
One of generic/unwrapped_positions
or generic/positions
is required.
Attributes
pyiron name | OVITO name | Components | Optional |
---|---|---|---|
generic/steps |
Timestep |
1 | |
generic/natoms |
Number of atoms |
1 | |
generic/temperature |
Temperature |
1 | x |
generic/energy_tot |
Total energy |
1 | x |
The file reader can be installed either into OVITO Pro or the OVITO Python module Python module using pip.
roundCell
/ "Round cell to orthogonal": Round the off-diagonal components of the simulation cell to0
if they are below a threshold value currently hard-coded to1e-8
A.strict
/ "Strict mode": Activate strict mode which requires all optional keys to be present in the pyiron data container. In strict mode, any missing key will raise aKeyError
. The default (non-strict) mode silently skips all missing optional keys.
- Example 01 loads the
lmp.h5
structure file and prints all particle properties and attributes found therein.
The following image shows the same file in the OVITO Pro desktop application.
The example data was generated using the generate_example_data_01.py
script using pyiron
. For more information visit their website.
-
OVITO Pro integrated Python interpreter:
ovitos -m pip install --user git+https://github.com/ovito-org/pyironFileReader.git
The
--user
option is recommended and installs the package in the user's site directory. -
Other Python interpreters or Conda environments:
pip install git+https://github.com/ovito-org/pyironFileReader.git
- Tested with OVITO 3.9.1
- Depends on:
numpy
h5py
- Please note, this file reader does currently NOT work on windows.
New optional particle properties and attributes can be included in the parser quite easily. To add new particle properties, include them in the particle_props_dict
of the PyironFileReader
class, which can be found here. Similarly, new attributes need to be added to the attributes_dict
. Both dictionaries map pyiron names
to OVITO names
. If you add new properties consider contacting the author or submitting a pull request to make these changes available to the whole community.
- Daniel Utt (utt@ovito.org)