# Define looping variables variable loopcount loop 42 variable latticeconst index 11.074200 10.332194 9.872328 9.538211 9.275635 9.059303 8.875338 8.715305 8.573687 8.446681 8.331550 8.226264 8.129270 8.039357 7.955561 7.877102 7.803342 7.733748 7.667876 7.605347 7.545839 7.489073 7.434807 7.382830 7.347445 7.310204 7.270901 7.229294 7.185097 7.137966 7.087482 7.033132 6.974275 6.910095 6.839533 6.761177 6.673090 6.572507 6.455287 6.314815 6.139524 5.906260 # 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 22.989770 # Specify which KIM Model to use pair_style kim LJ_ElliottAkerson_2015_Universal__MO_959249795837_003 pair_coeff * * Na # 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