# Define looping variables variable loopcount loop 42 variable latticeconst index 9.105230 8.495146 8.117040 7.842326 7.626434 7.448564 7.297306 7.165726 7.049286 6.944860 6.850199 6.763632 6.683882 6.609955 6.541057 6.476548 6.415901 6.358681 6.304520 6.253109 6.204180 6.157506 6.112888 6.070153 6.041059 6.010440 5.978125 5.943916 5.907577 5.868826 5.827318 5.782632 5.734240 5.681471 5.623455 5.559031 5.486606 5.403907 5.307529 5.192033 5.047909 4.856120 # 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 fcc lattice using a single conventional (orthogonal) # unit cell with a lattice constant from the 'latticeconst' variable defined on line 3 above lattice fcc ${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_HighCutoff_Sr__MO_497591319122_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