# Define looping variables variable loopcount loop 42 variable latticeconst index 14.388600 13.424507 12.827000 12.392880 12.051714 11.770631 11.531605 11.323673 11.139668 10.974648 10.825058 10.688259 10.562234 10.445409 10.336533 10.234591 10.138753 10.048330 9.962742 9.881498 9.804178 9.730422 9.659914 9.592380 9.546405 9.498018 9.446953 9.392894 9.335470 9.274232 9.208640 9.138024 9.061553 8.978165 8.886484 8.784678 8.670228 8.539542 8.387240 8.204727 7.976976 7.673900 # 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 85.4678 # Specify which KIM Model to use pair_style kim Morse_Shifted_GirifalcoWeizer_1959HighCutoff_Rb__MO_908110223949_003 pair_coeff * * Rb # 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