I’m getting very confused, because the Wigner–Seitz defect analysis with OVITO doesn’t seem to work with LAMMPS xyz dumps but it does with customs.
Here is the minimum LAMMPS script:
units metal
atom_style atomic
boundary p p p
atom_modify map yes
lattice bcc 2.8664999
region R1 block 0 30 0 30 0 30
create_box 1 R1
create_atoms 1 box
group Region1 region R1
fix integrate all nve
fix reset all dt/reset 10 1e-05 0.001 0.028664999 units box
pair_style eam/alloy
pair_coeff * * fe_mendelev_eam_alloy.potential Fe
dump custom_simulation all custom 100 custom.xyz id type x y z
dump xyz_simulation all xyz 100 xyz.xyz
# Collisional cascade
group PKA id 33272
velocity PKA set 244.85756019166263 -78.77108314253489 528.5710168305385 units box
run 4000 upto
The dump custom_simulation defect detection in OVITO works fine, but not for the xyz_simulation, see picture below at the final timestep (left/right respectively) and the number of defects found at the bottom right corner of each window:
The box is surrounded by vacancies and there is a plane of interstitials in the middle.
Curiously, I do have my own method for defect detection (to be published), and I get the a similar result to xyz_simulation dump with the custom_simulation output (I still need to modify a few things to test if results are fully switched).
Why is this happening? That could benefit OVITO and other codes
This issue likely arises because the .xyz file does not store particle identifiers and reorders particles between timesteps. As a result, OVITO cannot correctly establish the correspondence of atoms across time, causing the Wigner-Seitz analysis to produce incorrect results.
In contrast, the custom dump format stores particle identifiers, allowing particles to be matched across different timesteps in the trajectory, which ensures accurate results.
To resolve this issue, you can either sort the particles before dumping them or include particle identifiers in the dump file.
Since you cannot modify the xyz dump in LAMMPS, only sorting ids is factible. I added the line dump_modify xyz_simulation sort id, but the issue in OVITO still persists. I guess that since the id is not dumped into the file, they aren’t being ordered (not sure, LAMMPS beginner). So this kind of dump is incompatible with the defect detection algortihm in OVITO.
After a brief internal discussion, we determined that the issue arises because the .xyz format does not include the simulation cell. As a result, OVITO generates a simulation cell based on the bounding box of the atoms, which leads to issues at the periodic boundaries.
Yes, this is a general recommendation, not just for you, but for everyone:
Never use the dump xyz format to output simulation results! The XYZ file format dates back to the old days of the 20th century and is completely unsuitable for post-processing applications. Important information such as the boundary conditions and the simulation cell geometry are not transferred from LAMMPS to OVITO by this legacy format, which leads to analysis artifacts.