# 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 4.049696564674378*${_u_distance} variable latticeconst_converted equal 4.049696564674378*1 lattice fcc ${latticeconst_converted} lattice fcc 4.04969656467438 Lattice spacing in x,y,z = 4.0497 4.0497 4.0497 region simbox block 0 10 0 10 0 10 units lattice create_box 1 simbox Created orthogonal box = (0 0 0) to (40.497 40.497 40.497) 1 by 1 by 1 MPI processor grid create_atoms 1 box Created 4000 atoms create_atoms CPU = 0.000481129 secs variable mass_converted equal 26.981538*${_u_mass} variable mass_converted equal 26.981538*1 # specify which KIM Model to use pair_style kim EAM_Dynamo_VailheFarkas_1997_CoAl__MO_284963179498_005 pair_coeff * * Al mass 1 ${mass_converted} mass 1 26.981538 # initial volume variable v equal vol # assign formula variable V0 equal ${v} # evaluate initial value variable V0 equal 66415.1948248735 variable V0_metal equal ${V0}/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 66415.1948248735/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 66415.1948248735/(1*${_u_distance}*${_u_distance}) variable V0_metal equal 66415.1948248735/(1*1*${_u_distance}) variable V0_metal equal 66415.1948248735/(1*1*1) variable V0_metal_times1000 equal ${V0_metal}*1000 variable V0_metal_times1000 equal 66415.1948248735*1000 print "Initial system volume: ${V0_metal} Angstroms^3" Initial system volume: 66415.1948248735 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 273.15*${_u_temperature} variable temp_converted equal 273.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 273.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 273.15 ${temp_converted} ${Tdamp_converted} iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 273.15 273.15 ${Tdamp_converted} iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 273.15 273.15 0.1 iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 273.15 273.15 0.1 iso 0 ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 273.15 273.15 0.1 iso 0 0 ${Pdamp_converted} fix ensemble all npt temp 273.15 273.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 "273.15 - 0.2" variable T_up equal "273.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 = 7.60004 ghost atom cutoff = 7.60004 binsize = 3.80002, bins = 11 11 11 1 neighbor lists, perpetual/occasional/extra = 1 0 0 (1) pair kim, perpetual attributes: full, newton off, cut 7.60004 pair build: full/bin/atomonly stencil: full/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 5.369 | 5.369 | 5.369 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 0 -13332.638 -13332.638 -13473.832 -13473.832 273.15 273.15 66415.195 66415.195 2270.7152 2270.7152 1000 -13168.724 -13168.724 -13316.147 -13316.147 285.19984 285.19984 68410.915 68410.915 35.848585 35.848585 Loop time of 19.5682 on 1 procs for 1000 steps with 4000 atoms Performance: 4.415 ns/day, 5.436 hours/ns, 51.103 timesteps/s 47.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 | 19.127 | 19.127 | 19.127 | 0.0 | 97.75 Neigh | 0.066206 | 0.066206 | 0.066206 | 0.0 | 0.34 Comm | 0.064486 | 0.064486 | 0.064486 | 0.0 | 0.33 Output | 6.1989e-05 | 6.1989e-05 | 6.1989e-05 | 0.0 | 0.00 Modify | 0.26992 | 0.26992 | 0.26992 | 0.0 | 1.38 Other | | 0.04043 | | | 0.21 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 5841 ave 5841 max 5841 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: 415512 ave 415512 max 415512 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 415512 Ave neighs/atom = 103.878 Neighbor list builds = 1 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.369 | 5.369 | 5.369 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 1000 -13168.724 -13168.724 -13316.147 -13316.147 285.19984 285.19984 68410.915 68410.915 35.848585 35.848585 2000 -13187.984 -13187.984 -13327.169 -13327.169 269.26386 269.26386 68239.173 68239.173 261.48479 261.48479 Loop time of 18.86 on 1 procs for 1000 steps with 4000 atoms Performance: 4.581 ns/day, 5.239 hours/ns, 53.022 timesteps/s 47.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 | 18.406 | 18.406 | 18.406 | 0.0 | 97.59 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.039497 | 0.039497 | 0.039497 | 0.0 | 0.21 Output | 3.6001e-05 | 3.6001e-05 | 3.6001e-05 | 0.0 | 0.00 Modify | 0.33356 | 0.33356 | 0.33356 | 0.0 | 1.77 Other | | 0.08049 | | | 0.43 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 5841 ave 5841 max 5841 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: 414786 ave 414786 max 414786 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 414786 Ave neighs/atom = 103.697 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.369 | 5.369 | 5.369 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 2000 -13187.984 -13187.984 -13327.169 -13327.169 269.26386 269.26386 68239.173 68239.173 261.48479 261.48479 3000 -13176.726 -13176.726 -13318.061 -13318.061 273.42225 273.42225 68425.151 68425.151 -503.87182 -503.87182 Loop time of 19.2829 on 1 procs for 1000 steps with 4000 atoms Performance: 4.481 ns/day, 5.356 hours/ns, 51.860 timesteps/s 46.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 | 18.907 | 18.907 | 18.907 | 0.0 | 98.05 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.059485 | 0.059485 | 0.059485 | 0.0 | 0.31 Output | 4.1962e-05 | 4.1962e-05 | 4.1962e-05 | 0.0 | 0.00 Modify | 0.2956 | 0.2956 | 0.2956 | 0.0 | 1.53 Other | | 0.02089 | | | 0.11 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 5841 ave 5841 max 5841 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: 416470 ave 416470 max 416470 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 416470 Ave neighs/atom = 104.118 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.369 | 5.369 | 5.369 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 3000 -13176.726 -13176.726 -13318.061 -13318.061 273.42225 273.42225 68425.151 68425.151 -503.87182 -503.87182 4000 -13182.168 -13182.168 -13323.737 -13323.737 273.87447 273.87447 68297.022 68297.022 153.21298 153.21298 Loop time of 18.5802 on 1 procs for 1000 steps with 4000 atoms Performance: 4.650 ns/day, 5.161 hours/ns, 53.821 timesteps/s 48.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 | 18.101 | 18.101 | 18.101 | 0.0 | 97.42 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.079684 | 0.079684 | 0.079684 | 0.0 | 0.43 Output | 4.0054e-05 | 4.0054e-05 | 4.0054e-05 | 0.0 | 0.00 Modify | 0.37894 | 0.37894 | 0.37894 | 0.0 | 2.04 Other | | 0.02043 | | | 0.11 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 5841 ave 5841 max 5841 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: 413770 ave 413770 max 413770 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 413770 Ave neighs/atom = 103.442 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.369 | 5.369 | 5.369 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 4000 -13182.168 -13182.168 -13323.737 -13323.737 273.87447 273.87447 68297.022 68297.022 153.21298 153.21298 5000 -13181.326 -13181.326 -13321.751 -13321.751 271.66253 271.66253 68291.542 68291.542 501.76498 501.76498 Loop time of 18.4568 on 1 procs for 1000 steps with 4000 atoms Performance: 4.681 ns/day, 5.127 hours/ns, 54.181 timesteps/s 49.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 | 17.929 | 17.929 | 17.929 | 0.0 | 97.14 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.09956 | 0.09956 | 0.09956 | 0.0 | 0.54 Output | 3.4094e-05 | 3.4094e-05 | 3.4094e-05 | 0.0 | 0.00 Modify | 0.36786 | 0.36786 | 0.36786 | 0.0 | 1.99 Other | | 0.06043 | | | 0.33 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 5841 ave 5841 max 5841 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: 415916 ave 415916 max 415916 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 415916 Ave neighs/atom = 103.979 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 = 272.478798463618, Press = 224.146510394293 next a jump SELF top variable a loop 2000 run 1000 Per MPI rank memory allocation (min/avg/max) = 5.369 | 5.369 | 5.369 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 5000 -13181.326 -13181.326 -13321.751 -13321.751 271.66253 271.66253 68291.542 68291.542 501.76498 501.76498 6000 -13179.462 -13179.462 -13319.293 -13319.293 270.51105 270.51105 68253.938 68253.938 1156.8364 1156.8364 Loop time of 19.906 on 1 procs for 1000 steps with 4000 atoms Performance: 4.340 ns/day, 5.529 hours/ns, 50.236 timesteps/s 45.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 | 19.355 | 19.355 | 19.355 | 0.0 | 97.23 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.039825 | 0.039825 | 0.039825 | 0.0 | 0.20 Output | 3.3855e-05 | 3.3855e-05 | 3.3855e-05 | 0.0 | 0.00 Modify | 0.47124 | 0.47124 | 0.47124 | 0.0 | 2.37 Other | | 0.04024 | | | 0.20 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 5841 ave 5841 max 5841 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: 416006 ave 416006 max 416006 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 416006 Ave neighs/atom = 104.001 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 = 273.594047347415, Press = 23.6482175489447 next a jump SELF top variable a loop 2000 run 1000 Per MPI rank memory allocation (min/avg/max) = 5.369 | 5.369 | 5.369 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 6000 -13179.462 -13179.462 -13319.293 -13319.293 270.51105 270.51105 68253.938 68253.938 1156.8364 1156.8364 7000 -13183.861 -13183.861 -13326.346 -13326.346 275.64598 275.64598 68252.739 68252.739 307.1142 307.1142 Loop time of 19.1916 on 1 procs for 1000 steps with 4000 atoms Performance: 4.502 ns/day, 5.331 hours/ns, 52.106 timesteps/s 47.3% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 18.86 | 18.86 | 18.86 | 0.0 | 98.27 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.059451 | 0.059451 | 0.059451 | 0.0 | 0.31 Output | 3.314e-05 | 3.314e-05 | 3.314e-05 | 0.0 | 0.00 Modify | 0.25156 | 0.25156 | 0.25156 | 0.0 | 1.31 Other | | 0.02045 | | | 0.11 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 5841 ave 5841 max 5841 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: 417190 ave 417190 max 417190 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 417190 Ave neighs/atom = 104.297 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 = 273.235097730244, Press = -1.45808858894625 next a jump SELF top variable a loop 2000 run 1000 Per MPI rank memory allocation (min/avg/max) = 5.369 | 5.369 | 5.369 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 7000 -13183.861 -13183.861 -13326.346 -13326.346 275.64598 275.64598 68252.739 68252.739 307.1142 307.1142 8000 -13175.634 -13175.634 -13318.269 -13318.269 275.93611 275.93611 68404.24 68404.24 -247.07626 -247.07626 Loop time of 18.7146 on 1 procs for 1000 steps with 4000 atoms Performance: 4.617 ns/day, 5.199 hours/ns, 53.434 timesteps/s 48.3% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 18.224 | 18.224 | 18.224 | 0.0 | 97.38 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.059716 | 0.059716 | 0.059716 | 0.0 | 0.32 Output | 3.5048e-05 | 3.5048e-05 | 3.5048e-05 | 0.0 | 0.00 Modify | 0.35046 | 0.35046 | 0.35046 | 0.0 | 1.87 Other | | 0.08024 | | | 0.43 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 5841 ave 5841 max 5841 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: 416350 ave 416350 max 416350 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 416350 Ave neighs/atom = 104.088 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_T273.15.out" else "print 'not_converged' file output/vol_T273.15.out" print '${V}' file output/vol_T273.15.out 68333.2241707369 print "LAMMPS calculation completed" LAMMPS calculation completed quit 0