# Define looping variables variable loopcount loop 42 variable latticeconst index 4.460500 4.161631 3.976403 3.841826 3.736064 3.648929 3.574831 3.510372 3.453330 3.402174 3.355801 3.313393 3.274325 3.238109 3.204358 3.172756 3.143046 3.115015 3.088482 3.063297 3.039328 3.016463 2.994605 2.973670 2.959418 2.944418 2.928587 2.911829 2.894028 2.875044 2.854710 2.832819 2.809113 2.783263 2.754842 2.723282 2.687802 2.647290 2.600076 2.543497 2.472894 2.378940 # 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 78.96 # Specify which KIM Model to use pair_style kim Sim_LAMMPS_BOP_ZhouFosterVanSwol_2014_CdTeSe__SM_567065323363_000 pair_coeff * * Se # 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