OVITO Python modifier to change the particle type values to create a random solution of a given composition.
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.
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.
- 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.
-
OVITO Pro integrated Python interpreter:
ovitos -m pip install --user git+https://github.com/ovito-org/GenerateRandomSolution.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/GenerateRandomSolution.git
- Tested on OVITO 3.9.1
- Daniel Utt (utt@ovito.org)