# 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.080053436756135*${_u_distance} variable latticeconst_converted equal 4.080053436756135*1 lattice fcc ${latticeconst_converted} lattice fcc 4.08005343675613 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.030447 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_2004NISTretabulation_CuAgAu__MO_318213562153_000 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 67919.9806238031 variable V0_metal equal ${V0}/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 67919.9806238031/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 67919.9806238031/(1*${_u_distance}*${_u_distance}) variable V0_metal equal 67919.9806238031/(1*1*${_u_distance}) variable V0_metal equal 67919.9806238031/(1*1*1) variable V0_metal_times1000 equal ${V0_metal}*1000 variable V0_metal_times1000 equal 67919.9806238031*1000 print "Initial system volume: ${V0_metal} Angstroms^3" Initial system volume: 67919.9806238031 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.46629 ghost atom cutoff = 8.46629 binsize = 4.23315, bins = 10 10 10 1 neighbor lists, perpetual/occasional/extra = 1 0 0 (1) pair kim, perpetual attributes: full, newton off, cut 8.46629 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.811 -15547.811 -15720.02 -15720.02 333.15 333.15 67919.981 67919.981 2708.1992 2708.1992 1000 -15350.28 -15350.28 -15528.441 -15528.441 344.66488 344.66488 69301.218 69301.218 -3445.1533 -3445.1533 Loop time of 28.4056 on 1 procs for 1000 steps with 4000 atoms Performance: 3.042 ns/day, 7.890 hours/ns, 35.204 timesteps/s 41.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 | 27.82 | 27.82 | 27.82 | 0.0 | 97.94 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.18324 | 0.18324 | 0.18324 | 0.0 | 0.65 Output | 4.6015e-05 | 4.6015e-05 | 4.6015e-05 | 0.0 | 0.00 Modify | 0.38129 | 0.38129 | 0.38129 | 0.0 | 1.34 Other | | 0.02116 | | | 0.07 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.66488 344.66488 69301.218 69301.218 -3445.1533 -3445.1533 2000 -15377.527 -15377.527 -15545.773 -15545.773 325.48289 325.48289 69053.983 69053.983 -122.14797 -122.14797 Loop time of 29.3239 on 1 procs for 1000 steps with 4000 atoms Performance: 2.946 ns/day, 8.146 hours/ns, 34.102 timesteps/s 42.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 | 28.782 | 28.782 | 28.782 | 0.0 | 98.15 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.1396 | 0.1396 | 0.1396 | 0.0 | 0.48 Output | 4.0054e-05 | 4.0054e-05 | 4.0054e-05 | 0.0 | 0.00 Modify | 0.34787 | 0.34787 | 0.34787 | 0.0 | 1.19 Other | | 0.05451 | | | 0.19 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 8162 ave 8162 max 8162 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: 566674 ave 566674 max 566674 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 566674 Ave neighs/atom = 141.668 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.527 -15377.527 -15545.773 -15545.773 325.48289 325.48289 69053.983 69053.983 -122.14797 -122.14797 3000 -15363.672 -15363.672 -15541.341 -15541.341 343.71321 343.71321 69128.388 69128.388 -1201.8765 -1201.8765 Loop time of 29.757 on 1 procs for 1000 steps with 4000 atoms Performance: 2.904 ns/day, 8.266 hours/ns, 33.606 timesteps/s 41.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 | 29.171 | 29.171 | 29.171 | 0.0 | 98.03 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.16348 | 0.16348 | 0.16348 | 0.0 | 0.55 Output | 4.4107e-05 | 4.4107e-05 | 4.4107e-05 | 0.0 | 0.00 Modify | 0.38179 | 0.38179 | 0.38179 | 0.0 | 1.28 Other | | 0.04111 | | | 0.14 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 8148 ave 8148 max 8148 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: 567132 ave 567132 max 567132 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 567132 Ave neighs/atom = 141.783 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.71321 343.71321 69128.388 69128.388 -1201.8765 -1201.8765 4000 -15375.084 -15375.084 -15541.124 -15541.124 321.2154 321.2154 69120.487 69120.487 -1139.3105 -1139.3105 Loop time of 30.0512 on 1 procs for 1000 steps with 4000 atoms Performance: 2.875 ns/day, 8.348 hours/ns, 33.277 timesteps/s 40.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 | 29.399 | 29.399 | 29.399 | 0.0 | 97.83 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.1936 | 0.1936 | 0.1936 | 0.0 | 0.64 Output | 3.6955e-05 | 3.6955e-05 | 3.6955e-05 | 0.0 | 0.00 Modify | 0.37687 | 0.37687 | 0.37687 | 0.0 | 1.25 Other | | 0.08137 | | | 0.27 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 8169 ave 8169 max 8169 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: 566536 ave 566536 max 566536 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 566536 Ave neighs/atom = 141.634 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.124 -15541.124 321.2154 321.2154 69120.487 69120.487 -1139.3105 -1139.3105 5000 -15370.238 -15370.238 -15541.977 -15541.977 332.23932 332.23932 69073.614 69073.614 -39.503774 -39.503774 Loop time of 28.4119 on 1 procs for 1000 steps with 4000 atoms Performance: 3.041 ns/day, 7.892 hours/ns, 35.197 timesteps/s 43.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 | 27.836 | 27.836 | 27.836 | 0.0 | 97.97 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.19878 | 0.19878 | 0.19878 | 0.0 | 0.70 Output | 2.5988e-05 | 2.5988e-05 | 2.5988e-05 | 0.0 | 0.00 Modify | 0.315 | 0.315 | 0.315 | 0.0 | 1.11 Other | | 0.0616 | | | 0.22 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 8169 ave 8169 max 8169 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: 566214 ave 566214 max 566214 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 566214 Ave neighs/atom = 141.554 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.17867849474, Press = 109.648584489909 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.23932 332.23932 69073.614 69073.614 -39.503774 -39.503774 6000 -15370.871 -15370.871 -15545.493 -15545.493 337.81844 337.81844 69108.023 69108.023 -1289.8145 -1289.8145 Loop time of 28.887 on 1 procs for 1000 steps with 4000 atoms Performance: 2.991 ns/day, 8.024 hours/ns, 34.618 timesteps/s 42.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 | 28.253 | 28.253 | 28.253 | 0.0 | 97.81 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.15379 | 0.15379 | 0.15379 | 0.0 | 0.53 Output | 3.4094e-05 | 3.4094e-05 | 3.4094e-05 | 0.0 | 0.00 Modify | 0.43822 | 0.43822 | 0.43822 | 0.0 | 1.52 Other | | 0.04175 | | | 0.14 Nlocal: 4000 ave 4000 max 4000 min Histogram: 1 0 0 0 0 0 0 0 0 0 Nghost: 8144 ave 8144 max 8144 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: 566980 ave 566980 max 566980 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 566980 Ave neighs/atom = 141.745 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.0663718276 print "LAMMPS calculation completed" LAMMPS calculation completed quit 0