# Define looping variables variable loopcount loop 42 variable latticeconst index 3.769810 3.517219 3.360674 3.246935 3.157550 3.083907 3.021283 2.966805 2.918596 2.875361 2.836169 2.800328 2.767310 2.736702 2.708176 2.681468 2.656359 2.632668 2.610244 2.588958 2.568701 2.549377 2.530904 2.513210 2.501165 2.488487 2.475108 2.460945 2.445900 2.429856 2.412670 2.394169 2.374134 2.352286 2.328266 2.301593 2.271607 2.237367 2.197464 2.149646 2.089976 2.010570 # 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 200.59 # Specify which KIM Model to use pair_style kim LJ_ElliottAkerson_2015_Universal__MO_959249795837_003 pair_coeff * * Hg # 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