# Define looping variables variable loopcount loop 42 variable latticeconst index 10.207000 9.523092 9.099233 8.791277 8.549261 8.349867 8.180307 8.032804 7.902275 7.785213 7.679097 7.582055 7.492655 7.409782 7.332547 7.260232 7.192247 7.128102 7.067388 7.009755 6.954906 6.902585 6.852568 6.804661 6.772047 6.737722 6.701497 6.663149 6.622414 6.578973 6.532443 6.482350 6.428103 6.368949 6.303913 6.231693 6.150505 6.057799 5.949759 5.820288 5.658726 5.443730 # 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 50.9415 # Specify which KIM Model to use pair_style kim LAMMPSvirial LennardJones612_UniversalShifted__MO_959249795837_002 pair_coeff * * V # 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