# Define looping variables variable loopcount loop 42 variable latticeconst index 15.695200 14.643558 13.991793 13.518250 13.146103 12.839496 12.578765 12.351950 12.151236 11.971230 11.808057 11.658835 11.521366 11.393932 11.275168 11.163969 11.059429 10.960795 10.867434 10.778813 10.694472 10.614017 10.537106 10.463440 10.413290 10.360510 10.304807 10.245839 10.183200 10.116402 10.044854 9.967826 9.884410 9.793450 9.693445 9.582394 9.457551 9.314998 9.148866 8.949780 8.701347 8.370750 # 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 132.90545 # Specify which KIM Model to use pair_style kim LAMMPSvirial Pair_Morse_Shifted_GirifalcoWeizer_HighCutoff_Cs__MO_187111446479_001 pair_coeff * * Cs # 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