# Define looping variables variable loopcount loop 42 variable latticeconst index 6.113110 5.703510 5.449656 5.265217 5.120271 5.000852 4.899300 4.810959 4.732784 4.662674 4.599120 4.541000 4.487458 4.437824 4.391567 4.348257 4.307540 4.269123 4.232760 4.198243 4.165394 4.134058 4.104102 4.075410 4.055877 4.035320 4.013624 3.990657 3.966260 3.940243 3.912375 3.882374 3.849884 3.814456 3.775505 3.732252 3.683627 3.628104 3.563398 3.485856 3.389094 3.260330 # 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 fcc lattice using a single conventional (orthogonal) # unit cell with a lattice constant from the 'latticeconst' variable defined on line 3 above lattice fcc ${latticeconst} region box block 0 1 0 1 0 1 units lattice create_box 1 box create_atoms 1 box mass 1 107.8682 # Specify which KIM Model to use pair_style kim Morse_Shifted_GirifalcoWeizer_1959MedCutoff_Ag__MO_861893969202_002 pair_coeff * * Ag # 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