I have been using lammps relaxation script for carbon diamond, but for whatever reason the scripts seems to be writing the wrong number of atoms in the output data file, and it does not open in ovito. Namely, the number of atoms in the first lines of the data files does not match the number of lines with atoms’ positions and velocities. Am I doing something wrong? Similar relaxation script with a different pair_style works perfectly fine for silicon diamond relaxation. Below is the script I have used.
LAMMPS (2 Apr 2025)
units metal
boundary p p p
read_data simulations/data/carbondata
timestep 0.002
pair_style tersoff/zbl
pair_coeff * * simulations/potentials/C.trsf C
compute ep all pe/atom
thermo 10
thermo_modify lost warn flush yes
region interior block INF INF INF INF $(zlo) $(zlo+2.0) side out
region border block INF INF INF INF $(zlo) $(zlo+2.0)
min_style cg
min_modify dmax 0.001
## MINIMIZATION ##
fix 1 all box/relax iso 0.0 vmax 0.01
minimize 1.0e-6 1.0e-7 100000 1000000
unfix 1
## RELAXATION BULK ROOM TEMP 0 PRESS ##
velocity all create 300.0 4928459 rot yes dist gaussian loop local
fix 1 all npt iso 0.0 0.0 $(1000.0*dt) temp 300 300 $(100.0*dt)
run 10000
unfix 1
## OPEN SURFACE IN Z DIRECTION. FREEZE BOTTOM LAYER AND RELAX ##
change_box all z delta 0.0 5.0 boundary p p f
group border_atoms region border
group interior_atoms region interior
velocity border_atoms set 0.0 0.0 0.0
fix freeze border_atoms setforce 0.0 0.0 0.0
fix 1 interior_atoms nvt temp 300 300 $(100.0*dt)
dump 1 all custom 100 simulations/movies/movierelax.carbon.lammpstrj id type x y z vx vy vz fx fy fz c_ep
dump_modify 1 sort id
run 10000
write_data simulations/data/relaxdata.carbon.debug```