# Define looping variables variable loopcount loop 42 variable latticeconst index 13.907000 12.975173 12.397664 11.978073 11.648325 11.376650 11.145623 10.944650 10.766804 10.607306 10.462723 10.330502 10.208695 10.095780 9.990547 9.892017 9.799387 9.711990 9.629267 9.550742 9.476010 9.404722 9.336573 9.271300 9.226864 9.180097 9.130741 9.078492 9.022989 8.963802 8.900405 8.832154 8.758242 8.677645 8.589034 8.490635 8.380016 8.253705 8.106502 7.930098 7.709971 7.417040 # 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 137.327 # Specify which KIM Model to use pair_style kim Morse_Shifted_GirifalcoWeizer_1959HighCutoff_Ba__MO_676977998912_003 pair_coeff * * Ba # 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