# 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.050000071525574*${_u_distance} variable latticeconst_converted equal 4.050000071525574*1 lattice fcc ${latticeconst_converted} lattice fcc 4.05000007152557 Lattice spacing in x,y,z = 4.05 4.05 4.05 region simbox block 0 10 0 10 0 10 units lattice create_box 1 simbox Created orthogonal box = (0 0 0) to (40.5 40.5 40.5) 1 by 1 by 1 MPI processor grid create_atoms 1 box Created 4000 atoms create_atoms CPU = 0.000467062 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_AngeloMoodyBaskes_1995_NiAlH__MO_418978237058_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 66430.1285195946 variable V0_metal equal ${V0}/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 66430.1285195946/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 66430.1285195946/(1*${_u_distance}*${_u_distance}) variable V0_metal equal 66430.1285195946/(1*1*${_u_distance}) variable V0_metal equal 66430.1285195946/(1*1*1) variable V0_metal_times1000 equal ${V0_metal}*1000 variable V0_metal_times1000 equal 66430.1285195946*1000 print "Initial system volume: ${V0_metal} Angstroms^3" Initial system volume: 66430.1285195946 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 253.15*${_u_temperature} variable temp_converted equal 253.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 253.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 253.15 ${temp_converted} ${Tdamp_converted} iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 253.15 253.15 ${Tdamp_converted} iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 253.15 253.15 0.1 iso ${press_converted} ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 253.15 253.15 0.1 iso 0 ${press_converted} ${Pdamp_converted} fix ensemble all npt temp 253.15 253.15 0.1 iso 0 0 ${Pdamp_converted} fix ensemble all npt temp 253.15 253.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 "253.15 - 0.2" variable T_up equal "253.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.65 ghost atom cutoff = 7.65 binsize = 3.825, bins = 11 11 11 1 neighbor lists, perpetual/occasional/extra = 1 0 0 (1) pair kim, perpetual attributes: full, newton off, cut 7.65 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 -13309.144 -13309.144 -13440 -13440 253.15 253.15 66430.129 66430.129 2104.0088 2104.0088 1000 -13148.058 -13148.058 -13284.92 -13284.92 264.76818 264.76818 68272.262 68272.262 1184.9377 1184.9377 Loop time of 33.7722 on 1 procs for 1000 steps with 4000 atoms Performance: 2.558 ns/day, 9.381 hours/ns, 29.610 timesteps/s 25.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 | 32.719 | 32.719 | 32.719 | 0.0 | 96.88 Neigh | 0.14039 | 0.14039 | 0.14039 | 0.0 | 0.42 Comm | 0.19097 | 0.19097 | 0.19097 | 0.0 | 0.57 Output | 4.6015e-05 | 4.6015e-05 | 4.6015e-05 | 0.0 | 0.00 Modify | 0.64145 | 0.64145 | 0.64145 | 0.0 | 1.90 Other | | 0.08001 | | | 0.24 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: 439030 ave 439030 max 439030 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 439030 Ave neighs/atom = 109.757 Neighbor list builds = 2 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 -13148.058 -13148.058 -13284.92 -13284.92 264.76818 264.76818 68272.262 68272.262 1184.9377 1184.9377 2000 -13163.611 -13163.611 -13293.14 -13293.14 250.58339 250.58339 68319.427 68319.427 -499.18055 -499.18055 Loop time of 39.7061 on 1 procs for 1000 steps with 4000 atoms Performance: 2.176 ns/day, 11.029 hours/ns, 25.185 timesteps/s 24.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 | 38.635 | 38.635 | 38.635 | 0.0 | 97.30 Neigh | 0.092274 | 0.092274 | 0.092274 | 0.0 | 0.23 Comm | 0.040437 | 0.040437 | 0.040437 | 0.0 | 0.10 Output | 3.6001e-05 | 3.6001e-05 | 3.6001e-05 | 0.0 | 0.00 Modify | 0.79746 | 0.79746 | 0.79746 | 0.0 | 2.01 Other | | 0.1406 | | | 0.35 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: 441026 ave 441026 max 441026 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 441026 Ave neighs/atom = 110.257 Neighbor list builds = 2 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 -13163.611 -13163.611 -13293.14 -13293.14 250.58339 250.58339 68319.427 68319.427 -499.18055 -499.18055 3000 -13163.645 -13163.645 -13293.168 -13293.168 250.571 250.571 68173.124 68173.124 1004.8119 1004.8119 Loop time of 35.5485 on 1 procs for 1000 steps with 4000 atoms Performance: 2.430 ns/day, 9.875 hours/ns, 28.131 timesteps/s 25.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.637 | 34.637 | 34.637 | 0.0 | 97.44 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.2193 | 0.2193 | 0.2193 | 0.0 | 0.62 Output | 4.4107e-05 | 4.4107e-05 | 4.4107e-05 | 0.0 | 0.00 Modify | 0.64202 | 0.64202 | 0.64202 | 0.0 | 1.81 Other | | 0.05013 | | | 0.14 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 5842 ave 5842 max 5842 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: 439832 ave 439832 max 439832 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 439832 Ave neighs/atom = 109.958 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 -13163.645 -13163.645 -13293.168 -13293.168 250.571 250.571 68173.124 68173.124 1004.8119 1004.8119 4000 -13162.673 -13162.673 -13291.917 -13291.917 250.03248 250.03248 68368.657 68368.657 -840.73573 -840.73573 Loop time of 37.737 on 1 procs for 1000 steps with 4000 atoms Performance: 2.290 ns/day, 10.483 hours/ns, 26.499 timesteps/s 25.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 | 36.629 | 36.629 | 36.629 | 0.0 | 97.06 Neigh | 0.045251 | 0.045251 | 0.045251 | 0.0 | 0.12 Comm | 0.24963 | 0.24963 | 0.24963 | 0.0 | 0.66 Output | 4.2915e-05 | 4.2915e-05 | 4.2915e-05 | 0.0 | 0.00 Modify | 0.76255 | 0.76255 | 0.76255 | 0.0 | 2.02 Other | | 0.05013 | | | 0.13 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: 440444 ave 440444 max 440444 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 440444 Ave neighs/atom = 110.111 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 4000 -13162.673 -13162.673 -13291.917 -13291.917 250.03248 250.03248 68368.657 68368.657 -840.73573 -840.73573 5000 -13159.742 -13159.742 -13290.223 -13290.223 252.42278 252.42278 68329.215 68329.215 -58.034872 -58.034872 Loop time of 38.8854 on 1 procs for 1000 steps with 4000 atoms Performance: 2.222 ns/day, 10.802 hours/ns, 25.717 timesteps/s 25.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 | 37.679 | 37.679 | 37.679 | 0.0 | 96.90 Neigh | 0.23994 | 0.23994 | 0.23994 | 0.0 | 0.62 Comm | 0.12997 | 0.12997 | 0.12997 | 0.0 | 0.33 Output | 3.4094e-05 | 3.4094e-05 | 3.4094e-05 | 0.0 | 0.00 Modify | 0.72631 | 0.72631 | 0.72631 | 0.0 | 1.87 Other | | 0.1098 | | | 0.28 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: 438658 ave 438658 max 438658 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 438658 Ave neighs/atom = 109.665 Neighbor list builds = 4 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 = 254.467938602205, Press = -407.163993759413 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 -13159.742 -13159.742 -13290.223 -13290.223 252.42278 252.42278 68329.215 68329.215 -58.034872 -58.034872 6000 -13159.157 -13159.157 -13289.287 -13289.287 251.74371 251.74371 68316.484 68316.484 169.66981 169.66981 Loop time of 35.649 on 1 procs for 1000 steps with 4000 atoms Performance: 2.424 ns/day, 9.902 hours/ns, 28.051 timesteps/s 25.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.882 | 34.882 | 34.882 | 0.0 | 97.85 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.099075 | 0.099075 | 0.099075 | 0.0 | 0.28 Output | 4.6015e-05 | 4.6015e-05 | 4.6015e-05 | 0.0 | 0.00 Modify | 0.58779 | 0.58779 | 0.58779 | 0.0 | 1.65 Other | | 0.08014 | | | 0.22 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: 439482 ave 439482 max 439482 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 439482 Ave neighs/atom = 109.871 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 = 253.479137249369, Press = -15.2301970002866 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 -13159.157 -13159.157 -13289.287 -13289.287 251.74371 251.74371 68316.484 68316.484 169.66981 169.66981 7000 -13163.183 -13163.183 -13293.749 -13293.749 252.58971 252.58971 68239.843 68239.843 308.03309 308.03309 Loop time of 38.7313 on 1 procs for 1000 steps with 4000 atoms Performance: 2.231 ns/day, 10.759 hours/ns, 25.819 timesteps/s 25.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 | 37.814 | 37.814 | 37.814 | 0.0 | 97.63 Neigh | 0.090851 | 0.090851 | 0.090851 | 0.0 | 0.23 Comm | 0.099629 | 0.099629 | 0.099629 | 0.0 | 0.26 Output | 3.4094e-05 | 3.4094e-05 | 3.4094e-05 | 0.0 | 0.00 Modify | 0.67701 | 0.67701 | 0.67701 | 0.0 | 1.75 Other | | 0.05009 | | | 0.13 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: 439414 ave 439414 max 439414 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 439414 Ave neighs/atom = 109.853 Neighbor list builds = 2 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_T253.15.out" else "print 'not_converged' file output/vol_T253.15.out" print '${V}' file output/vol_T253.15.out 68296.8045517284 print "LAMMPS calculation completed" LAMMPS calculation completed quit 0