# Define looping variables variable loopcount loop 42 variable latticeconst index 12.783300 11.926770 11.395927 11.010241 10.707139 10.457417 10.245059 10.060326 9.896850 9.750241 9.617341 9.495805 9.383840 9.280049 9.183320 9.092752 9.007607 8.927272 8.851233 8.779053 8.710360 8.644833 8.582191 8.522192 8.481346 8.438358 8.392990 8.344962 8.293944 8.239539 8.181264 8.118527 8.050587 7.976503 7.895051 7.804602 7.702921 7.586815 7.451505 7.289355 7.087013 6.817750 # 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 39.948 # Specify which KIM Model to use pair_style kim LAMMPSvirial Pair_Morse_Shifted_Jelinek_Ar__MO_831902330215_001 pair_coeff * * Ar # 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