# Define looping variables variable loopcount loop 42 variable latticeconst index 13.209100 12.324035 11.775507 11.376972 11.063772 10.805731 10.586298 10.395411 10.226489 10.074995 9.937668 9.812082 9.696388 9.589140 9.489188 9.395602 9.307621 9.224610 9.146037 9.071453 9.000471 8.932761 8.868032 8.806034 8.763828 8.719408 8.672529 8.622902 8.570185 8.513968 8.453753 8.388926 8.318724 8.242172 8.158008 8.064547 7.959480 7.839507 7.699691 7.532141 7.323060 7.044830 # 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 150.36 # Specify which KIM Model to use pair_style kim LAMMPSvirial LennardJones612_UniversalShifted__MO_959249795837_002 pair_coeff * * Sm # 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