# Define looping variables variable loopcount loop 42 variable latticeconst index 4.857620 4.532141 4.330422 4.183862 4.068684 3.973790 3.893095 3.822897 3.760776 3.705065 3.654564 3.608380 3.565834 3.526394 3.489637 3.455221 3.422866 3.392339 3.363445 3.336017 3.309913 3.285013 3.261209 3.238410 3.222889 3.206553 3.189314 3.171063 3.151677 3.131003 3.108859 3.085019 3.059202 3.031051 3.000099 2.965729 2.927091 2.882971 2.831554 2.769938 2.693049 2.590730 # 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 bcc lattice using a single conventional (orthogonal) # unit cell with a lattice constant from the 'latticeconst' variable defined on line 3 above lattice bcc ${latticeconst} region box block 0 1 0 1 0 1 units lattice create_box 1 box create_atoms 1 box mass 1 26.981538 # Specify which KIM Model to use pair_style kim EAM_Dynamo_MendelevKramerBecker_2008_Al__MO_106969701023_005 pair_coeff * * Al # 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