# 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.464352798461917*${_u_distance} variable latticeconst_converted equal 5.464352798461917*1 lattice diamond ${latticeconst_converted} lattice diamond 5.46435279846192 Lattice spacing in x,y,z = 5.46435 5.46435 5.46435 region simbox block 0 10 0 10 0 10 units lattice create_box 1 simbox Created orthogonal box = (0 0 0) to (54.6435 54.6435 54.6435) 1 by 1 by 1 MPI processor grid create_atoms 1 box Created 8000 atoms create_atoms CPU = 0.0208161 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 SNAP_ZuoChenLi_2019quadratic_Si__MO_721469752060_000 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 163160.93809183 variable V0_metal equal ${V0}/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 163160.93809183/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 163160.93809183/(1*${_u_distance}*${_u_distance}) variable V0_metal equal 163160.93809183/(1*1*${_u_distance}) variable V0_metal equal 163160.93809183/(1*1*1) variable V0_metal_times1000 equal ${V0_metal}*1000 variable V0_metal_times1000 equal 163160.93809183*1000 print "Initial system volume: ${V0_metal} Angstroms^3" Initial system volume: 163160.93809183 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 = 6.8 ghost atom cutoff = 6.8 binsize = 3.4, bins = 17 17 17 1 neighbor lists, perpetual/occasional/extra = 1 0 0 (1) pair kim, perpetual attributes: full, newton off, cut 6.8 pair build: full/bin/atomonly stencil: full/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 5.44 | 5.44 | 5.44 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 0 -43075.875 -43075.875 -43399.657 -43399.657 313.15 313.15 163160.94 163160.94 2119.5897 2119.5897 1000 -42721.489 -42721.489 -43070.424 -43070.424 337.47755 337.47755 163989.84 163989.84 -198.95653 -198.95653 Loop time of 6882.03 on 1 procs for 1000 steps with 8000 atoms Performance: 0.013 ns/day, 1911.675 hours/ns, 0.145 timesteps/s 58.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 | 6881.4 | 6881.4 | 6881.4 | 0.0 | 99.99 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.066832 | 0.066832 | 0.066832 | 0.0 | 0.00 Output | 5.2929e-05 | 5.2929e-05 | 5.2929e-05 | 0.0 | 0.00 Modify | 0.48188 | 0.48188 | 0.48188 | 0.0 | 0.01 Other | | 0.05107 | | | 0.00 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 6725 ave 6725 max 6725 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: 560000 ave 560000 max 560000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 560000 Ave neighs/atom = 70 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) = 5.445 | 5.445 | 5.445 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 1000 -42721.489 -42721.489 -43070.424 -43070.424 337.47755 337.47755 163989.84 163989.84 -198.95653 -198.95653 2000 -42757.243 -42757.243 -43066.696 -43066.696 299.29131 299.29131 163764.9 163764.9 441.75314 441.75314 Loop time of 6873.06 on 1 procs for 1000 steps with 8000 atoms Performance: 0.013 ns/day, 1909.182 hours/ns, 0.145 timesteps/s 58.8% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 6872.5 | 6872.5 | 6872.5 | 0.0 | 99.99 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.068973 | 0.068973 | 0.068973 | 0.0 | 0.00 Output | 4.8876e-05 | 4.8876e-05 | 4.8876e-05 | 0.0 | 0.00 Modify | 0.47627 | 0.47627 | 0.47627 | 0.0 | 0.01 Other | | 0.05113 | | | 0.00 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 7197 ave 7197 max 7197 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: 527326 ave 527326 max 527326 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 527326 Ave neighs/atom = 65.9158 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) = 5.446 | 5.446 | 5.446 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 2000 -42757.243 -42757.243 -43066.696 -43066.696 299.29131 299.29131 163764.9 163764.9 441.75314 441.75314 3000 -42739.206 -42739.206 -43066.497 -43066.497 316.54384 316.54384 163982.39 163982.39 -678.72007 -678.72007 Loop time of 7043.66 on 1 procs for 1000 steps with 8000 atoms Performance: 0.012 ns/day, 1956.572 hours/ns, 0.142 timesteps/s 58.6% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 7043.1 | 7043.1 | 7043.1 | 0.0 | 99.99 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.07057 | 0.07057 | 0.07057 | 0.0 | 0.00 Output | 5.3167e-05 | 5.3167e-05 | 5.3167e-05 | 0.0 | 0.00 Modify | 0.4854 | 0.4854 | 0.4854 | 0.0 | 0.01 Other | | 0.03194 | | | 0.00 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 7239 ave 7239 max 7239 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: 526388 ave 526388 max 526388 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 526388 Ave neighs/atom = 65.7985 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) = 5.446 | 5.446 | 5.446 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 3000 -42739.206 -42739.206 -43066.497 -43066.497 316.54384 316.54384 163982.39 163982.39 -678.72007 -678.72007 4000 -42750.031 -42750.031 -43065.019 -43065.019 304.64396 304.64396 163801.78 163801.78 403.26049 403.26049 Loop time of 7069.61 on 1 procs for 1000 steps with 8000 atoms Performance: 0.012 ns/day, 1963.781 hours/ns, 0.141 timesteps/s 58.8% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 7068.9 | 7068.9 | 7068.9 | 0.0 | 99.99 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.11112 | 0.11112 | 0.11112 | 0.0 | 0.00 Output | 5.1022e-05 | 5.1022e-05 | 5.1022e-05 | 0.0 | 0.00 Modify | 0.52159 | 0.52159 | 0.52159 | 0.0 | 0.01 Other | | 0.07256 | | | 0.00 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 7176 ave 7176 max 7176 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: 525074 ave 525074 max 525074 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 525074 Ave neighs/atom = 65.6342 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) = 5.446 | 5.446 | 5.446 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 4000 -42750.031 -42750.031 -43065.019 -43065.019 304.64396 304.64396 163801.78 163801.78 403.26049 403.26049 5000 -42746.585 -42746.585 -43071.905 -43071.905 314.63793 314.63793 163904.31 163904.31 -207.73368 -207.73368 Loop time of 6908.45 on 1 procs for 1000 steps with 8000 atoms Performance: 0.013 ns/day, 1919.014 hours/ns, 0.145 timesteps/s 58.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 | 6907.9 | 6907.9 | 6907.9 | 0.0 | 99.99 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.049652 | 0.049652 | 0.049652 | 0.0 | 0.00 Output | 4.2915e-05 | 4.2915e-05 | 4.2915e-05 | 0.0 | 0.00 Modify | 0.49203 | 0.49203 | 0.49203 | 0.0 | 0.01 Other | | 0.05117 | | | 0.00 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 7290 ave 7290 max 7290 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: 526228 ave 526228 max 526228 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 526228 Ave neighs/atom = 65.7785 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.642463385325, Press = -329.801898076442 next a jump SELF top variable a loop 2000 run 1000 Per MPI rank memory allocation (min/avg/max) = 5.446 | 5.446 | 5.446 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 5000 -42746.585 -42746.585 -43071.905 -43071.905 314.63793 314.63793 163904.31 163904.31 -207.73368 -207.73368 6000 -42743.685 -42743.685 -43070.289 -43070.289 315.87886 315.87886 163869.93 163869.93 -26.452725 -26.452725 Loop time of 6894.14 on 1 procs for 1000 steps with 8000 atoms Performance: 0.013 ns/day, 1915.039 hours/ns, 0.145 timesteps/s 58.8% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 6893.5 | 6893.5 | 6893.5 | 0.0 | 99.99 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.079515 | 0.079515 | 0.079515 | 0.0 | 0.00 Output | 4.1008e-05 | 4.1008e-05 | 4.1008e-05 | 0.0 | 0.00 Modify | 0.51752 | 0.51752 | 0.51752 | 0.0 | 0.01 Other | | 0.05103 | | | 0.00 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 7222 ave 7222 max 7222 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: 526558 ave 526558 max 526558 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 526558 Ave neighs/atom = 65.8197 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.732493804864, Press = -6.20286736372146 next a jump SELF top variable a loop 2000 run 1000 Per MPI rank memory allocation (min/avg/max) = 5.446 | 5.446 | 5.446 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 6000 -42743.685 -42743.685 -43070.289 -43070.289 315.87886 315.87886 163869.93 163869.93 -26.452725 -26.452725 7000 -42749.232 -42749.232 -43068.593 -43068.593 308.87417 308.87417 163857.87 163857.87 -31.839934 -31.839934 Loop time of 6877.57 on 1 procs for 1000 steps with 8000 atoms Performance: 0.013 ns/day, 1910.435 hours/ns, 0.145 timesteps/s 58.8% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 6876.9 | 6876.9 | 6876.9 | 0.0 | 99.99 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.049447 | 0.049447 | 0.049447 | 0.0 | 0.00 Output | 3.5048e-05 | 3.5048e-05 | 3.5048e-05 | 0.0 | 0.00 Modify | 0.53682 | 0.53682 | 0.53682 | 0.0 | 0.01 Other | | 0.09125 | | | 0.00 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 7292 ave 7292 max 7292 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: 526568 ave 526568 max 526568 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 526568 Ave neighs/atom = 65.821 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.139699231284, Press = -12.3204819783084 next a jump SELF top variable a loop 2000 run 1000 Per MPI rank memory allocation (min/avg/max) = 5.446 | 5.446 | 5.446 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 7000 -42749.232 -42749.232 -43068.593 -43068.593 308.87417 308.87417 163857.87 163857.87 -31.839934 -31.839934 8000 -42741.053 -42741.053 -43069.394 -43069.394 317.55953 317.55953 163922.52 163922.52 -245.90428 -245.90428 Loop time of 6887.19 on 1 procs for 1000 steps with 8000 atoms Performance: 0.013 ns/day, 1913.107 hours/ns, 0.145 timesteps/s 58.8% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 6886.5 | 6886.5 | 6886.5 | 0.0 | 99.99 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.050233 | 0.050233 | 0.050233 | 0.0 | 0.00 Output | 4.2915e-05 | 4.2915e-05 | 4.2915e-05 | 0.0 | 0.00 Modify | 0.57613 | 0.57613 | 0.57613 | 0.0 | 0.01 Other | | 0.03138 | | | 0.00 Nlocal: 8000 ave 8000 max 8000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 7301 ave 7301 max 7301 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: 526638 ave 526638 max 526638 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 526638 Ave neighs/atom = 65.8298 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 163870.02701245 print "LAMMPS calculation completed" LAMMPS calculation completed quit 0