#MD
fix 1 all npt temp 300 300 1 iso 0 0 1 #系综,可参考lammps加油站文章
run 20000
unfix 1
variable Pe equal pe #势能计算
fix pot all ave/time 1000 1 1000 v_Pe file Pe.dat
dump 1 all custom 5000 dump.atom.* id type x y z #每隔5000步输出一个轨迹文件
dump_modify 1 sort id
write_restart restart.equil #避免计算途中突然发生事故,保存计算数据,后面使用read_restart命令即可继续计算
#MC
write_data data0.file #保存MD后的文件
fix 2 all atom/swap 1000 5000 98765 300 types 1 2 #第一类原子与第三类原子交换
fix 3 all atom/swap 1000 5000 98765 300 types 1 3
fix 4 all atom/swap 1000 5000 98765 300 types 2 3
fix 1 all npt temp 300 300 1 iso 0 0 2
#在界面上输出步长、温度、能量、体积等
thermo_style custom step temp pe etotal press vol f_2[1] f_2[2] f_3[1] f_3[2] f_4[1] f_4[2]
run 1000000
unfix 1
unfix 2
unfix 3
unfix 4
thermo_style custom step temp pe etotal press vol Pe_atom
fix 1 all npt temp 300 300 1 iso 0 0 1
run 10000
unfix 1