# 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.334010653197765*${_u_distance} variable latticeconst_converted equal 5.334010653197765*1 lattice bcc ${latticeconst_converted} lattice bcc 5.33401065319777 Lattice spacing in x,y,z = 5.33401 5.33401 5.33401 region simbox block 0 10 0 10 0 10 units lattice create_box 1 simbox Created orthogonal box = (0 0 0) to (53.3401 53.3401 53.3401) 1 by 1 by 1 MPI processor grid create_atoms 1 box Created 2000 atoms create_atoms CPU = 0.000308037 secs variable mass_converted equal 39.0983*${_u_mass} variable mass_converted equal 39.0983*1 # specify which KIM Model to use pair_style kim Morse_Shifted_GirifalcoWeizer_1959LowCutoff_K__MO_749732139672_003 WARNING: KIM Model does not provide `partialParticleVirial'; virial per atom will be zero (src/KIM/pair_kim.cpp:1089) pair_coeff * * K mass 1 ${mass_converted} mass 1 39.0983 # initial volume variable v equal vol # assign formula variable V0 equal ${v} # evaluate initial value variable V0 equal 151761.509005975 variable V0_metal equal ${V0}/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 151761.509005975/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 151761.509005975/(1*${_u_distance}*${_u_distance}) variable V0_metal equal 151761.509005975/(1*1*${_u_distance}) variable V0_metal equal 151761.509005975/(1*1*1) variable V0_metal_times1000 equal ${V0_metal}*1000 variable V0_metal_times1000 equal 151761.509005975*1000 print "Initial system volume: ${V0_metal} Angstroms^3" Initial system volume: 151761.509005975 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 293.15*${_u_temperature} variable temp_converted equal 293.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 293.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 293.15 ${temp_converted} ${Tdamp_converted} iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 293.15 293.15 ${Tdamp_converted} iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 293.15 293.15 0.1 iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 293.15 293.15 0.1 iso 0 ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 293.15 293.15 0.1 iso 0 0 ${Pdamp_converted} fix ensemble all npt temp 293.15 293.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 "293.15 - 0.2" variable T_up equal "293.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 = 19.0102 ghost atom cutoff = 19.0102 binsize = 9.5051, bins = 6 6 6 1 neighbor lists, perpetual/occasional/extra = 1 0 0 (1) pair kim, perpetual attributes: full, newton off, cut 19.0102 pair build: full/bin/atomonly stencil: full/bin/3d bin: standard Per MPI rank memory allocation (min/avg/max) = 5.895 | 5.895 | 5.895 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 0 -1594.6546 -1594.6546 -1670.4019 -1670.4019 293.15 293.15 151761.51 151761.51 533.11944 533.11944 1000 -1499.6166 -1499.6166 -1579.6693 -1579.6693 309.81227 309.81227 161166.3 161166.3 48.880904 48.880904 Loop time of 35.1463 on 1 procs for 1000 steps with 2000 atoms Performance: 2.458 ns/day, 9.763 hours/ns, 28.453 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 | 34.405 | 34.405 | 34.405 | 0.0 | 97.89 Neigh | 0.42498 | 0.42498 | 0.42498 | 0.0 | 1.21 Comm | 0.08879 | 0.08879 | 0.08879 | 0.0 | 0.25 Output | 3.6001e-05 | 3.6001e-05 | 3.6001e-05 | 0.0 | 0.00 Modify | 0.21381 | 0.21381 | 0.21381 | 0.0 | 0.61 Other | | 0.0134 | | | 0.04 Nlocal: 2000 ave 2000 max 2000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 7732 ave 7732 max 7732 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: 695522 ave 695522 max 695522 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 695522 Ave neighs/atom = 347.761 Neighbor list builds = 10 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) = 6.277 | 6.277 | 6.277 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 1000 -1499.6166 -1499.6166 -1579.6693 -1579.6693 309.81227 309.81227 161166.3 161166.3 48.880904 48.880904 2000 -1513.0483 -1513.0483 -1586.9487 -1586.9487 286.0022 286.0022 160216.06 160216.06 72.275122 72.275122 Loop time of 35.3428 on 1 procs for 1000 steps with 2000 atoms Performance: 2.445 ns/day, 9.817 hours/ns, 28.294 timesteps/s 48.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 | 34.692 | 34.692 | 34.692 | 0.0 | 98.16 Neigh | 0.3861 | 0.3861 | 0.3861 | 0.0 | 1.09 Comm | 0.066913 | 0.066913 | 0.066913 | 0.0 | 0.19 Output | 2.7895e-05 | 2.7895e-05 | 2.7895e-05 | 0.0 | 0.00 Modify | 0.18459 | 0.18459 | 0.18459 | 0.0 | 0.52 Other | | 0.01311 | | | 0.04 Nlocal: 2000 ave 2000 max 2000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 7802 ave 7802 max 7802 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: 700958 ave 700958 max 700958 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 700958 Ave neighs/atom = 350.479 Neighbor list builds = 10 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) = 6.277 | 6.277 | 6.277 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 2000 -1513.0483 -1513.0483 -1586.9487 -1586.9487 286.0022 286.0022 160216.06 160216.06 72.275122 72.275122 3000 -1512.0529 -1512.0529 -1587.1287 -1587.1287 290.55084 290.55084 160281.47 160281.47 65.641227 65.641227 Loop time of 34.2808 on 1 procs for 1000 steps with 2000 atoms Performance: 2.520 ns/day, 9.522 hours/ns, 29.171 timesteps/s 49.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 | 33.581 | 33.581 | 33.581 | 0.0 | 97.96 Neigh | 0.39498 | 0.39498 | 0.39498 | 0.0 | 1.15 Comm | 0.12724 | 0.12724 | 0.12724 | 0.0 | 0.37 Output | 3.0041e-05 | 3.0041e-05 | 3.0041e-05 | 0.0 | 0.00 Modify | 0.14394 | 0.14394 | 0.14394 | 0.0 | 0.42 Other | | 0.03328 | | | 0.10 Nlocal: 2000 ave 2000 max 2000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 7807 ave 7807 max 7807 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: 698064 ave 698064 max 698064 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 698064 Ave neighs/atom = 349.032 Neighbor list builds = 10 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) = 6.277 | 6.277 | 6.277 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 3000 -1512.0529 -1512.0529 -1587.1287 -1587.1287 290.55084 290.55084 160281.47 160281.47 65.641227 65.641227 4000 -1512.4559 -1512.4559 -1587.7824 -1587.7824 291.52135 291.52135 160287.97 160287.97 50.185629 50.185629 Loop time of 43.2841 on 1 procs for 1000 steps with 2000 atoms Performance: 1.996 ns/day, 12.023 hours/ns, 23.103 timesteps/s 39.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 | 42.281 | 42.281 | 42.281 | 0.0 | 97.68 Neigh | 0.57819 | 0.57819 | 0.57819 | 0.0 | 1.34 Comm | 0.10823 | 0.10823 | 0.10823 | 0.0 | 0.25 Output | 2.7895e-05 | 2.7895e-05 | 2.7895e-05 | 0.0 | 0.00 Modify | 0.27314 | 0.27314 | 0.27314 | 0.0 | 0.63 Other | | 0.04335 | | | 0.10 Nlocal: 2000 ave 2000 max 2000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 7750 ave 7750 max 7750 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: 696356 ave 696356 max 696356 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 696356 Ave neighs/atom = 348.178 Neighbor list builds = 10 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) = 6.277 | 6.277 | 6.277 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 4000 -1512.4559 -1512.4559 -1587.7824 -1587.7824 291.52135 291.52135 160287.97 160287.97 50.185629 50.185629 5000 -1509.2413 -1509.2413 -1585.1045 -1585.1045 293.59844 293.59844 160710.13 160710.13 17.384623 17.384623 Loop time of 44.0434 on 1 procs for 1000 steps with 2000 atoms Performance: 1.962 ns/day, 12.234 hours/ns, 22.705 timesteps/s 39.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 | 43.156 | 43.156 | 43.156 | 0.0 | 97.98 Neigh | 0.56318 | 0.56318 | 0.56318 | 0.0 | 1.28 Comm | 0.12797 | 0.12797 | 0.12797 | 0.0 | 0.29 Output | 2.9087e-05 | 2.9087e-05 | 2.9087e-05 | 0.0 | 0.00 Modify | 0.18367 | 0.18367 | 0.18367 | 0.0 | 0.42 Other | | 0.01308 | | | 0.03 Nlocal: 2000 ave 2000 max 2000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 7817 ave 7817 max 7817 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: 697244 ave 697244 max 697244 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 697244 Ave neighs/atom = 348.622 Neighbor list builds = 10 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 = 295.014548875036, Press = -5.31499077797441 next a jump SELF top variable a loop 2000 run 1000 Per MPI rank memory allocation (min/avg/max) = 6.277 | 6.277 | 6.277 Mbytes Step TotEng v_etotal_metal PotEng v_pe_metal Temp v_T_metal Volume v_V_metal Press v_P_metal 5000 -1509.2413 -1509.2413 -1585.1045 -1585.1045 293.59844 293.59844 160710.13 160710.13 17.384623 17.384623 6000 -1509.5198 -1509.5198 -1583.676 -1583.676 286.9921 286.9921 160565.12 160565.12 46.507024 46.507024 Loop time of 39.8527 on 1 procs for 1000 steps with 2000 atoms Performance: 2.168 ns/day, 11.070 hours/ns, 25.092 timesteps/s 43.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 | 39.052 | 39.052 | 39.052 | 0.0 | 97.99 Neigh | 0.48638 | 0.48638 | 0.48638 | 0.0 | 1.22 Comm | 0.10759 | 0.10759 | 0.10759 | 0.0 | 0.27 Output | 2.8849e-05 | 2.8849e-05 | 2.8849e-05 | 0.0 | 0.00 Modify | 0.1839 | 0.1839 | 0.1839 | 0.0 | 0.46 Other | | 0.02317 | | | 0.06 Nlocal: 2000 ave 2000 max 2000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 7825 ave 7825 max 7825 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: 698956 ave 698956 max 698956 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 698956 Ave neighs/atom = 349.478 Neighbor list builds = 10 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_T293.15.out" else "print 'not_converged' file output/vol_T293.15.out" print '${V}' file output/vol_T293.15.out 160718.171476029 print "LAMMPS calculation completed" LAMMPS calculation completed quit 0