# Define looping variables variable loopcount loop 42 variable latticeconst index 14.903400 13.904812 13.285927 12.836274 12.482901 12.191762 11.944184 11.728812 11.538223 11.367298 11.212357 11.070663 10.940129 10.819124 10.706352 10.600763 10.501496 10.407838 10.319187 10.235036 10.154950 10.078554 10.005524 9.935574 9.887954 9.837836 9.784944 9.728951 9.669472 9.606044 9.538105 9.464963 9.385756 9.299385 9.204425 9.098976 8.980431 8.845070 8.687320 8.498278 8.262378 7.948460 # 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 LAMMPSvirial Pair_Morse_Shifted_GirifalcoWeizer_LowCutoff_Rb__MO_754498969542_001 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