# Define looping variables variable loopcount loop 42 variable latticeconst index 13.747600 12.826459 12.255572 11.840793 11.514826 11.246267 11.017890 10.819221 10.643414 10.485745 10.342820 10.212116 10.091705 9.980085 9.876059 9.778659 9.687091 9.600697 9.518922 9.441297 9.367423 9.296952 9.229585 9.165060 9.121133 9.074902 9.026111 8.974461 8.919595 8.861086 8.798416 8.730946 8.657881 8.578209 8.490613 8.393342 8.283990 8.159127 8.013610 7.839229 7.621624 7.332050 # 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 Morse_Shifted_GirifalcoWeizer_1959LowCutoff_Sr__MO_801083489225_002 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