# Define looping variables variable loopcount loop 42 variable latticeconst index 10.851100 10.124041 9.673439 9.346052 9.088766 8.876791 8.696533 8.539723 8.400958 8.276510 8.163699 8.060534 7.965493 7.877392 7.795284 7.718405 7.646131 7.577939 7.513394 7.452125 7.393815 7.338192 7.285020 7.234090 7.199418 7.162927 7.124416 7.083648 7.040341 6.994159 6.944693 6.891438 6.833767 6.770880 6.701739 6.624962 6.538650 6.440093 6.325235 6.187593 6.015834 5.787270 # 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 127.60 # Specify which KIM Model to use pair_style kim Sim_LAMMPS_BOP_WardZhouWong_2012_CdZnTe__SM_409035133405_000 pair_coeff * * Te # 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