Generate Random Solution
OVITO Python modifier to change the particle type values to create a random solution of a given composition.
Description
Python modifier for OVITO that changes the particle types in the whole data collection or a selected subset of particles to match a user-provided target concentration. The new particle types are distributed randomly to approximate a perfect random solution. The modifier can be installed either into OVITO Pro or the OVITO Python module Python module using pip.
Parameters
only_selected
/ "only selected": Apply the modifier only to the selected particles.concentrations
/ "Concentrations": List defining the target concentrations. Their sum has to be equal to 1.seed
/ "Seed": Starting value for the random number generation.
Examples
- All examples rely on fcc.lmp as input structure.
- Example 01 loads the structure file and changes its composition from purely type 1 to a random solid solution containing 3 types with concentrations of 0.25, 0.5, and 0.25, respectively.
- Example 02 loads the same structure file, selects all atoms with a relative position < 0.5 and changes the composition of the selected atoms from type 1 to a random solid solution containing 3 types with concentrations of 0.25, 0.5, and 0.25, respectively. The overall sample composition will not match these concentrations as the unselected region will still be of type 1.
Installation
- OVITO PRO built-in Python interpreter
ovitos -m pip install --user https://github.com/nnn911/GenerateRandomSolution/main/archive.zip
- Standalone Python package or Conda environment
pip install --user https://github.com/nnn911/GenerateRandomSolution/main/archive.zip
- Please note that the
--user
tag is recommended but optional and depends on your Python installation.
Technical information / dependencies
- Tested on OVITO 3.9.0
Contact
- Daniel Utt (utt@ovito.org)