# Variables that can be adjusted by kim-lammps-preprocessor to switch unit sets for # Simulator Models variable _u_distance equal 1.0 variable _u_energy equal 1.0 variable _u_mass equal 1.0 variable _u_time equal 1.0 variable _u_pressure equal 1.0 variable _u_temperature equal 1.0 # This line may be swapped out by kim-lammps-preprocessor if running against a Simulator # Model whose atom_style is not 'atomic' atom_style atomic # periodic boundary conditions along all three dimensions boundary p p p # Set neighbor skin variable neigh_skin equal 2.0*${_u_distance} variable neigh_skin equal 2.0*1 neighbor ${neigh_skin} bin neighbor 2 bin # create a supercell with cubic lattice (fcc, bcc, sc, or diamond) # using 10*10*10 conventional (orthogonal) unit cells variable latticeconst_converted equal 5.431978940963745*${_u_distance} variable latticeconst_converted equal 5.431978940963745*1 lattice diamond ${latticeconst_converted} lattice diamond 5.43197894096375 Lattice spacing in x,y,z = 5.43198 5.43198 5.43198 region simbox block 0 10 0 10 0 10 units lattice create_box 1 simbox Created orthogonal box = (0 0 0) to (54.3198 54.3198 54.3198) 1 by 1 by 1 MPI processor grid create_atoms 1 box Created 8000 atoms create_atoms CPU = 0.000798225 secs variable mass_converted equal 28.0855*${_u_mass} variable mass_converted equal 28.0855*1 # specify which KIM Model to use pair_style kim Tersoff_LAMMPS_Tersoff_1988T3_Si__MO_186459956893_002 pair_coeff * * Si mass 1 ${mass_converted} mass 1 28.0855 # initial volume variable v equal vol # assign formula variable V0 equal ${v} # evaluate initial value variable V0 equal 160278.117432034 variable V0_metal equal ${V0}/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 160278.117432034/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 160278.117432034/(1*${_u_distance}*${_u_distance}) variable V0_metal equal 160278.117432034/(1*1*${_u_distance}) variable V0_metal equal 160278.117432034/(1*1*1) variable V0_metal_times1000 equal ${V0_metal}*1000 variable V0_metal_times1000 equal 160278.117432034*1000 print "Initial system volume: ${V0_metal} Angstroms^3" Initial system volume: 160278.117432034 Angstroms^3 # set the time step to 0.001 picoseconds variable timestep_converted equal 0.001*${_u_time} variable timestep_converted equal 0.001*1 timestep ${timestep_converted} timestep 0.001 variable temp_converted equal 313.15*${_u_temperature} variable temp_converted equal 313.15*1 variable Tdamp_converted equal 0.1*${_u_time} variable Tdamp_converted equal 0.1*1 variable press_converted equal 0.0*${_u_pressure} variable press_converted equal 0.0*1 variable Pdamp_converted equal 1*${_u_time} variable Pdamp_converted equal 1*1 # create initial velocities consistent with the chosen temperature velocity all create ${temp_converted} 17 mom yes rot yes velocity all create 313.15 17 mom yes rot yes # set NPT ensemble for all atoms fix ensemble all npt temp ${temp_converted} ${temp_converted} ${Tdamp_converted} iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 313.15 ${temp_converted} ${Tdamp_converted} iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 313.15 313.15 ${Tdamp_converted} iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 313.15 313.15 0.1 iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 313.15 313.15 0.1 iso 0 ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 313.15 313.15 0.1 iso 0 0 ${Pdamp_converted} fix ensemble all npt temp 313.15 313.15 0.1 iso 0 0 1 # compute the time averages of pressure, temperature, and volume, respectively # ignore the first 5000 timesteps variable etotal_metal equal etotal/${_u_energy} variable etotal_metal equal etotal/1 variable pe_metal equal pe/${_u_energy} variable pe_metal equal pe/1 variable T_metal equal temp/${_u_temperature} variable T_metal equal temp/1 variable V_metal equal vol/(${_u_distance}*${_u_distance}*${_u_distance}) variable V_metal equal vol/(1*${_u_distance}*${_u_distance}) variable V_metal equal vol/(1*1*${_u_distance}) variable V_metal equal vol/(1*1*1) variable P_metal equal press/${_u_pressure} variable P_metal equal press/1 fix avgmyTemp all ave/time 5 20 100 v_T_metal ave running start 5000 fix avgmyPress all ave/time 5 20 100 v_P_metal ave running start 5000 fix avgmyVol all ave/time 5 20 100 v_V_metal ave running start 5000 # extract fix quantities into variables so they can be used in if-else logic later. variable T equal f_avgmyTemp variable P equal f_avgmyPress variable V equal f_avgmyVol # set error bounds for temperature and pressure in original metal units (K and bar) variable T_low equal "313.15 - 0.2" variable T_up equal "313.15 + 0.2" variable P_low equal "0.0 - 0.2" variable P_up equal "0.0 + 0.2" # print to logfile every 1000 timesteps thermo_style custom step etotal v_etotal_metal pe v_pe_metal temp v_T_metal vol v_V_metal press v_P_metal thermo 1000 # Run a simulation for at most 2000*1000 timesteps. At each 1000th time step, check # whether the temperature and pressure have converged. If yes, break. label top variable a loop 2000 run 1000 Neighbor list info ... update every 1 steps, delay 10 steps, check yes max neighbors/atom: 2000, page size: 100000 master list distance cutoff = 5 ghost atom cutoff = 5 binsize = 2.5, bins = 22 22 22 1 neighbor lists, perpetual/occasional/extra = 1 0 0 (1) pair kim, perpetual attributes: full, newton off, ghost, cut 5 pair build: full/bin/ghost stencil: full/ghost/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 4.616 | 4.616 | 4.616 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 0 -36714.022 -36714.022 -37037.804 -37037.804 313.15 313.15 160278.12 160278.12 2157.7407 2157.7407 1000 -36359.5 -36359.5 -36681.013 -36681.013 310.9553 310.9553 161176.46 161176.46 705.58123 705.58123 Loop time of 67.781 on 1 procs for 1000 steps with 8000 atoms Performance: 1.275 ns/day, 18.828 hours/ns, 14.753 timesteps/s 49.9% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 66.933 | 66.933 | 66.933 | 0.0 | 98.75 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.044034 | 0.044034 | 0.044034 | 0.0 | 0.06 Output | 5.4121e-05 | 5.4121e-05 | 5.4121e-05 | 0.0 | 0.00 Modify | 0.70887 | 0.70887 | 0.70887 | 0.0 | 1.05 Other | | 0.09545 | | | 0.14 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 4995 ave 4995 max 4995 min Histogram: 1 0 0 0 0 0 0 0 0 0 Neighs: 0 ave 0 max 0 min Histogram: 1 0 0 0 0 0 0 0 0 0 FullNghs: 224000 ave 224000 max 224000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 224000 Ave neighs/atom = 28 Neighbor list builds = 0 Dangerous builds = 0 if "${V_metal}>${V0_metal_times1000}" then "jump SELF unstable" if "${T}>${T_low} && ${T}<${T_up} && ${P}>${P_low} && ${P}<${P_up}" then "jump SELF break" print "flag: Temp = ${T}, Press = ${P}" flag: Temp = 0, Press = 0 next a jump SELF top variable a loop 2000 run 1000 Per MPI rank memory allocation (min/avg/max) = 4.616 | 4.616 | 4.616 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 1000 -36359.5 -36359.5 -36681.013 -36681.013 310.9553 310.9553 161176.46 161176.46 705.58123 705.58123 2000 -36393.145 -36393.145 -36709.812 -36709.812 306.26776 306.26776 161250.18 161250.18 96.659122 96.659122 Loop time of 69.1436 on 1 procs for 1000 steps with 8000 atoms Performance: 1.250 ns/day, 19.207 hours/ns, 14.463 timesteps/s 50.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 68.45 | 68.45 | 68.45 | 0.0 | 99.00 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.084572 | 0.084572 | 0.084572 | 0.0 | 0.12 Output | 4.4823e-05 | 4.4823e-05 | 4.4823e-05 | 0.0 | 0.00 Modify | 0.57371 | 0.57371 | 0.57371 | 0.0 | 0.83 Other | | 0.03532 | | | 0.05 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 4995 ave 4995 max 4995 min Histogram: 1 0 0 0 0 0 0 0 0 0 Neighs: 0 ave 0 max 0 min Histogram: 1 0 0 0 0 0 0 0 0 0 FullNghs: 224000 ave 224000 max 224000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 224000 Ave neighs/atom = 28 Neighbor list builds = 0 Dangerous builds = 0 if "${V_metal}>${V0_metal_times1000}" then "jump SELF unstable" if "${T}>${T_low} && ${T}<${T_up} && ${P}>${P_low} && ${P}<${P_up}" then "jump SELF break" print "flag: Temp = ${T}, Press = ${P}" flag: Temp = 0, Press = 0 next a jump SELF top variable a loop 2000 run 1000 Per MPI rank memory allocation (min/avg/max) = 4.616 | 4.616 | 4.616 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 2000 -36393.145 -36393.145 -36709.812 -36709.812 306.26776 306.26776 161250.18 161250.18 96.659122 96.659122 3000 -36376.176 -36376.176 -36703.879 -36703.879 316.94206 316.94206 161338.64 161338.64 -613.99669 -613.99669 Loop time of 69.0833 on 1 procs for 1000 steps with 8000 atoms Performance: 1.251 ns/day, 19.190 hours/ns, 14.475 timesteps/s 50.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 68.309 | 68.309 | 68.309 | 0.0 | 98.88 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.06512 | 0.06512 | 0.06512 | 0.0 | 0.09 Output | 4.7922e-05 | 4.7922e-05 | 4.7922e-05 | 0.0 | 0.00 Modify | 0.59318 | 0.59318 | 0.59318 | 0.0 | 0.86 Other | | 0.1159 | | | 0.17 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 4995 ave 4995 max 4995 min Histogram: 1 0 0 0 0 0 0 0 0 0 Neighs: 0 ave 0 max 0 min Histogram: 1 0 0 0 0 0 0 0 0 0 FullNghs: 224000 ave 224000 max 224000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 224000 Ave neighs/atom = 28 Neighbor list builds = 0 Dangerous builds = 0 if "${V_metal}>${V0_metal_times1000}" then "jump SELF unstable" if "${T}>${T_low} && ${T}<${T_up} && ${P}>${P_low} && ${P}<${P_up}" then "jump SELF break" print "flag: Temp = ${T}, Press = ${P}" flag: Temp = 0, Press = 0 next a jump SELF top variable a loop 2000 run 1000 Per MPI rank memory allocation (min/avg/max) = 4.616 | 4.616 | 4.616 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 3000 -36376.176 -36376.176 -36703.879 -36703.879 316.94206 316.94206 161338.64 161338.64 -613.99669 -613.99669 4000 -36385.07 -36385.07 -36698.648 -36698.648 303.2814 303.2814 161247.02 161247.02 -0.27915451 -0.27915451 Loop time of 67.9879 on 1 procs for 1000 steps with 8000 atoms Performance: 1.271 ns/day, 18.886 hours/ns, 14.709 timesteps/s 51.0% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 67.216 | 67.216 | 67.216 | 0.0 | 98.86 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.044527 | 0.044527 | 0.044527 | 0.0 | 0.07 Output | 5.1975e-05 | 5.1975e-05 | 5.1975e-05 | 0.0 | 0.00 Modify | 0.65175 | 0.65175 | 0.65175 | 0.0 | 0.96 Other | | 0.07588 | | | 0.11 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 4995 ave 4995 max 4995 min Histogram: 1 0 0 0 0 0 0 0 0 0 Neighs: 0 ave 0 max 0 min Histogram: 1 0 0 0 0 0 0 0 0 0 FullNghs: 224000 ave 224000 max 224000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 224000 Ave neighs/atom = 28 Neighbor list builds = 0 Dangerous builds = 0 if "${V_metal}>${V0_metal_times1000}" then "jump SELF unstable" if "${T}>${T_low} && ${T}<${T_up} && ${P}>${P_low} && ${P}<${P_up}" then "jump SELF break" print "flag: Temp = ${T}, Press = ${P}" flag: Temp = 0, Press = 0 next a jump SELF top variable a loop 2000 run 1000 Per MPI rank memory allocation (min/avg/max) = 4.616 | 4.616 | 4.616 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 4000 -36385.07 -36385.07 -36698.648 -36698.648 303.2814 303.2814 161247.02 161247.02 -0.27915451 -0.27915451 5000 -36382.892 -36382.892 -36705.288 -36705.288 311.80992 311.80992 161051.92 161051.92 1286.4893 1286.4893 Loop time of 66.7379 on 1 procs for 1000 steps with 8000 atoms Performance: 1.295 ns/day, 18.538 hours/ns, 14.984 timesteps/s 51.7% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 65.946 | 65.946 | 65.946 | 0.0 | 98.81 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.14464 | 0.14464 | 0.14464 | 0.0 | 0.22 Output | 4.3869e-05 | 4.3869e-05 | 4.3869e-05 | 0.0 | 0.00 Modify | 0.59225 | 0.59225 | 0.59225 | 0.0 | 0.89 Other | | 0.05527 | | | 0.08 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 4995 ave 4995 max 4995 min Histogram: 1 0 0 0 0 0 0 0 0 0 Neighs: 0 ave 0 max 0 min Histogram: 1 0 0 0 0 0 0 0 0 0 FullNghs: 224000 ave 224000 max 224000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 224000 Ave neighs/atom = 28 Neighbor list builds = 0 Dangerous builds = 0 if "${V_metal}>${V0_metal_times1000}" then "jump SELF unstable" if "${T}>${T_low} && ${T}<${T_up} && ${P}>${P_low} && ${P}<${P_up}" then "jump SELF break" print "flag: Temp = ${T}, Press = ${P}" flag: Temp = 314.309922789151, Press = -52.8541520156437 next a jump SELF top variable a loop 2000 run 1000 Per MPI rank memory allocation (min/avg/max) = 4.616 | 4.616 | 4.616 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 5000 -36382.892 -36382.892 -36705.288 -36705.288 311.80992 311.80992 161051.92 161051.92 1286.4893 1286.4893 6000 -36380.716 -36380.716 -36707.078 -36707.078 315.64576 315.64576 161177.38 161177.38 486.69629 486.69629 Loop time of 66.8019 on 1 procs for 1000 steps with 8000 atoms Performance: 1.293 ns/day, 18.556 hours/ns, 14.970 timesteps/s 51.5% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 65.994 | 65.994 | 65.994 | 0.0 | 98.79 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.064763 | 0.064763 | 0.064763 | 0.0 | 0.10 Output | 4.4107e-05 | 4.4107e-05 | 4.4107e-05 | 0.0 | 0.00 Modify | 0.68776 | 0.68776 | 0.68776 | 0.0 | 1.03 Other | | 0.05555 | | | 0.08 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 4995 ave 4995 max 4995 min Histogram: 1 0 0 0 0 0 0 0 0 0 Neighs: 0 ave 0 max 0 min Histogram: 1 0 0 0 0 0 0 0 0 0 FullNghs: 224000 ave 224000 max 224000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 224000 Ave neighs/atom = 28 Neighbor list builds = 0 Dangerous builds = 0 if "${V_metal}>${V0_metal_times1000}" then "jump SELF unstable" if "${T}>${T_low} && ${T}<${T_up} && ${P}>${P_low} && ${P}<${P_up}" then "jump SELF break" print "flag: Temp = ${T}, Press = ${P}" flag: Temp = 312.650924450335, Press = -24.3510137150427 next a jump SELF top variable a loop 2000 run 1000 Per MPI rank memory allocation (min/avg/max) = 4.616 | 4.616 | 4.616 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 6000 -36380.716 -36380.716 -36707.078 -36707.078 315.64576 315.64576 161177.38 161177.38 486.69629 486.69629 7000 -36387.155 -36387.155 -36694.577 -36694.577 297.32709 297.32709 161350.23 161350.23 -726.80678 -726.80678 Loop time of 66.9702 on 1 procs for 1000 steps with 8000 atoms Performance: 1.290 ns/day, 18.603 hours/ns, 14.932 timesteps/s 51.4% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 66.267 | 66.267 | 66.267 | 0.0 | 98.95 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.043885 | 0.043885 | 0.043885 | 0.0 | 0.07 Output | 4.22e-05 | 4.22e-05 | 4.22e-05 | 0.0 | 0.00 Modify | 0.57645 | 0.57645 | 0.57645 | 0.0 | 0.86 Other | | 0.08268 | | | 0.12 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 4995 ave 4995 max 4995 min Histogram: 1 0 0 0 0 0 0 0 0 0 Neighs: 0 ave 0 max 0 min Histogram: 1 0 0 0 0 0 0 0 0 0 FullNghs: 224000 ave 224000 max 224000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 224000 Ave neighs/atom = 28 Neighbor list builds = 0 Dangerous builds = 0 if "${V_metal}>${V0_metal_times1000}" then "jump SELF unstable" if "${T}>${T_low} && ${T}<${T_up} && ${P}>${P_low} && ${P}<${P_up}" then "jump SELF break" print "flag: Temp = ${T}, Press = ${P}" flag: Temp = 313.144053410203, Press = -8.95736090861916 next a jump SELF top variable a loop 2000 run 1000 Per MPI rank memory allocation (min/avg/max) = 4.616 | 4.616 | 4.616 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 7000 -36387.155 -36387.155 -36694.577 -36694.577 297.32709 297.32709 161350.23 161350.23 -726.80678 -726.80678 8000 -36379.162 -36379.162 -36703.876 -36703.876 314.05119 314.05119 161307.24 161307.24 -337.25834 -337.25834 Loop time of 79.9697 on 1 procs for 1000 steps with 8000 atoms Performance: 1.080 ns/day, 22.214 hours/ns, 12.505 timesteps/s 43.2% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 79.189 | 79.189 | 79.189 | 0.0 | 99.02 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.10404 | 0.10404 | 0.10404 | 0.0 | 0.13 Output | 4.3869e-05 | 4.3869e-05 | 4.3869e-05 | 0.0 | 0.00 Modify | 0.57163 | 0.57163 | 0.57163 | 0.0 | 0.71 Other | | 0.1049 | | | 0.13 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 4995 ave 4995 max 4995 min Histogram: 1 0 0 0 0 0 0 0 0 0 Neighs: 0 ave 0 max 0 min Histogram: 1 0 0 0 0 0 0 0 0 0 FullNghs: 224000 ave 224000 max 224000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 224000 Ave neighs/atom = 28 Neighbor list builds = 0 Dangerous builds = 0 if "${V_metal}>${V0_metal_times1000}" then "jump SELF unstable" if "${T}>${T_low} && ${T}<${T_up} && ${P}>${P_low} && ${P}<${P_up}" then "jump SELF break" jump SELF break # Write final averaged volume to file if temperature and volume have converged; otherwise wirte a # flag to indicate non-convergence. variable myStep equal step if "${myStep} < 2000000" then "print '${V}' file output/vol_T313.15.out" else "print 'not_converged' file output/vol_T313.15.out" print '${V}' file output/vol_T313.15.out 161248.441814668 print "LAMMPS calculation completed" LAMMPS calculation completed quit 0