# Define looping variables variable loopcount loop 42 variable latticeconst index 13.585100 12.674849 12.110713 11.700837 11.378724 11.113340 10.887663 10.691344 10.517615 10.361811 10.220576 10.091416 9.972430 9.862129 9.759333 9.663085 9.572599 9.487226 9.406418 9.329711 9.256710 9.187072 9.120502 9.056740 9.013332 8.967647 8.919433 8.868393 8.814176 8.756358 8.694428 8.627756 8.555555 8.476823 8.390262 8.294141 8.186082 8.062693 7.918897 7.746575 7.531542 7.245390 # 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_1959HighCutoff_Sr__MO_497591319122_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