# Define looping variables variable loopcount loop 42 variable latticeconst index 3.228090 3.011795 2.877745 2.780350 2.703809 2.640748 2.587123 2.540473 2.499191 2.462169 2.428609 2.397918 2.369644 2.343434 2.319008 2.296137 2.274636 2.254349 2.235148 2.216921 2.199574 2.183027 2.167208 2.152057 2.141742 2.130887 2.119430 2.107303 2.094420 2.080681 2.065966 2.050123 2.032967 2.014259 1.993691 1.970851 1.945174 1.915855 1.881686 1.840740 1.789644 1.721650 # 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 12.0107 # Specify which KIM Model to use pair_style kim LAMMPSvirial Tersoff_LAMMPS_Tersoff_PRB39_1989_CSi__MO_171585019474_001 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