# Define looping variables variable loopcount loop 42 variable latticeconst index 13.615700 12.703404 12.138000 11.727204 11.404368 11.138387 10.912203 10.715442 10.541323 10.385169 10.243617 10.114167 9.994913 9.884365 9.781338 9.684873 9.594185 9.508620 9.427630 9.350751 9.277586 9.207791 9.141071 9.077166 9.033661 8.987873 8.939550 8.888395 8.834055 8.776107 8.714037 8.647215 8.574850 8.495941 8.409185 8.312847 8.204544 8.080877 7.936756 7.764046 7.548527 7.261730 # Define unit set and class of atomic model units metal atom_style atomic # Periodic boundary conditions along all three dimensions boundary p p p # Create a diamond lattice using a single conventional (orthogonal) # unit cell with a lattice constant from the 'latticeconst' variable defined on line 3 above lattice diamond ${latticeconst} region box block 0 1 0 1 0 1 units lattice create_box 1 box create_atoms 1 box mass 1 87.62 # Specify which KIM Model to use pair_style kim LAMMPSvirial Pair_Morse_Shifted_GirifalcoWeizer_MedCutoff_Sr__MO_964297938209_001 pair_coeff * * Sr # Set what thermodynamic information to print to log thermo_style custom step atoms xlo xhi ylo yhi zlo zhi pe press pxx pyy pzz pxy pxz pyz thermo 10 # Print every 10 steps # Set what information to write to dump file dump id all custom 10 output/lammps.dump id type x y z fx fy fz dump_modify id format line "%d %d %16.7f %16.7f %16.7f %16.7f %16.7f %16.7f" # Compute the energy and forces for this lattice spacing run 0 # Define auxiliary variables to contain cohesive energy and equilibrium lattice constant variable poteng equal "c_thermo_pe" variable natoms equal "count(all)" variable ecohesive equal "v_poteng/v_natoms" # Output cohesive energy and equilibrium lattice constant print "Cohesive energy = ${ecohesive} eV/atom" # Queue next loop clear # Clear existing atoms, variables, and allocated memory next latticeconst # Increment latticeconst to next value next loopcount # Increment loopcount to next value jump SELF # Reload this input script with the new variable values