# Define looping variables variable loopcount loop 42 variable latticeconst index 15.794800 14.736484 14.080582 13.604034 13.229525 12.920972 12.658586 12.430332 12.228344 12.047196 11.882987 11.732818 11.594476 11.466234 11.346716 11.234812 11.129608 11.030347 10.936394 10.847210 10.762334 10.681369 10.603970 10.529836 10.479368 10.426253 10.370196 10.310855 10.247819 10.180597 10.108594 10.031078 9.947133 9.855596 9.754956 9.643200 9.517565 9.374108 9.206922 9.006573 8.756564 8.423870 # 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_MedCutoff_Cs__MO_999639780744_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