# Define looping variables variable loopcount loop 42 variable latticeconst index 16.277800 15.187132 14.511179 14.020063 13.634106 13.316120 13.045713 12.810481 12.602319 12.415633 12.246404 12.091644 11.949074 11.816911 11.693740 11.578414 11.469994 11.367700 11.270875 11.178964 11.091494 11.008053 10.928288 10.851888 10.799877 10.745137 10.687366 10.626209 10.561245 10.491967 10.417762 10.337875 10.251363 10.157026 10.053308 9.938134 9.808656 9.660811 9.488512 9.282036 9.024380 8.681510 # 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 132.90545 # Specify which KIM Model to use pair_style kim LAMMPSvirial LennardJones612_UniversalShifted__MO_959249795837_002 pair_coeff * * Cs # 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