# Define looping variables variable loopcount loop 42 variable latticeconst index 3.455770 3.224221 3.080716 2.976452 2.894513 2.827005 2.769597 2.719658 2.675465 2.635831 2.599904 2.567048 2.536781 2.508722 2.482573 2.458089 2.435072 2.413355 2.392799 2.373286 2.354716 2.337002 2.320068 2.303848 2.292806 2.281185 2.268920 2.255937 2.242145 2.227437 2.211684 2.194724 2.176357 2.156330 2.134310 2.109859 2.082371 2.050984 2.014405 1.970571 1.915871 1.843080 # 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 sc lattice using a single conventional (orthogonal) # unit cell with a lattice constant from the 'latticeconst' variable defined on line 3 above lattice sc ${latticeconst} region box block 0 1 0 1 0 1 units lattice create_box 1 box create_atoms 1 box mass 1 63.546 # Specify which KIM Model to use pair_style kim LAMMPSvirial EAM_Dynamo_Wu_Trinkle_CuAg__MO_270337113239_004 pair_coeff * * Cu # 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