# Define looping variables variable loopcount loop 42 variable latticeconst index 15.562500 14.519755 13.873503 13.403967 13.034968 12.730955 12.472429 12.247534 12.048517 11.870035 11.708241 11.560282 11.423976 11.297620 11.179861 11.069603 10.965947 10.868147 10.775576 10.687705 10.604077 10.524303 10.448043 10.375000 10.325274 10.272940 10.217708 10.159239 10.097129 10.030896 9.959952 9.883575 9.800865 9.710674 9.611514 9.501401 9.377614 9.236266 9.071538 8.874135 8.627802 8.300000 # 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 bcc lattice using a single conventional (orthogonal) # unit cell with a lattice constant from the 'latticeconst' variable defined on line 3 above lattice bcc ${latticeconst} region box block 0 1 0 1 0 1 units lattice create_box 1 box create_atoms 1 box mass 1 28.0855 # Specify which KIM Model to use pair_style kim Sim_LAMMPS_Vashishta_VashishtaKaliaNakano_2007_SiC__SM_196548226654_000 pair_coeff * * Si # 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