# Define looping variables variable loopcount loop 42 variable latticeconst index 13.735000 12.814699 12.244334 11.829933 11.504264 11.235950 11.007781 10.809294 10.633647 10.476123 10.333328 10.202743 10.082443 9.970924 9.866993 9.769682 9.678198 9.591882 9.510182 9.432628 9.358821 9.288414 9.221109 9.156643 9.112756 9.066568 9.017822 8.966219 8.911403 8.852947 8.790334 8.722926 8.649928 8.570329 8.482813 8.385631 8.276379 8.151630 8.006247 7.832025 7.614619 7.325310 # 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 83.798 # Specify which KIM Model to use pair_style kim LAMMPSvirial Pair_Lennard_Jones_Shifted_Bernardes_LowCutoff_Kr__MO_995724792024_002 pair_coeff * * Kr # 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