# Define looping variables variable loopcount loop 42 variable latticeconst index 27.562500 25.715711 24.571144 23.739556 23.086028 22.547595 22.089724 21.691415 21.338941 21.022832 20.736283 20.474234 20.232824 20.009038 19.800477 19.605201 19.421617 19.248405 19.084455 18.928826 18.780715 18.639429 18.504365 18.375000 18.286931 18.194242 18.096422 17.992869 17.882868 17.765563 17.639915 17.504646 17.358158 17.198422 17.022801 16.827783 16.608544 16.358205 16.066460 15.716842 15.280566 14.700000 # 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 12.0107 # Specify which KIM Model to use pair_style kim Sim_LAMMPS_Vashishta_VashishtaKaliaNakano_2007_SiC__SM_196548226654_000 pair_coeff * * C # 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