# Define looping variables variable loopcount loop 42 variable latticeconst index 2.599610 2.425426 2.317473 2.239040 2.177401 2.126618 2.083433 2.045865 2.012621 1.982806 1.955780 1.931064 1.908295 1.887188 1.867517 1.849099 1.831784 1.815447 1.799984 1.785305 1.771336 1.758010 1.745271 1.733070 1.724764 1.716022 1.706796 1.697029 1.686654 1.675591 1.663740 1.650982 1.637166 1.622100 1.605536 1.587143 1.566466 1.542855 1.515339 1.482364 1.441216 1.386460 # 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 12.0107 # Specify which KIM Model to use pair_style kim Sim_LAMMPS_EDIP_JiangMorganSzlufarska_2012_SiC__SM_435704953434_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