# 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.080053400993348*${_u_distance} variable latticeconst_converted equal 4.080053400993348*1 lattice fcc ${latticeconst_converted} lattice fcc 4.08005340099335 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.000486851 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_ZhouWadleyJohnson_2001NISTretabulation_Au__MO_684444719999_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.9788377916 variable V0_metal equal ${V0}/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 67919.9788377916/(${_u_distance}*${_u_distance}*${_u_distance}) variable V0_metal equal 67919.9788377916/(1*${_u_distance}*${_u_distance}) variable V0_metal equal 67919.9788377916/(1*1*${_u_distance}) variable V0_metal equal 67919.9788377916/(1*1*1) variable V0_metal_times1000 equal ${V0_metal}*1000 variable V0_metal_times1000 equal 67919.9788377916*1000 print "Initial system volume: ${V0_metal} Angstroms^3" Initial system volume: 67919.9788377916 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.811 -15547.811 -15720.02 -15720.02 333.15 333.15 67919.979 67919.979 2708.2071 2708.2071 1000 -15350.28 -15350.28 -15528.441 -15528.441 344.6647 344.6647 69301.223 69301.223 -3445.1621 -3445.1621 Loop time of 26.4769 on 1 procs for 1000 steps with 4000 atoms Performance: 3.263 ns/day, 7.355 hours/ns, 37.769 timesteps/s 44.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 | 25.851 | 25.851 | 25.851 | 0.0 | 97.63 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.13275 | 0.13275 | 0.13275 | 0.0 | 0.50 Output | 4.5061e-05 | 4.5061e-05 | 4.5061e-05 | 0.0 | 0.00 Modify | 0.43244 | 0.43244 | 0.43244 | 0.0 | 1.63 Other | | 0.06113 | | | 0.23 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.6647 344.6647 69301.223 69301.223 -3445.1621 -3445.1621 2000 -15377.526 -15377.526 -15545.772 -15545.772 325.48293 325.48293 69053.988 69053.988 -122.16842 -122.16842 Loop time of 27.0826 on 1 procs for 1000 steps with 4000 atoms Performance: 3.190 ns/day, 7.523 hours/ns, 36.924 timesteps/s 44.5% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 26.5 | 26.5 | 26.5 | 0.0 | 97.85 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.11325 | 0.11325 | 0.11325 | 0.0 | 0.42 Output | 4.3869e-05 | 4.3869e-05 | 4.3869e-05 | 0.0 | 0.00 Modify | 0.4087 | 0.4087 | 0.4087 | 0.0 | 1.51 Other | | 0.06105 | | | 0.23 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.48293 325.48293 69053.988 69053.988 -122.16842 -122.16842 3000 -15363.672 -15363.672 -15541.341 -15541.341 343.71326 343.71326 69128.395 69128.395 -1201.9199 -1201.9199 Loop time of 25.7655 on 1 procs for 1000 steps with 4000 atoms Performance: 3.353 ns/day, 7.157 hours/ns, 38.812 timesteps/s 46.5% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 25.394 | 25.394 | 25.394 | 0.0 | 98.56 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.07236 | 0.07236 | 0.07236 | 0.0 | 0.28 Output | 3.6001e-05 | 3.6001e-05 | 3.6001e-05 | 0.0 | 0.00 Modify | 0.25757 | 0.25757 | 0.25757 | 0.0 | 1.00 Other | | 0.04109 | | | 0.16 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.71326 343.71326 69128.395 69128.395 -1201.9199 -1201.9199 4000 -15375.084 -15375.084 -15541.124 -15541.124 321.21536 321.21536 69120.491 69120.491 -1139.2939 -1139.2939 Loop time of 25.7983 on 1 procs for 1000 steps with 4000 atoms Performance: 3.349 ns/day, 7.166 hours/ns, 38.762 timesteps/s 46.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 | 25.222 | 25.222 | 25.222 | 0.0 | 97.77 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.1525 | 0.1525 | 0.1525 | 0.0 | 0.59 Output | 4.4107e-05 | 4.4107e-05 | 4.4107e-05 | 0.0 | 0.00 Modify | 0.39192 | 0.39192 | 0.39192 | 0.0 | 1.52 Other | | 0.03198 | | | 0.12 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.124 -15541.124 321.21536 321.21536 69120.491 69120.491 -1139.2939 -1139.2939 5000 -15370.238 -15370.238 -15541.976 -15541.976 332.23932 332.23932 69073.618 69073.618 -39.479391 -39.479391 Loop time of 25.4498 on 1 procs for 1000 steps with 4000 atoms Performance: 3.395 ns/day, 7.069 hours/ns, 39.293 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 | 24.836 | 24.836 | 24.836 | 0.0 | 97.59 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.093006 | 0.093006 | 0.093006 | 0.0 | 0.37 Output | 3.2902e-05 | 3.2902e-05 | 3.2902e-05 | 0.0 | 0.00 Modify | 0.4192 | 0.4192 | 0.4192 | 0.0 | 1.65 Other | | 0.1011 | | | 0.40 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.178536059479, Press = 109.627392437884 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.976 -15541.976 332.23932 332.23932 69073.618 69073.618 -39.479391 -39.479391 6000 -15370.871 -15370.871 -15545.493 -15545.493 337.81834 337.81834 69108.033 69108.033 -1289.9048 -1289.9048 Loop time of 25.2656 on 1 procs for 1000 steps with 4000 atoms Performance: 3.420 ns/day, 7.018 hours/ns, 39.580 timesteps/s 47.4% CPU use with 1 MPI tasks x 1 OpenMP threads MPI task timing breakdown: Section | min time | avg time | max time |%varavg| %total --------------------------------------------------------------- Pair | 24.831 | 24.831 | 24.831 | 0.0 | 98.28 Neigh | 0 | 0 | 0 | 0.0 | 0.00 Comm | 0.092347 | 0.092347 | 0.092347 | 0.0 | 0.37 Output | 3.314e-05 | 3.314e-05 | 3.314e-05 | 0.0 | 0.00 Modify | 0.30162 | 0.30162 | 0.30162 | 0.0 | 1.19 Other | | 0.04102 | | | 0.16 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: 565172 ave 565172 max 565172 min Histogram: 1 0 0 0 0 0 0 0 0 0 Total # of neighbors = 565172 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.0716836744 print "LAMMPS calculation completed" LAMMPS calculation completed quit 0