# 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.080054295063022*${_u_distance} variable latticeconst_converted equal 4.080054295063022*1 lattice fcc ${latticeconst_converted} lattice fcc 4.08005429506302 Lattice spacing in x,y,z = 4.08005 4.08005 4.08005 region simbox block 0 10 0 10 0 10 units lattice create_box 1 simbox Created orthogonal box = (0 0 0) to (40.8005 40.8005 40.8005) 1 by 1 by 1 MPI processor grid create_atoms 1 box Created 4000 atoms create_atoms CPU = 0.000522852 secs variable mass_converted equal 196.96655*${_u_mass} variable mass_converted equal 196.96655*1 # specify which KIM Model to use pair_style kim EAM_Dynamo_ZhouJohnsonWadley_2004_Au__MO_468407568810_005 pair_coeff * * Au mass 1 ${mass_converted} mass 1 196.96655 # initial volume variable v equal vol # assign formula variable V0 equal ${v} # evaluate initial value variable V0 equal 67920.0234880943 variable V0_metal equal ${V0}/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 67920.0234880943/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 67920.0234880943/(1*${_u_distance}*${_u_distance}) variable V0_metal equal 67920.0234880943/(1*1*${_u_distance}) variable V0_metal equal 67920.0234880943/(1*1*1) variable V0_metal_times1000 equal ${V0_metal}*1000 variable V0_metal_times1000 equal 67920.0234880943*1000 print "Initial system volume: ${V0_metal} Angstroms^3" Initial system volume: 67920.0234880943 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 333.15*${_u_temperature} variable temp_converted equal 333.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 333.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 333.15 ${temp_converted} ${Tdamp_converted} iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 333.15 333.15 ${Tdamp_converted} iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 333.15 333.15 0.1 iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 333.15 333.15 0.1 iso 0 ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 333.15 333.15 0.1 iso 0 0 ${Pdamp_converted} fix ensemble all npt temp 333.15 333.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 "333.15 - 0.2" variable T_up equal "333.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 = 8.45113 ghost atom cutoff = 8.45113 binsize = 4.22557, bins = 10 10 10 1 neighbor lists, perpetual/occasional/extra = 1 0 0 (1) pair kim, perpetual attributes: full, newton off, cut 8.45113 pair build: full/bin/atomonly stencil: full/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 5.48 | 5.48 | 5.48 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 0 -15547.812 -15547.812 -15720.021 -15720.021 333.15 333.15 67920.023 67920.023 2720.2628 2720.2628 1000 -15350.28 -15350.28 -15528.441 -15528.441 344.66462 344.66462 69301.236 69301.236 -3445.0636 -3445.0636 Loop time of 18.7401 on 1 procs for 1000 steps with 4000 atoms Performance: 4.610 ns/day, 5.206 hours/ns, 53.361 timesteps/s 62.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.384 | 18.384 | 18.384 | 0.0 | 98.10 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.11269 | 0.11269 | 0.11269 | 0.0 | 0.60 Output | 4.4107e-05 | 4.4107e-05 | 4.4107e-05 | 0.0 | 0.00 Modify | 0.22233 | 0.22233 | 0.22233 | 0.0 | 1.19 Other | | 0.02131 | | | 0.11 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 8195 ave 8195 max 8195 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 = 140 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.48 | 5.48 | 5.48 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 1000 -15350.28 -15350.28 -15528.441 -15528.441 344.66462 344.66462 69301.236 69301.236 -3445.0636 -3445.0636 2000 -15377.526 -15377.526 -15545.772 -15545.772 325.48282 325.48282 69054 69054 -122.0221 -122.0221 Loop time of 24.0319 on 1 procs for 1000 steps with 4000 atoms Performance: 3.595 ns/day, 6.676 hours/ns, 41.611 timesteps/s 50.1% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 23.607 | 23.607 | 23.607 | 0.0 | 98.23 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.052583 | 0.052583 | 0.052583 | 0.0 | 0.22 Output | 4.1008e-05 | 4.1008e-05 | 4.1008e-05 | 0.0 | 0.00 Modify | 0.3311 | 0.3311 | 0.3311 | 0.0 | 1.38 Other | | 0.04121 | | | 0.17 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 8149 ave 8149 max 8149 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: 564938 ave 564938 max 564938 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 564938 Ave neighs/atom = 141.234 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.48 | 5.48 | 5.48 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 2000 -15377.526 -15377.526 -15545.772 -15545.772 325.48282 325.48282 69054 69054 -122.0221 -122.0221 3000 -15363.672 -15363.672 -15541.341 -15541.341 343.71268 343.71268 69128.4 69128.4 -1201.8228 -1201.8228 Loop time of 24.0942 on 1 procs for 1000 steps with 4000 atoms Performance: 3.586 ns/day, 6.693 hours/ns, 41.504 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 | 23.6 | 23.6 | 23.6 | 0.0 | 97.95 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.072808 | 0.072808 | 0.072808 | 0.0 | 0.30 Output | 5.1022e-05 | 5.1022e-05 | 5.1022e-05 | 0.0 | 0.00 Modify | 0.36026 | 0.36026 | 0.36026 | 0.0 | 1.50 Other | | 0.06108 | | | 0.25 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 8138 ave 8138 max 8138 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: 565366 ave 565366 max 565366 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 565366 Ave neighs/atom = 141.341 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.48 | 5.48 | 5.48 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 3000 -15363.672 -15363.672 -15541.341 -15541.341 343.71268 343.71268 69128.4 69128.4 -1201.8228 -1201.8228 4000 -15375.084 -15375.084 -15541.123 -15541.123 321.21425 321.21425 69120.512 69120.512 -1139.5022 -1139.5022 Loop time of 24.2232 on 1 procs for 1000 steps with 4000 atoms Performance: 3.567 ns/day, 6.729 hours/ns, 41.283 timesteps/s 50.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 | 23.839 | 23.839 | 23.839 | 0.0 | 98.41 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.093397 | 0.093397 | 0.093397 | 0.0 | 0.39 Output | 4.4107e-05 | 4.4107e-05 | 4.4107e-05 | 0.0 | 0.00 Modify | 0.25021 | 0.25021 | 0.25021 | 0.0 | 1.03 Other | | 0.04106 | | | 0.17 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 8160 ave 8160 max 8160 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: 564716 ave 564716 max 564716 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 564716 Ave neighs/atom = 141.179 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.48 | 5.48 | 5.48 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 4000 -15375.084 -15375.084 -15541.123 -15541.123 321.21425 321.21425 69120.512 69120.512 -1139.5022 -1139.5022 5000 -15370.238 -15370.238 -15541.977 -15541.977 332.24049 332.24049 69073.647 69073.647 -40.116858 -40.116858 Loop time of 18.1921 on 1 procs for 1000 steps with 4000 atoms Performance: 4.749 ns/day, 5.053 hours/ns, 54.969 timesteps/s 66.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 | 17.817 | 17.817 | 17.817 | 0.0 | 97.94 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.13145 | 0.13145 | 0.13145 | 0.0 | 0.72 Output | 3.4809e-05 | 3.4809e-05 | 3.4809e-05 | 0.0 | 0.00 Modify | 0.22276 | 0.22276 | 0.22276 | 0.0 | 1.22 Other | | 0.02117 | | | 0.12 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 8153 ave 8153 max 8153 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: 564634 ave 564634 max 564634 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 564634 Ave neighs/atom = 141.159 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 = 328.177574360211, Press = 109.510609081261 next a jump SELF top variable a loop 2000 run 1000 Per MPI rank memory allocation (min/avg/max) = 5.48 | 5.48 | 5.48 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 5000 -15370.238 -15370.238 -15541.977 -15541.977 332.24049 332.24049 69073.647 69073.647 -40.116858 -40.116858 6000 -15370.87 -15370.87 -15545.493 -15545.493 337.81975 337.81975 69108.005 69108.005 -1288.8664 -1288.8664 Loop time of 22.238 on 1 procs for 1000 steps with 4000 atoms Performance: 3.885 ns/day, 6.177 hours/ns, 44.968 timesteps/s 54.1% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 21.816 | 21.816 | 21.816 | 0.0 | 98.10 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.13597 | 0.13597 | 0.13597 | 0.0 | 0.61 Output | 3.314e-05 | 3.314e-05 | 3.314e-05 | 0.0 | 0.00 Modify | 0.26463 | 0.26463 | 0.26463 | 0.0 | 1.19 Other | | 0.02108 | | | 0.09 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 8131 ave 8131 max 8131 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: 565174 ave 565174 max 565174 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 565174 Ave neighs/atom = 141.293 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_T333.15.out" else "print 'not_converged' file output/vol_T333.15.out" print '${V}' file output/vol_T333.15.out 69074.0812319494 print "LAMMPS calculation completed" LAMMPS calculation completed quit 0