# Define looping variables variable loopcount loop 42 variable latticeconst index 13.981700 13.044872 12.464263 12.042420 11.710902 11.437769 11.205503 11.003451 10.824650 10.664296 10.518937 10.386007 10.263546 10.150025 10.044228 9.945169 9.852042 9.764176 9.681008 9.602062 9.526929 9.455258 9.386744 9.321120 9.276445 9.229427 9.179806 9.127276 9.071476 9.011970 8.948233 8.879615 8.805306 8.724277 8.635189 8.536262 8.425049 8.298059 8.150065 7.972714 7.751404 7.456900 # 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 40.078 # Specify which KIM Model to use pair_style kim EAM_IMD_BrommerGaehlerMihalkovic_2007_CaCd__MO_145183423516_003 pair_coeff * * Ca # 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