# Define looping variables variable loopcount loop 42 variable latticeconst index 6.124070 5.713735 5.459425 5.274656 5.129449 5.009815 4.908082 4.819582 4.741266 4.671031 4.607363 4.549138 4.495500 4.445777 4.399437 4.356049 4.315259 4.276773 4.240345 4.205766 4.172858 4.141465 4.111456 4.082713 4.063145 4.042550 4.020816 3.997807 3.973366 3.947303 3.919385 3.889330 3.856782 3.821291 3.782270 3.738939 3.690227 3.634604 3.569782 3.492101 3.395165 3.266170 # 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 196.96655 # Specify which KIM Model to use pair_style kim LAMMPSvirial MorseEIP_GuthikondaElliott_2011_AuCd__MO_703849496106_001 pair_coeff * * Au # 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